mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-10 00:05:25 -04:00
[needs-docs] Add "delete layout" action to layout designer menu
Fixes #10436
This commit is contained in:
parent
88682b2c7d
commit
b6dab6ff48
@ -23,6 +23,7 @@
|
||||
#include "qgslayout.h"
|
||||
#include "qgslayoutappmenuprovider.h"
|
||||
#include "qgslayoutcustomdrophandler.h"
|
||||
#include "qgslayoutmanager.h"
|
||||
#include "qgslayoutview.h"
|
||||
#include "qgslayoutviewtooladditem.h"
|
||||
#include "qgslayoutviewtooladdnodeitem.h"
|
||||
@ -160,6 +161,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
||||
connect( mActionSaveProject, &QAction::triggered, this, &QgsLayoutDesignerDialog::saveProject );
|
||||
connect( mActionNewLayout, &QAction::triggered, this, &QgsLayoutDesignerDialog::newLayout );
|
||||
connect( mActionLayoutManager, &QAction::triggered, this, &QgsLayoutDesignerDialog::showManager );
|
||||
connect( mActionRemoveLayout, &QAction::triggered, this, &QgsLayoutDesignerDialog::deleteLayout );
|
||||
|
||||
connect( mActionShowGrid, &QAction::triggered, this, &QgsLayoutDesignerDialog::showGrid );
|
||||
connect( mActionSnapGrid, &QAction::triggered, this, &QgsLayoutDesignerDialog::snapToGrid );
|
||||
@ -1392,6 +1394,16 @@ void QgsLayoutDesignerDialog::renameLayout()
|
||||
currentLayout()->setName( newTitle );
|
||||
}
|
||||
|
||||
void QgsLayoutDesignerDialog::deleteLayout()
|
||||
{
|
||||
if ( QMessageBox::question( this, tr( "Delete Layout" ), tr( "Are you sure you want to delete the layout “%1”?" ).arg( currentLayout()->name() ),
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
|
||||
return;
|
||||
|
||||
currentLayout()->project()->layoutManager()->removeLayout( currentLayout() );
|
||||
close();
|
||||
}
|
||||
|
||||
void QgsLayoutDesignerDialog::paste()
|
||||
{
|
||||
QPointF pt = mView->mapFromGlobal( QCursor::pos() );
|
||||
|
@ -273,6 +273,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
|
||||
void newLayout();
|
||||
void showManager();
|
||||
void renameLayout();
|
||||
void deleteLayout();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -103,6 +103,7 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="mActionNewLayout"/>
|
||||
<addaction name="mActionDuplicateLayout"/>
|
||||
<addaction name="mActionRemoveLayout"/>
|
||||
<addaction name="mActionLayoutManager"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="mActionLayoutProperties"/>
|
||||
@ -1160,6 +1161,18 @@
|
||||
<string>Rename layout</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionRemoveLayout">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionDeleteSelected.svg</normaloff>:/images/themes/default/mActionDeleteSelected.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete Layout…</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Delete layout</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../images/images.qrc"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user