Skip to content
Permalink
Browse files

we don't have a file menu anymore (also moves project properties to p…

…roject menu on windows)
  • Loading branch information
jef-n committed May 28, 2013
1 parent cad339d commit c510c449ba0f763a342c502fe389c5208e66f8b3
@@ -321,7 +321,8 @@ class QgisInterface : QObject
*/

//! Menus
virtual QMenu *fileMenu() = 0;
virtual QMenu *fileMenu() = 0 /Deprecated/;
virtual QMenu *projectMenu() = 0;
virtual QMenu *editMenu() = 0;
virtual QMenu *viewMenu() = 0;
virtual QMenu *layerMenu() = 0;
@@ -366,7 +367,7 @@ class QgisInterface : QObject
*/
virtual QToolBar *webToolBar() = 0;

//! File menu actions
//! Project menu actions
virtual QAction *actionNewProject() = 0;
virtual QAction *actionOpenProject() = 0;
virtual QAction *actionSaveProject() = 0;
@@ -867,7 +867,7 @@ void QgisApp::readSettings()
// 'gis' theme is new /themes/default directory (2013-04-15)
setTheme( settings.value( "/Themes", "default" ).toString() );

// Add the recently accessed project file paths to the File menu
// Add the recently accessed project file paths to the Project menu
mRecentProjectPaths = settings.value( "/UI/recentProjectsList" ).toStringList();

// this is a new session! reset enable macros value to "ask"
@@ -888,7 +888,8 @@ void QgisApp::createActions()
mActionPluginSeparator1 = NULL; // plugin list separator will be created when the first plugin is loaded
mActionPluginSeparator2 = NULL; // python separator will be created only if python is found
mActionRasterSeparator = NULL; // raster plugins list separator will be created when the first plugin is loaded
// File Menu Items

// Project Menu Items

connect( mActionNewProject, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
connect( mActionNewBlankProject, SIGNAL( triggered() ), this, SLOT( fileNewBlank() ) );
@@ -1226,8 +1227,8 @@ void QgisApp::createMenus()
* for the following items.
*
* Project Properties:
* Gnome, Mac - File menu above print commands
* Kde, Win - Settings menu (Win doesn't specify)
* Gnome, Mac, Win - File/Project menu above print commands (Win doesn't specify)
* Kde - Settings menu
*
* Custom CRS, Options:
* Gnome - bottom of Edit menu
@@ -1251,20 +1252,20 @@ void QgisApp::createMenus()
QDialogButtonBox::ButtonLayout layout =
QDialogButtonBox::ButtonLayout( style()->styleHint( QStyle::SH_DialogButtonLayout, 0, this ) );

// File Menu
// Project Menu

// Connect once for the entire submenu.
connect( mRecentProjectsMenu, SIGNAL( triggered( QAction * ) ),
this, SLOT( openProject( QAction * ) ) );
connect( mProjectFromTemplateMenu, SIGNAL( triggered( QAction * ) ),
this, SLOT( fileNewFromTemplateAction( QAction * ) ) );

if ( layout == QDialogButtonBox::GnomeLayout || layout == QDialogButtonBox::MacLayout )
if ( layout == QDialogButtonBox::GnomeLayout || layout == QDialogButtonBox::MacLayout || layout == QDialogButtonBox::WinLayout )
{
QAction* before = mActionNewPrintComposer;
mSettingsMenu->removeAction( mActionProjectProperties );
mFileMenu->insertAction( before, mActionProjectProperties );
mFileMenu->insertSeparator( before );
mProjectMenu->insertAction( before, mActionProjectProperties );
mProjectMenu->insertSeparator( before );
}

// View Menu
@@ -2238,7 +2239,7 @@ void QgisApp::projectReadDecorationItems()
}
}

// Update file menu with the current list of recently accessed projects
// Update project menu with the current list of recently accessed projects
void QgisApp::updateRecentProjectPaths()
{
// Remove existing paths from the recent projects menu
@@ -2293,7 +2294,7 @@ void QgisApp::saveRecentProjectPath( QString projectPath, QSettings & settings )

} // QgisApp::saveRecentProjectPath

// Update file menu with the project templates
// Update project menu with the project templates
void QgisApp::updateProjectFromTemplates()
{
// get list of project files in template dir
@@ -359,7 +359,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionShowPinnedLabels() { return mActionShowPinnedLabels; }

//! Menus
QMenu *fileMenu() { return mFileMenu; }
Q_DECL_DEPRECATED QMenu *fileMenu() { return mProjectMenu; }
QMenu *projectMenu() { return mProjectMenu; }
QMenu *editMenu() { return mEditMenu; }
QMenu *viewMenu() { return mViewMenu; }
QMenu *layerMenu() { return mLayerMenu; }
@@ -587,7 +588,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow

QgsMessageLogViewer *logViewer() { return mLogViewer; }

//! Update file menu with the project templates
//! Update project menu with the project templates
void updateProjectFromTemplates();

protected:
@@ -1166,7 +1167,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
* instance simultaneously results in data loss.
*/
void saveRecentProjectPath( QString projectPath, QSettings & settings );
//! Update file menu with the current list of recently accessed projects
//! Update project menu with the current list of recently accessed projects
void updateRecentProjectPaths();
//! Read Well Known Binary stream from PostGIS
//void readWKB(const char *, QStringList tables);
@@ -426,7 +426,8 @@ bool QgisAppInterface::unregisterMainWindowAction( QAction* action )
}

//! Menus
QMenu *QgisAppInterface::fileMenu() { return qgis->fileMenu(); }
Q_DECL_DEPRECATED QMenu *QgisAppInterface::fileMenu() { return qgis->projectMenu(); }
QMenu *QgisAppInterface::projectMenu() { return qgis->projectMenu(); }
QMenu *QgisAppInterface::editMenu() { return qgis->editMenu(); }
QMenu *QgisAppInterface::viewMenu() { return qgis->viewMenu(); }
QMenu *QgisAppInterface::layerMenu() { return qgis->layerMenu(); }
@@ -455,7 +456,7 @@ QToolBar *QgisAppInterface::vectorToolBar() { return qgis->vectorToolBar(); }
QToolBar *QgisAppInterface::databaseToolBar() { return qgis->databaseToolBar(); }
QToolBar *QgisAppInterface::webToolBar() { return qgis->webToolBar(); }

//! File menu actions
//! Project menu actions
QAction *QgisAppInterface::actionNewProject() { return qgis->actionNewProject(); }
QAction *QgisAppInterface::actionOpenProject() { return qgis->actionOpenProject(); }
QAction *QgisAppInterface::actionSaveProject() { return qgis->actionSaveProject(); }
@@ -279,7 +279,8 @@ class QgisAppInterface : public QgisInterface
*/

//! Menus
virtual QMenu *fileMenu();
Q_DECL_DEPRECATED virtual QMenu *fileMenu();
virtual QMenu *projectMenu();
virtual QMenu *editMenu();
virtual QMenu *viewMenu();
virtual QMenu *layerMenu();
@@ -309,7 +310,7 @@ class QgisAppInterface : public QgisInterface
virtual QToolBar *databaseToolBar();
virtual QToolBar *webToolBar();

//! File menu actions
//! Project menu actions
virtual QAction *actionNewProject();
virtual QAction *actionOpenProject();
virtual QAction *actionSaveProject();
@@ -370,7 +370,11 @@ class GUI_EXPORT QgisInterface : public QObject
*/

//! Menus
#ifndef Q_MOC_RUN
Q_DECL_DEPRECATED
#endif
virtual QMenu *fileMenu() = 0;
virtual QMenu *projectMenu() = 0;
virtual QMenu *editMenu() = 0;
virtual QMenu *viewMenu() = 0;
virtual QMenu *layerMenu() = 0;
@@ -415,7 +419,7 @@ class GUI_EXPORT QgisInterface : public QObject
*/
virtual QToolBar *webToolBar() = 0;

//! File menu actions
//! Project menu actions
virtual QAction *actionNewProject() = 0;
virtual QAction *actionOpenProject() = 0;
virtual QAction *actionSaveProject() = 0;
@@ -17,7 +17,7 @@
<x>0</x>
<y>0</y>
<width>1050</width>
<height>21</height>
<height>18</height>
</rect>
</property>
<widget class="QMenu" name="mEditMenu">
@@ -49,7 +49,7 @@
<addaction name="mActionNodeTool"/>
<addaction name="mActionRotatePointSymbols"/>
</widget>
<widget class="QMenu" name="mFileMenu">
<widget class="QMenu" name="mProjectMenu">
<property name="title">
<string>P&amp;roject</string>
</property>
@@ -241,7 +241,7 @@
</widget>
<addaction name="menuOpenStreetMap"/>
</widget>
<addaction name="mFileMenu"/>
<addaction name="mProjectMenu"/>
<addaction name="mEditMenu"/>
<addaction name="mViewMenu"/>
<addaction name="mLayerMenu"/>

0 comments on commit c510c44

Please sign in to comment.
You can’t perform that action at this time.