Skip to content

Commit

Permalink
More composer->layout action swapping
Browse files Browse the repository at this point in the history
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 56f1c20
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/app/composer/qgscomposermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
18 changes: 16 additions & 2 deletions src/ui/qgisapp.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -367,7 +370,6 @@
<addaction name="mActionOpenProject"/>
<addaction name="mActionSaveProject"/>
<addaction name="mActionSaveProjectAs"/>
<addaction name="mActionShowComposerManager"/>
<addaction name="mActionNewPrintLayout"/>
<addaction name="mActionShowLayoutManager"/>
</widget>
Expand Down Expand Up @@ -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"/>
Expand Down

0 comments on commit 56f1c20

Please sign in to comment.