Skip to content

Commit

Permalink
we don't have a file menu anymore (also moves project properties to p…
Browse files Browse the repository at this point in the history
…roject menu on windows)
  • Loading branch information
jef-n committed May 28, 2013
1 parent cad339d commit c510c44
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
5 changes: 3 additions & 2 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
21 changes: 11 additions & 10 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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() ) );
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down Expand Up @@ -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(); }
Expand Down
5 changes: 3 additions & 2 deletions src/app/qgisappinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion src/gui/qgisinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/ui/qgisapp.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -241,7 +241,7 @@
</widget>
<addaction name="menuOpenStreetMap"/>
</widget>
<addaction name="mFileMenu"/>
<addaction name="mProjectMenu"/>
<addaction name="mEditMenu"/>
<addaction name="mViewMenu"/>
<addaction name="mLayerMenu"/>
Expand Down

0 comments on commit c510c44

Please sign in to comment.