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
Expand Up @@ -753,6 +753,7 @@ void QgisApp::createMenus()
mFileMenu->addAction(mActionFileSave);
mFileMenu->addAction(mActionFileSaveAs);
mFileMenu->addAction(mActionSaveMapAsImage);
mFileMenu->addSeparator();
mFileMenu->addAction(mActionExportMapServer);
mFileMenu->addAction(mActionFilePrint);
mFileMenu->addSeparator();
Expand All @@ -766,8 +767,10 @@ void QgisApp::createMenus()
mViewMenu->addAction(mActionZoomToLayer);
mViewMenu->addAction(mActionZoomLast);
mViewMenu->addAction(mActionDraw);
mViewMenu->addSeparator();
mViewMenu->addAction(mActionShowBookmarks);
mViewMenu->addAction(mActionNewBookmark);
mViewMenu->addSeparator();
mToolbarMenu = mViewMenu->addMenu(QIcon(myIconPath+"/mActionOptions.png"),
tr("&Toolbars..."));

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

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

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

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

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

abt->raise();
abt->setActiveWindow();
}

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

0 comments on commit 0cadc32

Please sign in to comment.