Skip to content

Commit

Permalink
Use Qt recommended code to display modeless About dialog; don't mix m…
Browse files Browse the repository at this point in the history
…odal (exec()) and nonmodal (show()) routines.

Also add menu seperators which were lost in the Qt3 to 4 conversion.


git-svn-id: http://svn.osgeo.org/qgis/trunk@6306 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Dec 22, 2006
1 parent 7dd840b commit 0cadc32
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/gui/qgisapp.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ void QgisApp::createMenus()
mFileMenu->addAction(mActionFileSave); mFileMenu->addAction(mActionFileSave);
mFileMenu->addAction(mActionFileSaveAs); mFileMenu->addAction(mActionFileSaveAs);
mFileMenu->addAction(mActionSaveMapAsImage); mFileMenu->addAction(mActionSaveMapAsImage);
mFileMenu->addSeparator();
mFileMenu->addAction(mActionExportMapServer); mFileMenu->addAction(mActionExportMapServer);
mFileMenu->addAction(mActionFilePrint); mFileMenu->addAction(mActionFilePrint);
mFileMenu->addSeparator(); mFileMenu->addSeparator();
Expand All @@ -766,8 +767,10 @@ void QgisApp::createMenus()
mViewMenu->addAction(mActionZoomToLayer); mViewMenu->addAction(mActionZoomToLayer);
mViewMenu->addAction(mActionZoomLast); mViewMenu->addAction(mActionZoomLast);
mViewMenu->addAction(mActionDraw); mViewMenu->addAction(mActionDraw);
mViewMenu->addSeparator();
mViewMenu->addAction(mActionShowBookmarks); mViewMenu->addAction(mActionShowBookmarks);
mViewMenu->addAction(mActionNewBookmark); mViewMenu->addAction(mActionNewBookmark);
mViewMenu->addSeparator();
mToolbarMenu = mViewMenu->addMenu(QIcon(myIconPath+"/mActionOptions.png"), mToolbarMenu = mViewMenu->addMenu(QIcon(myIconPath+"/mActionOptions.png"),
tr("&Toolbars...")); tr("&Toolbars..."));


Expand All @@ -785,11 +788,14 @@ void QgisApp::createMenus()
mLayerMenu->addAction(mActionAddLayer); mLayerMenu->addAction(mActionAddLayer);
#endif #endif
mLayerMenu->addAction(mActionAddWmsLayer); mLayerMenu->addAction(mActionAddWmsLayer);
mLayerMenu->addSeparator();
mLayerMenu->addAction(mActionRemoveLayer); mLayerMenu->addAction(mActionRemoveLayer);
mLayerMenu->addAction(mActionNewVectorLayer); mLayerMenu->addAction(mActionNewVectorLayer);
mLayerMenu->addSeparator();
mLayerMenu->addAction(mActionInOverview); mLayerMenu->addAction(mActionInOverview);
mLayerMenu->addAction(mActionAddAllToOverview); mLayerMenu->addAction(mActionAddAllToOverview);
mLayerMenu->addAction(mActionRemoveAllFromOverview); mLayerMenu->addAction(mActionRemoveAllFromOverview);
mLayerMenu->addSeparator();
mLayerMenu->addAction(mActionHideAllLayers); mLayerMenu->addAction(mActionHideAllLayers);
mLayerMenu->addAction(mActionShowAllLayers); mLayerMenu->addAction(mActionShowAllLayers);


Expand All @@ -804,6 +810,7 @@ void QgisApp::createMenus()
// Plugins Menu // Plugins Menu
mPluginMenu = menuBar()->addMenu(tr("&Plugins")); mPluginMenu = menuBar()->addMenu(tr("&Plugins"));
mPluginMenu->addAction(mActionShowPluginManager); mPluginMenu->addAction(mActionShowPluginManager);
mPluginMenu->addSeparator();


// Add the plugin manager action to it // Add the plugin manager action to it
//actionPluginManager->addTo(mPluginMenu); //actionPluginManager->addTo(mPluginMenu);
Expand All @@ -816,8 +823,10 @@ void QgisApp::createMenus()
menuBar()->addSeparator(); menuBar()->addSeparator();
mHelpMenu = menuBar()->addMenu(tr("&Help")); mHelpMenu = menuBar()->addMenu(tr("&Help"));
mHelpMenu->addAction(mActionHelpContents); mHelpMenu->addAction(mActionHelpContents);
mHelpMenu->addSeparator();
mHelpMenu->addAction(mActionQgisHomePage); mHelpMenu->addAction(mActionQgisHomePage);
mHelpMenu->addAction(mActionCheckQgisVersion); mHelpMenu->addAction(mActionCheckQgisVersion);
mHelpMenu->addSeparator();
mHelpMenu->addAction(mActionHelpAbout); mHelpMenu->addAction(mActionHelpAbout);
} }


Expand Down Expand Up @@ -1283,8 +1292,10 @@ void QgisApp::restoreWindowState()


void QgisApp::about() void QgisApp::about()
{ {
static QgsAbout *abt = NULL;
if (!abt) {
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
QgsAbout *abt = new QgsAbout(); abt = new QgsAbout();
QString versionString = tr("Version "); QString versionString = tr("Version ");
versionString += QGis::qgisVersion; versionString += QGis::qgisVersion;
versionString += " ("; versionString += " (";
Expand Down Expand Up @@ -1358,9 +1369,10 @@ abt->setWhatsNew(watsNew);
QString providerInfo = "<b>" + tr("Available Data Provider Plugins") + "</b><br>"; QString providerInfo = "<b>" + tr("Available Data Provider Plugins") + "</b><br>";
abt->setPluginInfo(providerInfo + mProviderRegistry->pluginList(true)); abt->setPluginInfo(providerInfo + mProviderRegistry->pluginList(true));
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
}
abt->show(); abt->show();
abt->exec(); abt->raise();

abt->setActiveWindow();
} }


/** Load up any plugins used in the last session /** Load up any plugins used in the last session
Expand Down Expand Up @@ -5290,7 +5302,7 @@ void QgisApp::showBookmarks()
static QgsBookmarks *bookmarks = NULL; static QgsBookmarks *bookmarks = NULL;
if (bookmarks == NULL) if (bookmarks == NULL)
{ {
bookmarks = new QgsBookmarks(this); bookmarks = new QgsBookmarks(this, Qt::WindowMinMaxButtonsHint);
} }
bookmarks->show(); bookmarks->show();
bookmarks->raise(); bookmarks->raise();
Expand Down

0 comments on commit 0cadc32

Please sign in to comment.