Skip to content

Commit f287d40

Browse files
committedJan 7, 2018
Remove all interface methods and UI for creating new composers
1 parent aef9df8 commit f287d40

15 files changed

+90
-924
lines changed
 

‎python/gui/qgisinterface.sip

Lines changed: 10 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ Return a pointer to the main window (instance of QgisApp in case of QGIS)
138138
virtual QgsMessageBar *messageBar() = 0;
139139
%Docstring
140140
Return the message bar of the main app
141-
%End
142-
143-
virtual QList<QgsComposerInterface *> openComposers() = 0;
144-
%Docstring
145-
Returns all currently open composer windows.
146-
147-
.. versionadded:: 3.0
148141
%End
149142

150143
virtual QList<QgsLayoutDesignerInterface *> openLayoutDesigners() = 0;
@@ -212,8 +205,16 @@ Advanced digitizing dock widget
212205
virtual QAction *actionSaveProjectAs() = 0;
213206
virtual QAction *actionSaveMapAsImage() = 0;
214207
virtual QAction *actionProjectProperties() = 0;
215-
virtual QAction *actionPrintComposer() = 0;
216-
virtual QAction *actionShowComposerManager() = 0;
208+
209+
virtual QAction *actionCreatePrintLayout() = 0;
210+
%Docstring
211+
Create new print layout action
212+
%End
213+
214+
virtual QAction *actionShowLayoutManager() = 0;
215+
%Docstring
216+
Show layout manager action
217+
%End
217218
virtual QAction *actionExit() = 0;
218219

219220
virtual QAction *actionCutFeatures() = 0;
@@ -606,27 +607,6 @@ Open the message log dock widget *
606607
virtual void addUserInputWidget( QWidget *widget ) = 0;
607608
%Docstring
608609
Adds a widget to the user input tool bar.
609-
%End
610-
611-
virtual QgsComposerInterface *openComposer( QgsComposition *composition ) = 0;
612-
%Docstring
613-
Opens a new composer window for the specified ``composition``, or
614-
brings an already open composer window to the foreground if one
615-
is already created for the composition.
616-
617-
.. versionadded:: 3.0
618-
619-
.. seealso:: :py:func:`closeComposer()`
620-
%End
621-
622-
virtual void closeComposer( QgsComposition *composition ) = 0;
623-
%Docstring
624-
Closes an open composer window showing the specified ``composition``.
625-
The composition remains unaffected.
626-
627-
.. versionadded:: 3.0
628-
629-
.. seealso:: :py:func:`openComposer()`
630610
%End
631611

632612
virtual void showLayoutManager() = 0;
@@ -643,8 +623,6 @@ brings an already open designer window to the foreground if one
643623
is already created for the layout.
644624

645625
.. versionadded:: 3.0
646-
647-
.. seealso:: :py:func:`closeComposer()`
648626
%End
649627

650628
virtual void showOptionsDialog( QWidget *parent = 0, const QString &currentPage = QString() ) = 0;
@@ -960,38 +938,6 @@ Signal emitted when the current ``theme`` is changed so plugins
960938
can change their tool button icons.
961939

962940
.. versionadded:: 3.0
963-
%End
964-
965-
void composerOpened( QgsComposerInterface *composer );
966-
%Docstring
967-
This signal is emitted when a new composer window has been opened.
968-
969-
.. versionadded:: 3.0
970-
971-
.. seealso:: :py:func:`composerWillBeClosed()`
972-
%End
973-
974-
void composerWillBeClosed( QgsComposerInterface *composer );
975-
%Docstring
976-
This signal is emitted before a composer window is going to be closed
977-
and deleted.
978-
979-
.. versionadded:: 3.0
980-
981-
.. seealso:: :py:func:`composerClosed()`
982-
983-
.. seealso:: :py:func:`composerOpened()`
984-
%End
985-
986-
void composerClosed( QgsComposerInterface *composer );
987-
%Docstring
988-
This signal is emitted after a composer window is closed.
989-
990-
.. versionadded:: 3.0
991-
992-
.. seealso:: :py:func:`composerWillBeClosed()`
993-
994-
.. seealso:: :py:func:`composerOpened()`
995941
%End
996942

997943
void layoutDesignerOpened( QgsLayoutDesignerInterface *designer );

‎src/app/composer/qgscomposer.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ QgsComposer::QgsComposer( QgsComposition *composition )
133133
connect( mActionAddAttributeTable, &QAction::triggered, this, &QgsComposer::mActionAddAttributeTable_triggered );
134134
connect( mActionAddHtml, &QAction::triggered, this, &QgsComposer::mActionAddHtml_triggered );
135135
connect( mActionSaveProject, &QAction::triggered, this, &QgsComposer::mActionSaveProject_triggered );
136-
connect( mActionNewComposer, &QAction::triggered, this, &QgsComposer::mActionNewComposer_triggered );
137-
connect( mActionDuplicateComposer, &QAction::triggered, this, &QgsComposer::mActionDuplicateComposer_triggered );
138136
connect( mActionComposerManager, &QAction::triggered, this, &QgsComposer::mActionComposerManager_triggered );
139137
connect( mActionSaveAsTemplate, &QAction::triggered, this, &QgsComposer::mActionSaveAsTemplate_triggered );
140138
connect( mActionLoadFromTemplate, &QAction::triggered, this, &QgsComposer::mActionLoadFromTemplate_triggered );
@@ -302,8 +300,6 @@ QgsComposer::QgsComposer( QgsComposition *composition )
302300
QMenu *composerMenu = menuBar()->addMenu( tr( "&Composer" ) );
303301
composerMenu->addAction( mActionSaveProject );
304302
composerMenu->addSeparator();
305-
composerMenu->addAction( mActionNewComposer );
306-
composerMenu->addAction( mActionDuplicateComposer );
307303
composerMenu->addAction( mActionComposerManager );
308304

309305
mPrintComposersMenu = new QMenu( tr( "Print &Composers" ), this );
@@ -760,8 +756,6 @@ void QgsComposer::setupTheme()
760756
//missing from active theme
761757
mActionQuit->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionFileExit.png" ) ) );
762758
mActionSaveProject->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionFileSave.svg" ) ) );
763-
mActionNewComposer->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewComposer.svg" ) ) );
764-
mActionDuplicateComposer->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDuplicateComposer.svg" ) ) );
765759
mActionComposerManager->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionComposerManager.svg" ) ) );
766760
mActionLoadFromTemplate->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionFileOpen.svg" ) ) );
767761
mActionSaveAsTemplate->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionFileSaveAs.svg" ) ) );
@@ -3016,42 +3010,6 @@ void QgsComposer::mActionSaveProject_triggered()
30163010
mQgis->actionSaveProject()->trigger();
30173011
}
30183012

3019-
void QgsComposer::mActionNewComposer_triggered()
3020-
{
3021-
QString title;
3022-
if ( !mQgis->uniqueComposerTitle( this, title, true ) )
3023-
{
3024-
return;
3025-
}
3026-
mQgis->createNewComposer( title );
3027-
}
3028-
3029-
void QgsComposer::mActionDuplicateComposer_triggered()
3030-
{
3031-
QString newTitle;
3032-
if ( !mQgis->uniqueComposerTitle( this, newTitle, false, mComposition->name() + tr( " copy" ) ) )
3033-
{
3034-
return;
3035-
}
3036-
3037-
// provide feedback, since loading of template into duplicate composer will be hidden
3038-
QDialog *dlg = new QgsBusyIndicatorDialog( tr( "Duplicating composer..." ) );
3039-
dlg->setStyleSheet( mQgis->styleSheet() );
3040-
dlg->show();
3041-
3042-
QgsComposer *newComposer = mQgis->duplicateComposer( this, newTitle );
3043-
3044-
dlg->close();
3045-
delete dlg;
3046-
dlg = nullptr;
3047-
3048-
if ( !newComposer )
3049-
{
3050-
QMessageBox::warning( this, tr( "Duplicate Composer" ),
3051-
tr( "Composer duplication failed." ) );
3052-
}
3053-
}
3054-
30553013
void QgsComposer::mActionComposerManager_triggered()
30563014
{
30573015
// NOTE: Avoid crash where composer that spawned modal manager from toolbar ends up

‎src/app/composer/qgscomposer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,6 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
230230
//! Save parent project
231231
void mActionSaveProject_triggered();
232232

233-
//! Create new composer
234-
void mActionNewComposer_triggered();
235-
236-
//! Duplicate current composer
237-
void mActionDuplicateComposer_triggered();
238-
239233
//! Show composer manager
240234

241235
void mActionComposerManager_triggered();

0 commit comments

Comments
 (0)
Please sign in to comment.