Skip to content

Commit 6321677

Browse files
author
wonder
committed
Moved creation of actions, menus and toolbars to UI file
git-svn-id: http://svn.osgeo.org/qgis/trunk@15383 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 02b72e6 commit 6321677

7 files changed

+1603
-1150
lines changed

src/app/qgisapp.cpp

+101-895
Large diffs are not rendered by default.

src/app/qgisapp.h

+8-186
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ class QgsGPSInformationWidget;
8080
#include "qgspoint.h"
8181
#include "qgssnappingdialog.h"
8282

83+
#include "ui_qgisapp.h"
84+
8385
/*! \class QgisApp
8486
* \brief Main window for the Qgis application
8587
*/
86-
class QgisApp : public QMainWindow
88+
class QgisApp : public QMainWindow, private Ui::MainWindow
8789
{
8890
Q_OBJECT
8991
public:
@@ -213,39 +215,28 @@ class QgisApp : public QMainWindow
213215
//! Actions to be inserted in menus and toolbars
214216
QAction *actionNewProject() { return mActionNewProject; }
215217
QAction *actionOpenProject() { return mActionOpenProject; }
216-
QAction *actionFileSeparator1() { return mActionFileSeparator1; }
217218
QAction *actionSaveProject() { return mActionSaveProject; }
218219
QAction *actionSaveProjectAs() { return mActionSaveProjectAs; }
219220
QAction *actionSaveMapAsImage() { return mActionSaveMapAsImage; }
220-
QAction *actionFileSeparator2() { return mActionFileSeparator2; }
221221
QAction *actionProjectProperties() { return mActionProjectProperties; }
222-
QAction *actionFileSeparator3() { return mActionFileSeparator3; }
223222
QAction *actionNewPrintComposer() { return mActionNewPrintComposer; }
224-
QAction *actionFileSeparator4() { return mActionFileSeparator4; }
225223
QAction *actionExit() { return mActionExit; }
226224

227225
QAction *actionCutFeatures() { return mActionCutFeatures; }
228226
QAction *actionCopyFeatures() { return mActionCopyFeatures; }
229227
QAction *actionPasteFeatures() { return mActionPasteFeatures; }
230-
QAction *actionEditSeparator1() { return mActionEditSeparator1; }
231228
QAction *actionCapturePoint() { return mActionCapturePoint; }
232229
QAction *actionCaptureLine() { return mActionCaptureLine; }
233230
QAction *actionCapturePolygon() { return mActionCapturePolygon; }
234231
QAction *actionDeleteSelected() { return mActionDeleteSelected; }
235232
QAction *actionMoveFeature() { return mActionMoveFeature; }
236233
QAction *actionSplitFeatures() { return mActionSplitFeatures; }
237-
#if 0 //These three tools are deprecated - use node tool rather...
238-
QAction *actionAddVertex() { return mActionAddVertex; }
239-
QAction *actionDeleteVertex() { return mActionDeleteVertex; }
240-
QAction *actionMoveVertex() { return mActionMoveVertex; }
241-
#endif
242234
QAction *actionAddRing() { return mActionAddRing; }
243235
QAction *actionAddIsland() { return mActionAddIsland; }
244236
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
245237
QAction *actionDeleteRing() { return mActionDeleteRing; }
246238
QAction *actionDeletePart() { return mActionDeletePart; }
247239
QAction *actionNodeTool() { return mActionNodeTool; }
248-
QAction *actionEditSeparator2() { return mActionEditSeparator2; }
249240
QAction *actionSnappingOptions() { return mActionSnappingOptions; }
250241

251242
QAction *actionPan() { return mActionPan; }
@@ -259,19 +250,16 @@ class QgisApp : public QMainWindow
259250
QAction *actionIdentify() { return mActionIdentify; }
260251
QAction *actionMeasure() { return mActionMeasure; }
261252
QAction *actionMeasureArea() { return mActionMeasureArea; }
262-
QAction *actionViewSeparator1() { return mActionViewSeparator1; }
263253
QAction *actionZoomFullExtent() { return mActionZoomFullExtent; }
264254
QAction *actionZoomToLayer() { return mActionZoomToLayer; }
265255
QAction *actionZoomToSelected() { return mActionZoomToSelected; }
266256
QAction *actionZoomLast() { return mActionZoomLast; }
267257
QAction *actionZoomNext() { return mActionZoomNext; }
268258
QAction *actionZoomActualSize() { return mActionZoomActualSize; }
269-
QAction *actionViewSeparator2() { return mActionViewSeparator2; }
270259
QAction *actionMapTips() { return mActionMapTips; }
271260
QAction *actionNewBookmark() { return mActionNewBookmark; }
272261
QAction *actionShowBookmarks() { return mActionShowBookmarks; }
273262
QAction *actionDraw() { return mActionDraw; }
274-
QAction *actionViewSeparator3() { return mActionViewSeparator3; }
275263

276264
QAction *actionNewVectorLayer() { return mActionNewVectorLayer; }
277265
QAction *actionNewSpatialLiteLayer() { return mActionNewSpatialiteLayer; }
@@ -280,7 +268,6 @@ class QgisApp : public QMainWindow
280268
QAction *actionAddPgLayer() { return mActionAddPgLayer; }
281269
QAction *actionAddSpatiaLiteLayer() { return mActionAddSpatiaLiteLayer; };
282270
QAction *actionAddWmsLayer() { return mActionAddWmsLayer; }
283-
QAction *actionLayerSeparator1() { return mActionLayerSeparator1; }
284271
QAction *actionOpenTable() { return mActionOpenTable; }
285272
QAction *actionToggleEditing() { return mActionToggleEditing; }
286273
QAction *actionSaveEdits() { return mActionSaveEdits; }
@@ -292,41 +279,32 @@ class QgisApp : public QMainWindow
292279
QAction *actionGpsTool() { return mActionGpsTool; }
293280
QAction *actionLayerProperties() { return mActionLayerProperties; }
294281
QAction *actionLayerSubsetString() { return mActionLayerSubsetString; }
295-
QAction *actionLayerSeparator2() { return mActionLayerSeparator2; }
296282
QAction *actionAddToOverview() { return mActionAddToOverview; }
297283
QAction *actionAddAllToOverview() { return mActionAddAllToOverview; }
298284
QAction *actionRemoveAllFromOverview() { return mActionRemoveAllFromOverview; }
299-
QAction *actionLayerSeparator3() { return mActionLayerSeparator3; }
300285
QAction *actionHideAllLayers() { return mActionHideAllLayers; }
301286
QAction *actionShowAllLayers() { return mActionShowAllLayers; }
302287

303288
QAction *actionManagePlugins() { return mActionManagePlugins; }
304-
QAction *actionPluginSeparator1() { return mActionPluginSeparator1; }
305289
QAction *actionPluginListSeparator() { return mActionPluginSeparator1; }
306-
QAction *actionPluginSeparator2() { return mActionPluginSeparator2; }
307290
QAction *actionPluginPythonSeparator() { return mActionPluginSeparator2; }
308291
QAction *actionShowPythonDialog() { return mActionShowPythonDialog; }
309292

310293
QAction *actionToggleFullScreen() { return mActionToggleFullScreen; }
311-
QAction *actionSettingsSeparator1() { return mActionSettingsSeparator1; }
312294
QAction *actionOptions() { return mActionOptions; }
313295
QAction *actionCustomProjection() { return mActionCustomProjection; }
314296
QAction *actionConfigureShortcuts() { return mActionConfigureShortcuts; }
315297

316298
#ifdef Q_WS_MAC
317299
QAction *actionWindowMinimize() { return mActionWindowMinimize; }
318300
QAction *actionWindowZoom() { return mActionWindowZoom; }
319-
QAction *actionWindowSeparator1() { return mActionWindowSeparator1; }
320301
QAction *actionWindowAllToFront() { return mActionWindowAllToFront; }
321-
QAction *actionWindowSeparator2() { return mActionWindowSeparator2; }
322302
#endif
323303

324304
QAction *actionHelpContents() { return mActionHelpContents; }
325305
QAction *actionHelpAPI() { return mActionHelpAPI; }
326-
QAction *actionHelpSeparator1() { return mActionHelpSeparator1; }
327306
QAction *actionQgisHomePage() { return mActionQgisHomePage; }
328307
QAction *actionCheckQgisVersion() { return mActionCheckQgisVersion; }
329-
QAction *actionHelpSeparator2() { return mActionHelpSeparator2; }
330308
QAction *actionAbout() { return mActionAbout; }
331309
QAction *actionSponsors() { return mActionSponsors; }
332310

@@ -878,138 +856,8 @@ class QgisApp : public QMainWindow
878856
bool createDB();
879857
void createMapTips();
880858

881-
// toolbars ---------------------------------------
882-
QToolBar *mFileToolBar;
883-
QToolBar *mLayerToolBar;
884-
QToolBar *mMapNavToolBar;
885-
QToolBar *mDigitizeToolBar;
886-
QToolBar *mAdvancedDigitizeToolBar;
887-
QToolBar *mAttributesToolBar;
888-
QToolBar *mPluginToolBar;
889-
QToolBar *mHelpToolBar;
890-
QToolBar *mRasterToolBar;
891-
QToolBar *mLabelToolBar;
892-
893859
// actions for menus and toolbars -----------------
894860

895-
QAction *mActionNewProject;
896-
QAction *mActionOpenProject;
897-
QAction *mActionFileSeparator1;
898-
QAction *mActionSaveProject;
899-
QAction *mActionSaveProjectAs;
900-
QAction *mActionSaveMapAsImage;
901-
QAction *mActionFileSeparator2;
902-
QAction *mActionProjectProperties;
903-
QAction *mActionFileSeparator3;
904-
QAction *mActionNewPrintComposer;
905-
QAction *mActionShowComposerManager;
906-
QAction *mActionFileSeparator4;
907-
QAction *mActionExit;
908-
909-
QAction *mActionUndo;
910-
QAction *mActionRedo;
911-
QAction *mActionEditSeparator0;
912-
QAction *mActionCutFeatures;
913-
QAction *mActionCopyFeatures;
914-
QAction *mActionPasteFeatures;
915-
QAction *mActionEditSeparator1;
916-
QAction *mActionCapturePoint;
917-
QAction *mActionCaptureLine;
918-
QAction *mActionCapturePolygon;
919-
QAction *mActionDeleteSelected;
920-
QAction *mActionMoveFeature;
921-
QAction *mActionReshapeFeatures;
922-
QAction *mActionSplitFeatures;
923-
#if 0 // deprecated
924-
QAction *mActionAddVertex;
925-
QAction *mActionDeleteVertex;
926-
QAction *mActionMoveVertex;
927-
#endif
928-
QAction *mActionAddRing;
929-
QAction *mActionAddIsland;
930-
QAction *mActionEditSeparator2;
931-
QAction *mActionSimplifyFeature;
932-
QAction *mActionDeleteRing;
933-
QAction *mActionDeletePart;
934-
QAction *mActionMergeFeatures;
935-
QAction *mActionMergeFeatureAttributes;
936-
QAction *mActionNodeTool;
937-
QAction *mActionRotatePointSymbols;
938-
QAction *mActionEditSeparator3;
939-
QAction *mActionSnappingOptions;
940-
941-
QAction *mActionPan;
942-
QAction *mActionZoomIn;
943-
QAction *mActionZoomOut;
944-
QAction *mActionViewSeparator1;
945-
QAction *mActionSelect;
946-
QAction *mActionSelectRectangle;
947-
QAction *mActionSelectPolygon;
948-
QAction *mActionSelectFreehand;
949-
QAction *mActionSelectRadius;
950-
QAction *mActionDeselectAll;
951-
QAction *mActionViewSeparator2;
952-
QAction *mActionIdentify;
953-
QAction *mActionMeasure;
954-
QAction *mActionMeasureAngle;
955-
QAction *mActionMeasureArea;
956-
QAction *mActionViewSeparator3;
957-
QAction *mActionZoomFullExtent;
958-
QAction *mActionZoomToLayer;
959-
QAction *mActionZoomToSelected;
960-
QAction *mActionZoomLast;
961-
QAction *mActionZoomNext;
962-
QAction *mActionZoomActualSize;
963-
QAction *mActionViewSeparator4;
964-
QAction *mActionMapTips;
965-
QAction *mActionNewBookmark;
966-
QAction *mActionShowBookmarks;
967-
QAction *mActionDraw;
968-
QAction *mActionViewSeparator5;
969-
QAction *mActionTextAnnotation;
970-
QAction *mActionFormAnnotation;
971-
QAction *mActionAnnotation;
972-
QAction *mActionLabeling;
973-
974-
QAction *mActionNewVectorLayer;
975-
QAction *mActionNewSpatialiteLayer;
976-
QAction *mActionShowRasterCalculator;
977-
QAction *mActionAddOgrLayer;
978-
QAction *mActionAddRasterLayer;
979-
QAction *mActionAddPgLayer;
980-
QAction *mActionAddSpatiaLiteLayer;
981-
QAction *mActionAddWmsLayer;
982-
QAction *mActionLayerSeparator1;
983-
QAction *mActionOpenTable;
984-
QAction *mActionToggleEditing;
985-
QAction *mActionSaveEdits;
986-
QAction *mActionLayerSaveAs;
987-
QAction *mActionLayerSelectionSaveAs;
988-
QAction *mActionRemoveLayer;
989-
QAction *mActionSetLayerCRS;
990-
QAction *mActionTileScale;
991-
QAction *mActionGpsTool;
992-
QAction *mActionLayerProperties;
993-
QAction *mActionLayerSubsetString;
994-
QAction *mActionLayerSeparator2;
995-
QAction *mActionAddToOverview;
996-
QAction *mActionAddAllToOverview;
997-
QAction *mActionRemoveAllFromOverview;
998-
QAction *mActionLayerSeparator3;
999-
QAction *mActionHideAllLayers;
1000-
QAction *mActionShowAllLayers;
1001-
1002-
QAction *mActionManagePlugins;
1003-
QAction *mActionPluginSeparator1;
1004-
QAction *mActionPluginSeparator2;
1005-
QAction *mActionShowPythonDialog;
1006-
1007-
QAction *mActionToggleFullScreen;
1008-
QAction *mActionSettingsSeparator1;
1009-
QAction *mActionOptions;
1010-
QAction *mActionCustomProjection;
1011-
QAction *mActionConfigureShortcuts;
1012-
1013861
#ifdef Q_WS_MAC
1014862
QAction *mActionWindowMinimize;
1015863
QAction *mActionWindowZoom;
@@ -1019,41 +867,19 @@ class QgisApp : public QMainWindow
1019867
QActionGroup *mWindowActions;
1020868
#endif
1021869

1022-
QAction *mActionHelpContents;
1023-
QAction *mActionHelpAPI;
1024-
QAction *mActionHelpSeparator1;
1025-
QAction *mActionQgisHomePage;
1026-
QAction *mActionCheckQgisVersion;
1027-
QAction *mActionHelpSeparator2;
1028-
QAction *mActionAbout;
1029-
QAction *mActionSponsors;
1030-
1031-
QAction *mActionLocalHistogramStretch;
1032-
1033-
QAction *mActionMoveLabel;
1034-
QAction *mActionRotateLabel;
1035-
QAction *mActionChangeLabelProperties;
1036-
1037-
QAction *mActionUseRendererV2;
1038-
QAction *mActionStyleManagerV2;
870+
QAction* mActionPluginSeparator1;
871+
QAction* mActionPluginSeparator2;
1039872

1040873
// action groups ----------------------------------
1041874
QActionGroup *mMapToolGroup;
1042875

1043876
// menus ------------------------------------------
1044-
QMenu *mFileMenu;
1045-
QMenu *mEditMenu;
1046-
QMenu *mRecentProjectsMenu;
1047-
QMenu *mViewMenu;
1048-
QMenu *mPanelMenu;
1049-
QMenu *mToolbarMenu;
1050-
QMenu *mLayerMenu;
1051-
QMenu *mSettingsMenu;
877+
1052878
#ifdef Q_WS_MAC
1053879
QMenu *mWindowMenu;
1054880
#endif
1055-
QMenu *mPrintComposersMenu;
1056-
QMenu *mHelpMenu;
881+
QMenu *mPanelMenu;
882+
QMenu *mToolbarMenu;
1057883

1058884
// docks ------------------------------------------
1059885
QDockWidget *mLegendDock;
@@ -1132,12 +958,8 @@ class QgisApp : public QMainWindow
1132958
QToolButton * mOnTheFlyProjectionStatusButton;
1133959
//! Popup menu
1134960
QMenu * mPopupMenu;
1135-
//! Top level plugin menu
1136-
QMenu *mPluginMenu;
1137961
//! Top level database menu
1138962
QMenu *mDatabaseMenu;
1139-
//! Top level raster menu
1140-
QMenu *mRasterMenu;
1141963
//! Popup menu for the map overview tools
1142964
QMenu *toolPopupOverviews;
1143965
//! Popup menu for the display tools

0 commit comments

Comments
 (0)