[Marble-commits] KDE/kdeedu/marble/src
Jens-Michael Hoffmann
jensmh at gmx.de
Tue May 11 23:55:31 CEST 2010
SVN commit 1125658 by jmhoffmann:
DownloadRegionDialog: Add "Apply" button which also triggers the download,
but leaves the dialog open to allow another download.
M +7 -1 lib/DownloadRegionDialog.cpp
M +4 -0 lib/DownloadRegionDialog.h
M +1 -1 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.cpp #1125657:1125658
@@ -58,6 +58,7 @@
QLabel * m_tilesCountLabel;
QLabel * m_tilesCountLimitInfo;
QPushButton * m_okButton;
+ QPushButton * m_applyButton;
int m_originatingTileLevel;
int m_minimumAllowedTileLevel;
int m_maximumAllowedTileLevel;
@@ -76,6 +77,7 @@
m_tilesCountLabel( 0 ),
m_tilesCountLimitInfo( 0 ),
m_okButton( 0 ),
+ m_applyButton( 0 ),
m_originatingTileLevel( textureMapper->tileZoomLevel() ),
m_minimumAllowedTileLevel( -1 ),
m_maximumAllowedTileLevel( -1 ),
@@ -127,9 +129,11 @@
{
QDialogButtonBox * const buttonBox = new QDialogButtonBox;
m_okButton = buttonBox->addButton( QDialogButtonBox::Ok );
+ m_applyButton = buttonBox->addButton( QDialogButtonBox::Apply );
buttonBox->addButton( QDialogButtonBox::Cancel );
connect( buttonBox, SIGNAL( accepted() ), m_dialog, SLOT( accept() ));
connect( buttonBox, SIGNAL( rejected() ), m_dialog, SLOT( reject() ));
+ connect( m_applyButton, SIGNAL( clicked() ), m_dialog, SIGNAL( applied() ));
return buttonBox;
}
@@ -301,7 +305,9 @@
d->m_tilesCountLimitInfo->clear();
}
d->m_tilesCountLabel->setText( QString::number( tilesCount ));
- d->m_okButton->setEnabled( tilesCount > 0 && tilesCount <= maxTilesCount );
+ bool const tilesCountWithinLimits = tilesCount > 0 && tilesCount <= maxTilesCount;
+ d->m_okButton->setEnabled( tilesCountWithinLimits );
+ d->m_applyButton->setEnabled( tilesCountWithinLimits );
}
}
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.h #1125657:1125658
@@ -44,6 +44,10 @@
void setMapTheme( QString const & );
void setVisibleLatLonAltBox( GeoDataLatLonAltBox const & );
+ Q_SIGNALS:
+ /// This signal is emitted when the "Apply" button is pressed.
+ void applied();
+
private Q_SLOTS:
void toggleSelectionMethod();
void updateTilesCount();
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1125657:1125658
@@ -979,7 +979,7 @@
if ( !m_downloadRegionDialog ) {
m_downloadRegionDialog = new DownloadRegionDialog( viewport, model->textureMapper() );
connect( m_downloadRegionDialog, SIGNAL( accepted() ), SLOT( downloadRegion() ));
- //connect( m_downloadRegionDialog, SIGNAL( applied() ), SLOT( downloadRegion() ));
+ connect( m_downloadRegionDialog, SIGNAL( applied() ), SLOT( downloadRegion() ));
connect( m_controlView->marbleWidget(), SIGNAL( visibleLatLonAltBoxChanged( GeoDataLatLonAltBox )),
m_downloadRegionDialog, SLOT( setVisibleLatLonAltBox( GeoDataLatLonAltBox )));
connect( m_controlView->marbleWidget(), SIGNAL( themeChanged( QString )),
More information about the Marble-commits
mailing list