Skip to content

Commit c510c44

Browse files
committed
we don't have a file menu anymore (also moves project properties to project menu on windows)
1 parent cad339d commit c510c44

File tree

7 files changed

+32
-23
lines changed

7 files changed

+32
-23
lines changed

python/gui/qgisinterface.sip

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ class QgisInterface : QObject
321321
*/
322322

323323
//! Menus
324-
virtual QMenu *fileMenu() = 0;
324+
virtual QMenu *fileMenu() = 0 /Deprecated/;
325+
virtual QMenu *projectMenu() = 0;
325326
virtual QMenu *editMenu() = 0;
326327
virtual QMenu *viewMenu() = 0;
327328
virtual QMenu *layerMenu() = 0;
@@ -366,7 +367,7 @@ class QgisInterface : QObject
366367
*/
367368
virtual QToolBar *webToolBar() = 0;
368369

369-
//! File menu actions
370+
//! Project menu actions
370371
virtual QAction *actionNewProject() = 0;
371372
virtual QAction *actionOpenProject() = 0;
372373
virtual QAction *actionSaveProject() = 0;

src/app/qgisapp.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ void QgisApp::readSettings()
867867
// 'gis' theme is new /themes/default directory (2013-04-15)
868868
setTheme( settings.value( "/Themes", "default" ).toString() );
869869

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

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

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

1254-
// File Menu
1255+
// Project Menu
12551256

12561257
// Connect once for the entire submenu.
12571258
connect( mRecentProjectsMenu, SIGNAL( triggered( QAction * ) ),
12581259
this, SLOT( openProject( QAction * ) ) );
12591260
connect( mProjectFromTemplateMenu, SIGNAL( triggered( QAction * ) ),
12601261
this, SLOT( fileNewFromTemplateAction( QAction * ) ) );
12611262

1262-
if ( layout == QDialogButtonBox::GnomeLayout || layout == QDialogButtonBox::MacLayout )
1263+
if ( layout == QDialogButtonBox::GnomeLayout || layout == QDialogButtonBox::MacLayout || layout == QDialogButtonBox::WinLayout )
12631264
{
12641265
QAction* before = mActionNewPrintComposer;
12651266
mSettingsMenu->removeAction( mActionProjectProperties );
1266-
mFileMenu->insertAction( before, mActionProjectProperties );
1267-
mFileMenu->insertSeparator( before );
1267+
mProjectMenu->insertAction( before, mActionProjectProperties );
1268+
mProjectMenu->insertSeparator( before );
12681269
}
12691270

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

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

22942295
} // QgisApp::saveRecentProjectPath
22952296

2296-
// Update file menu with the project templates
2297+
// Update project menu with the project templates
22972298
void QgisApp::updateProjectFromTemplates()
22982299
{
22992300
// get list of project files in template dir

src/app/qgisapp.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
359359
QAction *actionShowPinnedLabels() { return mActionShowPinnedLabels; }
360360

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

588589
QgsMessageLogViewer *logViewer() { return mLogViewer; }
589590

590-
//! Update file menu with the project templates
591+
//! Update project menu with the project templates
591592
void updateProjectFromTemplates();
592593

593594
protected:
@@ -1166,7 +1167,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
11661167
* instance simultaneously results in data loss.
11671168
*/
11681169
void saveRecentProjectPath( QString projectPath, QSettings & settings );
1169-
//! Update file menu with the current list of recently accessed projects
1170+
//! Update project menu with the current list of recently accessed projects
11701171
void updateRecentProjectPaths();
11711172
//! Read Well Known Binary stream from PostGIS
11721173
//void readWKB(const char *, QStringList tables);

src/app/qgisappinterface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,8 @@ bool QgisAppInterface::unregisterMainWindowAction( QAction* action )
426426
}
427427

428428
//! Menus
429-
QMenu *QgisAppInterface::fileMenu() { return qgis->fileMenu(); }
429+
Q_DECL_DEPRECATED QMenu *QgisAppInterface::fileMenu() { return qgis->projectMenu(); }
430+
QMenu *QgisAppInterface::projectMenu() { return qgis->projectMenu(); }
430431
QMenu *QgisAppInterface::editMenu() { return qgis->editMenu(); }
431432
QMenu *QgisAppInterface::viewMenu() { return qgis->viewMenu(); }
432433
QMenu *QgisAppInterface::layerMenu() { return qgis->layerMenu(); }
@@ -455,7 +456,7 @@ QToolBar *QgisAppInterface::vectorToolBar() { return qgis->vectorToolBar(); }
455456
QToolBar *QgisAppInterface::databaseToolBar() { return qgis->databaseToolBar(); }
456457
QToolBar *QgisAppInterface::webToolBar() { return qgis->webToolBar(); }
457458

458-
//! File menu actions
459+
//! Project menu actions
459460
QAction *QgisAppInterface::actionNewProject() { return qgis->actionNewProject(); }
460461
QAction *QgisAppInterface::actionOpenProject() { return qgis->actionOpenProject(); }
461462
QAction *QgisAppInterface::actionSaveProject() { return qgis->actionSaveProject(); }

src/app/qgisappinterface.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ class QgisAppInterface : public QgisInterface
279279
*/
280280

281281
//! Menus
282-
virtual QMenu *fileMenu();
282+
Q_DECL_DEPRECATED virtual QMenu *fileMenu();
283+
virtual QMenu *projectMenu();
283284
virtual QMenu *editMenu();
284285
virtual QMenu *viewMenu();
285286
virtual QMenu *layerMenu();
@@ -309,7 +310,7 @@ class QgisAppInterface : public QgisInterface
309310
virtual QToolBar *databaseToolBar();
310311
virtual QToolBar *webToolBar();
311312

312-
//! File menu actions
313+
//! Project menu actions
313314
virtual QAction *actionNewProject();
314315
virtual QAction *actionOpenProject();
315316
virtual QAction *actionSaveProject();

src/gui/qgisinterface.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,11 @@ class GUI_EXPORT QgisInterface : public QObject
370370
*/
371371

372372
//! Menus
373+
#ifndef Q_MOC_RUN
374+
Q_DECL_DEPRECATED
375+
#endif
373376
virtual QMenu *fileMenu() = 0;
377+
virtual QMenu *projectMenu() = 0;
374378
virtual QMenu *editMenu() = 0;
375379
virtual QMenu *viewMenu() = 0;
376380
virtual QMenu *layerMenu() = 0;
@@ -415,7 +419,7 @@ class GUI_EXPORT QgisInterface : public QObject
415419
*/
416420
virtual QToolBar *webToolBar() = 0;
417421

418-
//! File menu actions
422+
//! Project menu actions
419423
virtual QAction *actionNewProject() = 0;
420424
virtual QAction *actionOpenProject() = 0;
421425
virtual QAction *actionSaveProject() = 0;

src/ui/qgisapp.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<x>0</x>
1818
<y>0</y>
1919
<width>1050</width>
20-
<height>21</height>
20+
<height>18</height>
2121
</rect>
2222
</property>
2323
<widget class="QMenu" name="mEditMenu">
@@ -49,7 +49,7 @@
4949
<addaction name="mActionNodeTool"/>
5050
<addaction name="mActionRotatePointSymbols"/>
5151
</widget>
52-
<widget class="QMenu" name="mFileMenu">
52+
<widget class="QMenu" name="mProjectMenu">
5353
<property name="title">
5454
<string>P&amp;roject</string>
5555
</property>
@@ -241,7 +241,7 @@
241241
</widget>
242242
<addaction name="menuOpenStreetMap"/>
243243
</widget>
244-
<addaction name="mFileMenu"/>
244+
<addaction name="mProjectMenu"/>
245245
<addaction name="mEditMenu"/>
246246
<addaction name="mViewMenu"/>
247247
<addaction name="mLayerMenu"/>

0 commit comments

Comments
 (0)