Skip to content
Permalink
Browse files
Updates to composer window
- Split composer toolbar into many
- Rename File menu to Composer - because the composer isn't a "file"
  • Loading branch information
NathanW2 committed Feb 20, 2013
1 parent cc0c2b1 commit 69f96f37bcd25e44361e8c946022ab50f3c17a3c
Showing with 71 additions and 37 deletions.
  1. +24 −21 src/app/composer/qgscomposer.cpp
  2. +47 −16 src/ui/qgscomposerbase.ui
@@ -98,8 +98,8 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
QToolButton* saveProjectToolButton = new QToolButton( this );
saveProjectToolButton->addAction( mSaveProjectAction );
saveProjectToolButton->setDefaultAction( mSaveProjectAction );
toolBar->insertWidget( mActionLoadFromTemplate, saveProjectToolButton );
toolBar->insertSeparator( mActionLoadFromTemplate );
mComposerToolbar->insertWidget( mActionLoadFromTemplate, saveProjectToolButton );
mComposerToolbar->insertSeparator( mActionLoadFromTemplate );

QToolButton* orderingToolButton = new QToolButton( this );
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
@@ -110,7 +110,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
orderingToolButton->addAction( mActionMoveItemsToTop );
orderingToolButton->addAction( mActionMoveItemsToBottom );
orderingToolButton->setDefaultAction( mActionRaiseItems );
toolBar->addWidget( orderingToolButton );
mItemActionToolbar->addWidget( orderingToolButton );

QToolButton* alignToolButton = new QToolButton( this );
alignToolButton->setPopupMode( QToolButton::InstantPopup );
@@ -124,9 +124,9 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
alignToolButton->addAction( mActionAlignVCenter );
alignToolButton->addAction( mActionAlignBottom );
alignToolButton->setDefaultAction( mActionAlignLeft );
toolBar->addWidget( alignToolButton );
mItemActionToolbar->addWidget( alignToolButton );

QToolButton* shapeToolButton = new QToolButton( toolBar );
QToolButton* shapeToolButton = new QToolButton( mItemToolbar );
shapeToolButton->setCheckable( true );
shapeToolButton->setPopupMode( QToolButton::InstantPopup );
shapeToolButton->setAutoRaise( true );
@@ -135,7 +135,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
shapeToolButton->addAction( mActionAddTriangle );
shapeToolButton->addAction( mActionAddEllipse );
shapeToolButton->setDefaultAction( mActionAddEllipse );
toolBar->insertWidget( mActionAddArrow, shapeToolButton );
mItemToolbar->insertWidget( mActionAddArrow, shapeToolButton );

QActionGroup* toggleActionGroup = new QActionGroup( this );
toggleActionGroup->addAction( mActionMoveItemContent );
@@ -169,20 +169,20 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
appMenu->addAction( QgisApp::instance()->actionOptions() );
#endif

QMenu *fileMenu = menuBar()->addMenu( tr( "File" ) );
fileMenu->addAction( mSaveProjectAction );
fileMenu->addSeparator();
fileMenu->addAction( mActionLoadFromTemplate );
fileMenu->addAction( mActionSaveAsTemplate );
fileMenu->addSeparator();
fileMenu->addAction( mActionExportAsImage );
fileMenu->addAction( mActionExportAsPDF );
fileMenu->addAction( mActionExportAsSVG );
fileMenu->addSeparator();
fileMenu->addAction( mActionPageSetup );
fileMenu->addAction( mActionPrint );
fileMenu->addSeparator();
fileMenu->addAction( mActionQuit );
QMenu *composerMenu = menuBar()->addMenu( tr( "Composer" ) );
composerMenu->addAction( mSaveProjectAction );
composerMenu->addSeparator();
composerMenu->addAction( mActionLoadFromTemplate );
composerMenu->addAction( mActionSaveAsTemplate );
composerMenu->addSeparator();
composerMenu->addAction( mActionExportAsImage );
composerMenu->addAction( mActionExportAsPDF );
composerMenu->addAction( mActionExportAsSVG );
composerMenu->addSeparator();
composerMenu->addAction( mActionPageSetup );
composerMenu->addAction( mActionPrint );
composerMenu->addSeparator();
composerMenu->addAction( mActionQuit );
QObject::connect( mActionQuit, SIGNAL( triggered() ), this, SLOT( close() ) );

QMenu *viewMenu = menuBar()->addMenu( tr( "View" ) );
@@ -201,7 +201,10 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
viewMenu->addMenu( mPanelMenu );
viewMenu->addMenu( mToolbarMenu );
// toolBar already exists, add other widgets as they are created
mToolbarMenu->addAction( toolBar->toggleViewAction() );
mToolbarMenu->addAction( mComposerToolbar->toggleViewAction() );
mToolbarMenu->addAction( mPaperNavToolbar->toggleViewAction() );
mToolbarMenu->addAction( mItemActionToolbar->toggleViewAction() );
mToolbarMenu->addAction( mItemToolbar->toggleViewAction() );

QMenu *layoutMenu = menuBar()->addMenu( tr( "Layout" ) );
layoutMenu->addAction( mActionUndo );
@@ -46,12 +46,9 @@
</item>
</layout>
</widget>
<widget class="QToolBar" name="toolBar">
<widget class="QToolBar" name="mComposerToolbar">
<property name="windowTitle">
<string>Toolbar</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<string>Composer</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
@@ -61,18 +58,54 @@
</attribute>
<addaction name="mActionLoadFromTemplate"/>
<addaction name="mActionSaveAsTemplate"/>
<addaction name="separator"/>
<addaction name="mActionPrint"/>
<addaction name="mActionExportAsImage"/>
<addaction name="mActionExportAsPDF"/>
<addaction name="mActionExportAsSVG"/>
<addaction name="mActionPrint"/>
<addaction name="separator"/>
<addaction name="mActionExportAsPDF"/>
<addaction name="mActionUndo"/>
<addaction name="mActionRedo"/>
</widget>
<widget class="QToolBar" name="mPaperNavToolbar">
<property name="windowTitle">
<string>Paper Navigation</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>true</bool>
</attribute>
<addaction name="mActionZoomAll"/>
<addaction name="mActionZoomIn"/>
<addaction name="mActionZoomOut"/>
<addaction name="mActionRefreshView"/>
<addaction name="separator"/>
<addaction name="mActionUndo"/>
<addaction name="mActionRedo"/>
</widget>
<widget class="QToolBar" name="mItemActionToolbar">
<property name="windowTitle">
<string>Composer Item Actions</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>true</bool>
</attribute>
<addaction name="mActionSelectMoveItem"/>
<addaction name="mActionMoveItemContent"/>
<addaction name="mActionGroupItems"/>
<addaction name="mActionUngroupItems"/>
</widget>
<widget class="QToolBar" name="mItemToolbar">
<property name="windowTitle">
<string>Composer Items</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>true</bool>
</attribute>
<addaction name="mActionAddNewMap"/>
<addaction name="mActionAddImage"/>
<addaction name="mActionAddNewLabel"/>
@@ -81,13 +114,11 @@
<addaction name="mActionAddArrow"/>
<addaction name="mActionAddTable"/>
<addaction name="mActionAddHtml"/>
<addaction name="separator"/>
<addaction name="mActionSelectMoveItem"/>
<addaction name="mActionMoveItemContent"/>
<addaction name="mActionGroupItems"/>
<addaction name="mActionUngroupItems"/>
</widget>
<action name="mActionPrint">
<property name="checkable">
<bool>false</bool>
</property>
<property name="icon">
<iconset>
<normaloff>../themes/default/mActionFilePrint.png</normaloff>../themes/default/mActionFilePrint.png</iconset>

0 comments on commit 69f96f3

Please sign in to comment.