Skip to content

Commit

Permalink
Add some layout related actions to app toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 17, 2017
1 parent 5601fc9 commit 2631589
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,9 @@ void QgisApp::createActions()
connect( mActionNewMapCanvas, &QAction::triggered, this, &QgisApp::newMapCanvas );
connect( mActionNew3DMapCanvas, &QAction::triggered, this, &QgisApp::new3DMapCanvas );
connect( mActionNewPrintComposer, &QAction::triggered, this, &QgisApp::newPrintComposer );
connect( mActionNewPrintLayout, &QAction::triggered, this, &QgisApp::newPrintLayout );
connect( mActionShowComposerManager, &QAction::triggered, this, &QgisApp::showComposerManager );
connect( mActionShowLayoutManager, &QAction::triggered, this, &QgisApp::showLayoutManager );
connect( mActionExit, &QAction::triggered, this, &QgisApp::fileExit );
connect( mActionDxfExport, &QAction::triggered, this, &QgisApp::dxfExport );
connect( mActionDwgImport, &QAction::triggered, this, &QgisApp::dwgImport );
Expand Down Expand Up @@ -5995,6 +5997,16 @@ void QgisApp::newPrintComposer()
createNewComposer( title );
}

void QgisApp::newPrintLayout()
{
QString title;
if ( !uniqueLayoutTitle( this, title, true ) )
{
return;
}
createNewLayout( title );
}

void QgisApp::showComposerManager()
{
if ( !mComposerManager )
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void newGeoPackageLayer();
//! Print the current map view frame
void newPrintComposer();
//! Create a new print layout
void newPrintLayout();

void showComposerManager();
//! Add all loaded layers into the overview - overrides qgisappbase method
void addAllToOverview();
Expand Down
56 changes: 56 additions & 0 deletions src/ui/qgisapp.ui
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@
<addaction name="mActionSaveProjectAs"/>
<addaction name="mActionNewPrintComposer"/>
<addaction name="mActionShowComposerManager"/>
<addaction name="mActionNewPrintLayout"/>
<addaction name="mActionShowLayoutManager"/>
</widget>
<widget class="QToolBar" name="mLayerToolBar">
<property name="windowTitle">
Expand Down Expand Up @@ -2934,9 +2936,63 @@ Acts on currently active editable layer</string>
<string>Ctrl+Shift+M</string>
</property>
</action>
<action name="mActionShowLayoutManager">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionComposerManager.svg</normaloff>:/images/themes/default/mActionComposerManager.svg</iconset>
</property>
<property name="text">
<string>Layout Manager…</string>
</property>
<property name="toolTip">
<string>Show Layout Manager</string>
</property>
</action>
<action name="mActionNewPrintLayout">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionNewComposer.svg</normaloff>:/images/themes/default/mActionNewComposer.svg</iconset>
</property>
<property name="text">
<string>New &amp;Print Layout</string>
</property>
<property name="toolTip">
<string>New Print Layout</string>
</property>
<property name="shortcut">
<string>Ctrl+P</string>
</property>
</action>
</widget>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit 2631589

Please sign in to comment.