[Marble-commits] KDE/kdeedu/marble/src/lib/routing
Dennis Nienhüser
earthwings at gentoo.org
Sat Mar 26 12:17:41 CET 2011
SVN commit 1226031 by nienhueser:
Move the Maemo dependent stacked window attributes into the RoutingProfileSettingsDialog and handle closing the dialog appropriately. Fixes profile configuration being only partly saved on Maemo.
M +16 -1 RoutingProfileSettingsDialog.cpp
M +0 -5 RoutingWidget.cpp
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingProfileSettingsDialog.cpp #1226030:1226031
@@ -27,6 +27,12 @@
: QDialog( parent ), m_pluginManager( pluginManager ),
m_profilesModel ( profilesModel ), m_dialog( 0 ), m_dialogLayout( 0 )
{
+#ifdef Q_WS_MAEMO_5
+ setAttribute( Qt::WA_Maemo5StackedWindow );
+ setWindowFlags( Qt::Window );
+ setWindowTitle( tr( "Routing Profile - Marble" ) );
+#endif // Q_WS_MAEMO_5
+
m_ui = new Ui_RoutingProfileSettingsDialog();
m_ui->setupUi( this );
bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
@@ -109,8 +115,17 @@
m_ui->settingsStack->setCurrentWidget( m_ui->selectServicePage );
m_ui->settingsStack->setEnabled( false );
- if ( exec() != QDialog::Accepted) return;
+ bool applyOnRejection = false;
+#ifdef Q_WS_MAEMO_5
+ // Needed because the stacked window on Maemo closes the dialog when
+ // using the back button, which is the only way to leave that window.
+ applyOnRejection = true;
+#endif // Q_WS_MAEMO_5
+ if ( exec() != QDialog::Accepted && !applyOnRejection ) {
+ return;
+ }
+
m_profilesModel->setProfileName( profileIndex, m_ui->name->text() );
QHash< QString, QHash< QString, QVariant > > pluginSettings;
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.cpp #1226030:1226031
@@ -478,11 +478,6 @@
int index = d->m_ui.routingProfileComboBox->currentIndex();
if ( index != -1 ) {
RoutingProfileSettingsDialog dialog( d->m_widget->model()->pluginManager(), d->m_routingManager->profilesModel(), this );
-#ifdef Q_WS_MAEMO_5
- dialog.setAttribute( Qt::WA_Maemo5StackedWindow );
- dialog.setWindowFlags( Qt::Window );
- dialog.setWindowTitle( tr( "Routing Profile - Marble" ) );
-#endif // Q_WS_MAEMO_5
dialog.editProfile( d->m_ui.routingProfileComboBox->currentIndex() );
d->m_routeRequest->setRoutingProfile( d->m_routingManager->profilesModel()->profiles().at( index ) );
}
More information about the Marble-commits
mailing list