Skip to content
Permalink
Browse files

Add Panels and Toolbars submenus to View menu in Composer

  • Loading branch information
dakcarto committed Aug 31, 2012
1 parent 93ad1d0 commit c928868916192da22ef168ade3cfa525b872f5ce
Showing with 17 additions and 0 deletions.
  1. +14 −0 src/app/composer/qgscomposer.cpp
  2. +3 −0 src/app/composer/qgscomposer.h
@@ -179,6 +179,17 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
viewMenu->addSeparator();
viewMenu->addAction( mActionRefreshView );

// Panel and toolbar submenus
mPanelMenu = new QMenu( tr( "Panels" ), this );
mPanelMenu->setObjectName( "mPanelMenu" );
mToolbarMenu = new QMenu( tr( "Toolbars" ), this );
mToolbarMenu->setObjectName( "mToolbarMenu" );
viewMenu->addSeparator();
viewMenu->addMenu( mPanelMenu );
viewMenu->addMenu( mToolbarMenu );
// toolBar already exists, add other widgets as they are created
mToolbarMenu->addAction( toolBar->toggleViewAction() );

QMenu *layoutMenu = menuBar()->addMenu( tr( "Layout" ) );
layoutMenu->addAction( mActionUndo );
layoutMenu->addAction( mActionRedo );
@@ -244,10 +255,13 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
setTabPosition( Qt::AllDockWidgetAreas, QTabWidget::North );
mGeneralDock = new QDockWidget( tr( "Composition" ), this );
mGeneralDock->setObjectName( "CompositionDock" );
mPanelMenu->addAction( mGeneralDock->toggleViewAction() );
mItemDock = new QDockWidget( tr( "Item Properties" ), this );
mItemDock->setObjectName( "ItemDock" );
mPanelMenu->addAction( mItemDock->toggleViewAction() );
mUndoDock = new QDockWidget( tr( "Command history" ), this );
mUndoDock->setObjectName( "CommandDock" );
mPanelMenu->addAction( mUndoDock->toggleViewAction() );

mGeneralDock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
mItemDock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
@@ -338,6 +338,9 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
QDockWidget* mItemDock;
QDockWidget* mUndoDock;
QDockWidget* mGeneralDock;

QMenu* mPanelMenu;
QMenu* mToolbarMenu;
};

#endif

0 comments on commit c928868

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