Skip to content
Permalink
Browse files

Use simpler dock action API

  • Loading branch information
nyalldawson committed Oct 16, 2018
1 parent b7b638c commit f8863aa11558c7e3c9bb0a6c2492444d1bd73afa
@@ -241,8 +241,6 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
connect( mActionShowPage, &QAction::triggered, this, &QgsLayoutDesignerDialog::showPages );

connect( mActionPasteInPlace, &QAction::triggered, this, &QgsLayoutDesignerDialog::pasteInPlace );

connect( mActionAtlasSettings, &QAction::triggered, this, &QgsLayoutDesignerDialog::showAtlasSettings );
connect( mActionAtlasPreview, &QAction::triggered, this, &QgsLayoutDesignerDialog::atlasPreviewTriggered );
connect( mActionAtlasNext, &QAction::triggered, this, &QgsLayoutDesignerDialog::atlasNext );
connect( mActionAtlasPrev, &QAction::triggered, this, &QgsLayoutDesignerDialog::atlasPrevious );
@@ -253,7 +251,6 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
connect( mActionExportAtlasAsSVG, &QAction::triggered, this, &QgsLayoutDesignerDialog::exportAtlasToSvg );
connect( mActionExportAtlasAsPDF, &QAction::triggered, this, &QgsLayoutDesignerDialog::exportAtlasToPdf );

connect( mActionReportSettings, &QAction::triggered, this, &QgsLayoutDesignerDialog::showReportSettings );
connect( mActionExportReportAsImage, &QAction::triggered, this, &QgsLayoutDesignerDialog::exportReportToRaster );
connect( mActionExportReportAsSVG, &QAction::triggered, this, &QgsLayoutDesignerDialog::exportReportToSvg );
connect( mActionExportReportAsPDF, &QAction::triggered, this, &QgsLayoutDesignerDialog::exportReportToPdf );
@@ -702,11 +699,11 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla

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

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

const QList<QDockWidget *> docks = findChildren<QDockWidget *>();
for ( QDockWidget *dock : docks )
@@ -2177,14 +2174,6 @@ void QgsLayoutDesignerDialog::exportToSvg()
mLayout->project()->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawOutlineLabels" ), prevSettingLabelsAsOutlines );
}

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

mAtlasDock->setUserVisible( checked );
}

void QgsLayoutDesignerDialog::atlasPreviewTriggered( bool checked )
{
QgsPrintLayout *printLayout = qobject_cast< QgsPrintLayout * >( mLayout );
@@ -3520,14 +3509,6 @@ void QgsLayoutDesignerDialog::printReport()
mView->setPaintingEnabled( true );
}

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

mReportDock->setUserVisible( checked );
}

void QgsLayoutDesignerDialog::pageSetup()
{
if ( currentLayout() && currentLayout()->pageCollection()->pageCount() > 0 )
@@ -339,7 +339,6 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
void exportToRaster();
void exportToPdf();
void exportToSvg();
void showAtlasSettings( bool checked );
void atlasPreviewTriggered( bool checked );
void atlasPageComboEditingFinished();
void atlasNext();
@@ -355,7 +354,6 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
void exportReportToSvg();
void exportReportToPdf();
void printReport();
void showReportSettings( bool checked );

void pageSetup();

@@ -873,7 +873,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
showStatsDock->setObjectName( QStringLiteral( "ShowStatisticsPanel" ) );
showStatsDock->setWhatsThis( tr( "Show Statistics Panel" ) );

connect( mStatisticalSummaryDockWidget, &QDockWidget::visibilityChanged, mActionStatisticalSummary, &QAction::setChecked );
endProfile();

// Bookmarks dock
@@ -885,8 +884,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
connect( showBookmarksDock, &QShortcut::activated, mBookMarksDockWidget, &QgsDockWidget::toggleUserVisible );
showBookmarksDock->setObjectName( QStringLiteral( "ShowBookmarksPanel" ) );
showBookmarksDock->setWhatsThis( tr( "Show Bookmarks Panel" ) );
mBookMarksDockWidget->setLinkedAction( mActionShowBookmarks );

connect( mBookMarksDockWidget, &QDockWidget::visibilityChanged, mActionShowBookmarks, &QAction::setChecked );
endProfile();

startProfile( QStringLiteral( "Snapping utils" ) );
@@ -2110,15 +2109,14 @@ void QgisApp::createActions()
connect( mActionZoomActualSize, &QAction::triggered, this, &QgisApp::zoomActualSize );
connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips );
connect( mActionNewBookmark, &QAction::triggered, this, &QgisApp::newBookmark );
connect( mActionShowBookmarks, &QAction::toggled, this, &QgisApp::showBookmarks );
connect( mActionDraw, &QAction::triggered, this, &QgisApp::refreshMapCanvas );
connect( mActionTextAnnotation, &QAction::triggered, this, &QgisApp::addTextAnnotation );
connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation );
connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation );
connect( mActionSvgAnnotation, &QAction::triggered, this, &QgisApp::addSvgAnnotation );
connect( mActionAnnotation, &QAction::triggered, this, &QgisApp::modifyAnnotation );
connect( mActionLabeling, &QAction::triggered, this, &QgisApp::labeling );
connect( mActionStatisticalSummary, &QAction::toggled, this, &QgisApp::showStatisticsDockWidget );
mStatisticalSummaryDockWidget->setLinkedAction( mActionStatisticalSummary );

// Layer Menu Items

@@ -13934,11 +13932,6 @@ void QgisApp::showSystemNotification( const QString &title, const QString &messa
}
}

void QgisApp::showStatisticsDockWidget( bool show )
{
mStatisticalSummaryDockWidget->setUserVisible( show );
}

void QgisApp::onLayerError( const QString &msg )
{
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( sender() );
@@ -1650,11 +1650,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void toggleFilterLegendByExpression( bool );
void updateFilterLegend();

/**
* Shows the statistical summary dock widget and brings it to the foreground
*/
void showStatisticsDockWidget( bool show );

//! Pushes a layer error to the message bar
void onLayerError( const QString &msg );

0 comments on commit f8863aa

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