[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Mon Apr 26 12:28:55 CEST 2010
SVN commit 1118981 by jmhoffmann:
DownloadRegionDialog: Review fix: show message box every time when the limit
of (currently) 100000 tiles to download is exceeded.
M +10 -2 DownloadRegionDialog.cpp
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.cpp #1118980:1118981
@@ -19,6 +19,7 @@
#include <QtGui/QGroupBox>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
+#include <QtGui/QMessageBox>
#include <QtGui/QPushButton>
#include <QtGui/QRadioButton>
#include <QtGui/QVBoxLayout>
@@ -64,6 +65,7 @@
AbstractScanlineTextureMapper const * const m_textureMapper;
GeoSceneTexture const * const m_textureLayer;
GeoDataLatLonBox m_visibleRegion;
+ qint64 m_lastTilesCount;
};
DownloadRegionDialog::Private::Private( ViewportParams const * const viewport,
@@ -80,7 +82,8 @@
m_viewport( viewport ),
m_textureMapper( textureMapper ),
m_textureLayer( textureMapper->textureLayer() ),
- m_visibleRegion( viewport->viewLatLonAltBox() )
+ m_visibleRegion( viewport->viewLatLonAltBox() ),
+ m_lastTilesCount( 0 )
{
m_latLonBoxWidget->setEnabled( false );
m_latLonBoxWidget->setLatLonBox( m_visibleRegion );
@@ -276,7 +279,12 @@
{
TileCoordsPyramid const pyramid = region();
qint64 const tilesCount = pyramid.tilesCount();
- mDebug() << "updateTilesCount:" << tilesCount;
+ if ( tilesCount > maxTilesCount && d->m_lastTilesCount < maxTilesCount ) {
+ QMessageBox tooManyTiles;
+ tooManyTiles.setText( tr( "There is a limit of %n tiles to download.", "", maxTilesCount ));
+ tooManyTiles.exec();
+ }
+ d->m_lastTilesCount = tilesCount;
d->m_tilesCountLabel->setText( QString::number( tilesCount ));
d->m_okButton->setEnabled( tilesCount > 0 && tilesCount <= maxTilesCount );
}
More information about the Marble-commits
mailing list