Skip to content
Permalink
Browse files

More composer->layout action swapping

Compositions are now only accessible via the composer manager
in the projects menu. This will be removed when the converter
work is merged.
  • Loading branch information
nyalldawson committed Jan 7, 2018
1 parent 3edab4f commit 56f1c2018caaea68e0648838f5892f7b59b21797
Showing with 31 additions and 10 deletions.
  1. +1 −8 src/app/composer/qgscomposermanager.cpp
  2. +11 −0 src/app/qgisapp.cpp
  3. +3 −0 src/app/qgisapp.h
  4. +16 −2 src/ui/qgisapp.ui
@@ -218,14 +218,7 @@ Qt::ItemFlags QgsComposerManagerModel::flags( const QModelIndex &index ) const
{
Qt::ItemFlags flags = QAbstractListModel::flags( index );

if ( index.isValid() )
{
return flags | Qt::ItemIsEditable;
}
else
{
return flags;
}
return flags;
}

QgsComposition *QgsComposerManagerModel::compositionFromIndex( const QModelIndex &index ) const
@@ -1857,6 +1857,7 @@ void QgisApp::createActions()
connect( mActionNewMapCanvas, &QAction::triggered, this, &QgisApp::newMapCanvas );
connect( mActionNew3DMapCanvas, &QAction::triggered, this, &QgisApp::new3DMapCanvas );
connect( mActionNewPrintLayout, &QAction::triggered, this, &QgisApp::newPrintLayout );
connect( mActionNewReport, &QAction::triggered, this, &QgisApp::newReport );
connect( mActionShowComposerManager, &QAction::triggered, this, &QgisApp::showComposerManager );
connect( mActionShowLayoutManager, &QAction::triggered, this, &QgisApp::showLayoutManager );
connect( mActionExit, &QAction::triggered, this, &QgisApp::fileExit );
@@ -5982,6 +5983,16 @@ void QgisApp::newPrintLayout()
createNewPrintLayout( title );
}

void QgisApp::newReport()
{
QString title;
if ( !uniqueLayoutTitle( this, title, true, QgsMasterLayoutInterface::Report ) )
{
return;
}
createNewReport( title );
}

void QgisApp::showComposerManager()
{
if ( !mComposerManager )
@@ -1257,6 +1257,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! Create a new print layout
void newPrintLayout();

//! Create a new report
void newReport();

//! Slot to handle display of layouts menu, e.g. sorting
void layoutsMenuAboutToShow();

@@ -58,8 +58,11 @@
<addaction name="separator"/>
<addaction name="mActionProjectProperties"/>
<addaction name="separator"/>
<addaction name="mActionShowComposerManager"/>
<addaction name="mActionNewPrintLayout"/>
<addaction name="mActionNewReport"/>
<addaction name="mActionShowLayoutManager"/>
<addaction name="mLayoutsMenu"/>
<addaction name="mActionShowComposerManager"/>
<addaction name="separator"/>
<addaction name="mActionExit"/>
</widget>
@@ -367,7 +370,6 @@
<addaction name="mActionOpenProject"/>
<addaction name="mActionSaveProject"/>
<addaction name="mActionSaveProjectAs"/>
<addaction name="mActionShowComposerManager"/>
<addaction name="mActionNewPrintLayout"/>
<addaction name="mActionShowLayoutManager"/>
</widget>
@@ -2949,6 +2951,18 @@ Acts on currently active editable layer</string>
<string>Ctrl+P</string>
</property>
</action>
<action name="mActionNewReport">
<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;Report</string>
</property>
<property name="toolTip">
<string>New Report</string>
</property>
</action>
</widget>
<resources>
<include location="../../images/images.qrc"/>

0 comments on commit 56f1c20

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