Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add Panels and Toolbars submenus to View menu in Composer

  • Loading branch information...
commit c928868916192da22ef168ade3cfa525b872f5ce 1 parent 93ad1d0
Larry Shaffer authored August 30, 2012
14  src/app/composer/qgscomposer.cpp
@@ -179,6 +179,17 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
179 179
   viewMenu->addSeparator();
180 180
   viewMenu->addAction( mActionRefreshView );
181 181
 
  182
+  // Panel and toolbar submenus
  183
+  mPanelMenu = new QMenu( tr( "Panels" ), this );
  184
+  mPanelMenu->setObjectName( "mPanelMenu" );
  185
+  mToolbarMenu = new QMenu( tr( "Toolbars" ), this );
  186
+  mToolbarMenu->setObjectName( "mToolbarMenu" );
  187
+  viewMenu->addSeparator();
  188
+  viewMenu->addMenu( mPanelMenu );
  189
+  viewMenu->addMenu( mToolbarMenu );
  190
+  // toolBar already exists, add other widgets as they are created
  191
+  mToolbarMenu->addAction( toolBar->toggleViewAction() );
  192
+
182 193
   QMenu *layoutMenu = menuBar()->addMenu( tr( "Layout" ) );
183 194
   layoutMenu->addAction( mActionUndo );
184 195
   layoutMenu->addAction( mActionRedo );
@@ -244,10 +255,13 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
244 255
   setTabPosition( Qt::AllDockWidgetAreas, QTabWidget::North );
245 256
   mGeneralDock = new QDockWidget( tr( "Composition" ), this );
246 257
   mGeneralDock->setObjectName( "CompositionDock" );
  258
+  mPanelMenu->addAction( mGeneralDock->toggleViewAction() );
247 259
   mItemDock = new QDockWidget( tr( "Item Properties" ), this );
248 260
   mItemDock->setObjectName( "ItemDock" );
  261
+  mPanelMenu->addAction( mItemDock->toggleViewAction() );
249 262
   mUndoDock = new QDockWidget( tr( "Command history" ), this );
250 263
   mUndoDock->setObjectName( "CommandDock" );
  264
+  mPanelMenu->addAction( mUndoDock->toggleViewAction() );
251 265
 
252 266
   mGeneralDock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
253 267
   mItemDock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
3  src/app/composer/qgscomposer.h
@@ -338,6 +338,9 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
338 338
     QDockWidget* mItemDock;
339 339
     QDockWidget* mUndoDock;
340 340
     QDockWidget* mGeneralDock;
  341
+
  342
+    QMenu* mPanelMenu;
  343
+    QMenu* mToolbarMenu;
341 344
 };
342 345
 
343 346
 #endif

0 notes on commit c928868

Please sign in to comment.
Something went wrong with that request. Please try again.