Skip to content
Permalink
Browse files

Make report/atlas settings actions checkable, so they can also hide t…

…he panels
  • Loading branch information
nyalldawson committed Jan 5, 2018
1 parent a4f854e commit 4e6a072e4908154d6a1b6b8ed1be99fb880a6da2
@@ -659,9 +659,11 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla

mAtlasDock = new QgsDockWidget( tr( "Atlas" ), this );
mAtlasDock->setObjectName( QStringLiteral( "AtlasDock" ) );
connect( mAtlasDock, &QDockWidget::visibilityChanged, mActionAtlasSettings, &QAction::setChecked );

mReportDock = new QgsDockWidget( tr( "Report" ), this );
mReportDock->setObjectName( QStringLiteral( "ReportDock" ) );
connect( mReportDock, &QDockWidget::visibilityChanged, mActionReportSettings, &QAction::setChecked );

const QList<QDockWidget *> docks = findChildren<QDockWidget *>();
for ( QDockWidget *dock : docks )
@@ -1992,12 +1994,12 @@ void QgsLayoutDesignerDialog::exportToSvg()
QApplication::restoreOverrideCursor();
}

void QgsLayoutDesignerDialog::showAtlasSettings()
void QgsLayoutDesignerDialog::showAtlasSettings( bool checked )
{
if ( !mAtlasDock )
return;

mAtlasDock->setUserVisible( true );
mAtlasDock->setUserVisible( checked );
}

void QgsLayoutDesignerDialog::atlasPreviewTriggered( bool checked )
@@ -3274,12 +3276,12 @@ void QgsLayoutDesignerDialog::printReport()
QApplication::restoreOverrideCursor();
}

void QgsLayoutDesignerDialog::showReportSettings()
void QgsLayoutDesignerDialog::showReportSettings( bool checked )
{
if ( !mReportDock )
return;

mReportDock->setUserVisible( true );
mReportDock->setUserVisible( checked );
}

void QgsLayoutDesignerDialog::pageSetup()
@@ -309,7 +309,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
void exportToRaster();
void exportToPdf();
void exportToSvg();
void showAtlasSettings();
void showAtlasSettings( bool checked );
void atlasPreviewTriggered( bool checked );
void atlasPageComboEditingFinished();
void atlasNext();
@@ -325,7 +325,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
void exportReportToSvg();
void exportReportToPdf();
void printReport();
void showReportSettings();
void showReportSettings( bool checked );

void pageSetup();

@@ -99,7 +99,7 @@
<x>0</x>
<y>0</y>
<width>2180</width>
<height>42</height>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="mLayoutMenu">
@@ -1369,6 +1369,9 @@
</property>
</action>
<action name="mActionAtlasSettings">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../../images/images.qrc">
<normaloff>:/images/themes/default/mActionAtlasSettings.svg</normaloff>:/images/themes/default/mActionAtlasSettings.svg</iconset>
@@ -1429,6 +1432,9 @@
</property>
</action>
<action name="mActionReportSettings">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../../images/images.qrc">
<normaloff>:/images/themes/default/mActionAtlasSettings.svg</normaloff>:/images/themes/default/mActionAtlasSettings.svg</iconset>
@@ -1510,6 +1516,7 @@
<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 4e6a072

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