[Marble-commits] KDE/kdeedu/marble/src
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Wed Mar 30 16:51:32 CEST 2011
SVN commit 1226568 by beschow:
make MapWizard modal
M +14 -12 QtMainWindow.cpp
M +0 -2 QtMainWindow.h
M +3 -3 lib/MapWizard.cpp
M +2 -2 lib/MapWizard.h
M +9 -12 marble_part.cpp
M +0 -2 marble_part.h
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1226567:1226568
@@ -139,7 +139,6 @@
m_position = NOT_AVAILABLE;
m_distance = marbleWidget()->distanceString();
m_clock = QLocale().toString( m_controlView->marbleModel()->clockDateTime().addSecs( m_controlView->marbleModel()->clockTimezone() ), QLocale::ShortFormat );
- m_mapWizard = new MapWizard();
QTimer::singleShot( 0, this, SLOT( initObject() ) );
}
@@ -998,11 +997,6 @@
}
settings.endGroup();
- settings.beginGroup( "MapWizard" );
- m_mapWizard->setWmsServers( settings.value( "wmsServers" ).toStringList() );
- m_mapWizard->setStaticUrlServers( settings.value( "staticUrlServers" ).toStringList() );
- settings.endGroup();
-
settings.beginGroup( "Plugins");
QString positionProvider = settings.value( "activePositionTrackingPlugin", QString() ).toString();
if ( !positionProvider.isEmpty() ) {
@@ -1118,11 +1112,6 @@
settings.setValue( "activePositionTrackingPlugin", positionProvider );
settings.endGroup();
- settings.beginGroup( "MapWizard" );
- settings.setValue( "wmsServers", m_mapWizard->wmsServers() );
- settings.setValue( "staticUrlServers", m_mapWizard->staticUrlServers() );
- settings.endGroup();
-
// The config dialog has to write settings.
m_configDialog->writeSettings();
@@ -1343,7 +1332,20 @@
void MainWindow::showMapWizard()
{
- m_mapWizard->show();
+ QPointer<MapWizard> mapWizard = new MapWizard();
+ QSettings settings("kde.org", "Marble Desktop Globe");
+
+ settings.beginGroup( "MapWizard" );
+ mapWizard->setWmsServers( settings.value( "wmsServers" ).toStringList() );
+ mapWizard->setStaticUrlServers( settings.value( "staticUrlServers" ).toStringList() );
+ settings.endGroup();
+
+ mapWizard->exec();
+
+ settings.beginGroup( "MapWizard" );
+ settings.setValue( "wmsServers", mapWizard->wmsServers() );
+ settings.setValue( "staticUrlServers", mapWizard->staticUrlServers() );
+ settings.endGroup();
}
#include "QtMainWindow.moc"
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.h #1226567:1226568
@@ -32,7 +32,6 @@
class QtMarbleConfigDialog;
class DownloadRegionDialog;
class RoutingWidget;
-class MapWizard;
class StackableWindow;
class MainWindow : public QMainWindow
@@ -135,7 +134,6 @@
TimeControlWidget* m_timeControlDialog;
QtMarbleConfigDialog *m_configDialog;
DownloadRegionDialog* m_downloadRegionDialog;
- MapWizard* m_mapWizard;
/// Store plugin toolbar pointers so that they can be removed/updated later
QList<QToolBar*> m_pluginToolbars;
--- trunk/KDE/kdeedu/marble/src/lib/MapWizard.cpp #1226567:1226568
@@ -478,7 +478,7 @@
d->uiWidget.textBrowserLegend->setHtml( d->legendHtml );
}
-QString MapWizard::createArchive( QString mapId )
+QString MapWizard::createArchive( QWidget *parent, QString mapId )
{
QStringList splitMapId( mapId.split("/") );
QString body = splitMapId[0];
@@ -527,10 +527,10 @@
switch( archiver.execute( "tar", tarArgs ) )
{
case -2:
- QMessageBox::critical( this, tr( "Archiving failed" ), tr( "Archiving process cannot be started." ) );
+ QMessageBox::critical( parent, tr( "Archiving failed" ), tr( "Archiving process cannot be started." ) );
break;
case -1:
- QMessageBox::critical( this, tr( "Archiving failed" ), tr( "Archiving process crashed." ) );
+ QMessageBox::critical( parent, tr( "Archiving failed" ), tr( "Archiving process crashed." ) );
break;
case 0:
mDebug() << "Archived the theme sucessfully.";
--- trunk/KDE/kdeedu/marble/src/lib/MapWizard.h #1226567:1226568
@@ -44,8 +44,8 @@
QStringList staticUrlServers() const;
void setStaticUrlServers( const QStringList& uris );
- QString createArchive( QString mapId );
- void deleteArchive( QString mapId );
+ static QString createArchive( QWidget *parent, QString mapId );
+ static void deleteArchive( QString mapId );
// QWizard's functions
virtual void accept();
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1226567:1226568
@@ -147,8 +147,6 @@
setXMLFile( "marble_part.rc" );
- m_mapWizard = new MapWizard( m_controlView );
-
m_statusBarExtension = new KParts::StatusBarExtension( this );
m_statusBarExtension->statusBar()->setUpdatesEnabled( false );
@@ -424,10 +422,6 @@
m_initialGraphicsSystem = (GraphicsSystem) MarbleSettings::graphicsSystem();
m_previousGraphicsSystem = m_initialGraphicsSystem;
- // Map Wizard
- m_mapWizard->setWmsServers( MarbleSettings::wmsServers() );
- m_mapWizard->setStaticUrlServers( MarbleSettings::staticUrlServers() );
-
// Plugins
QHash<QString, int> pluginEnabled;
QHash<QString, int> pluginVisible;
@@ -620,9 +614,6 @@
MarbleSettings::setDateTime( m_controlView->marbleModel()->clockDateTime() );
MarbleSettings::setSpeedSlider( m_controlView->marbleModel()->clockSpeed() );
- MarbleSettings::setWmsServers( m_mapWizard->wmsServers() );
- MarbleSettings::setStaticUrlServers( m_mapWizard->staticUrlServers() );
-
// Plugins
QList<int> pluginEnabled;
QList<int> pluginVisible;
@@ -1153,9 +1144,9 @@
QPointer<KNS3::UploadDialog> dialog( new KNS3::UploadDialog( newStuffConfig ) );
kDebug() << "Creating the archive";
- dialog->setUploadFile( KUrl( m_mapWizard->createArchive( m_controlView->marbleWidget()->mapThemeId() ) ) );
+ dialog->setUploadFile( KUrl( MapWizard::createArchive( m_controlView, m_controlView->marbleWidget()->mapThemeId() ) ) );
dialog->exec();
- m_mapWizard->deleteArchive( m_controlView->marbleWidget()->mapThemeId() );
+ MapWizard::deleteArchive( m_controlView->marbleWidget()->mapThemeId() );
delete dialog;
}
@@ -1231,7 +1222,13 @@
void MarblePart::showMapWizard()
{
- m_mapWizard->show();
+ // Map Wizard
+ QPointer<MapWizard> mapWizard = new MapWizard( m_controlView );
+ mapWizard->setWmsServers( MarbleSettings::wmsServers() );
+ mapWizard->setStaticUrlServers( MarbleSettings::staticUrlServers() );
+ mapWizard->exec();
+ MarbleSettings::setWmsServers( mapWizard->wmsServers() );
+ MarbleSettings::setStaticUrlServers( mapWizard->staticUrlServers() );
}
void MarblePart::editSettings()
--- trunk/KDE/kdeedu/marble/src/marble_part.h #1226567:1226568
@@ -44,7 +44,6 @@
class SunControlWidget;
class TimeControlWidget;
class GeoDataFolder;
-class MapWizard;
class MarblePart: public KParts::ReadOnlyPart
{
@@ -198,7 +197,6 @@
SunControlWidget *m_sunControlDialog;
TimeControlWidget *m_timeControlDialog;
DownloadRegionDialog *m_downloadRegionDialog;
- MapWizard *m_mapWizard;
// Actions for the GUI.
KAction *m_exportMapAction;
More information about the Marble-commits
mailing list