Skip to content
Permalink
Browse files

Unify behavior of Stats and Bookmark dock actions with other

actions for toggling dock visibility
  • Loading branch information
nyalldawson committed Jan 30, 2018
1 parent 77e54d3 commit 9d2f1bb99110bdd332daad7355e58168583f7260
Showing with 15 additions and 12 deletions.
  1. +9 −9 src/app/qgisapp.cpp
  2. +2 −2 src/app/qgisapp.h
  3. +4 −1 src/ui/qgisapp.ui
@@ -823,12 +823,14 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
startProfile( QStringLiteral( "Stats dock" ) );
mStatisticalSummaryDockWidget = new QgsStatisticalSummaryDockWidget( this );
mStatisticalSummaryDockWidget->setObjectName( QStringLiteral( "StatistalSummaryDockWidget" ) );
connect( mStatisticalSummaryDockWidget, &QDockWidget::visibilityChanged, mActionStatisticalSummary, &QAction::setChecked );
endProfile();

// Bookmarks dock
startProfile( QStringLiteral( "Bookmarks widget" ) );
mBookMarksDockWidget = new QgsBookmarks( this );
mBookMarksDockWidget->setObjectName( QStringLiteral( "BookmarksDockWidget" ) );
connect( mBookMarksDockWidget, &QDockWidget::visibilityChanged, mActionShowBookmarks, &QAction::setChecked );
endProfile();

startProfile( QStringLiteral( "Snapping utils" ) );
@@ -1935,15 +1937,15 @@ 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::triggered, this, &QgisApp::showBookmarks );
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::triggered, this, &QgisApp::showStatisticsDockWidget );
connect( mActionStatisticalSummary, &QAction::toggled, this, &QgisApp::showStatisticsDockWidget );

// Layer Menu Items

@@ -12281,14 +12283,13 @@ void QgisApp::customProjection()

void QgisApp::newBookmark()
{
showBookmarks();
showBookmarks( true );
mBookMarksDockWidget->addClicked();
}

void QgisApp::showBookmarks()
void QgisApp::showBookmarks( bool show )
{
mBookMarksDockWidget->show();
mBookMarksDockWidget->raise();
mBookMarksDockWidget->setUserVisible( show );
}

// Slot that gets called when the project file was saved with an older
@@ -13114,10 +13115,9 @@ void QgisApp::showSystemNotification( const QString &title, const QString &messa
mTray->hide();
}

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

void QgisApp::onLayerError( const QString &msg )
@@ -1307,7 +1307,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void projectPropertiesProjections();
/* void urlData(); */
//! Show the spatial bookmarks dialog
void showBookmarks();
void showBookmarks( bool show );
//! Create a new spatial bookmark
void newBookmark();
//! activates the add feature tool
@@ -1587,7 +1587,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
/**
* Shows the statistical summary dock widget and brings it to the foreground
*/
void showStatisticsDockWidget();
void showStatisticsDockWidget( bool show );

//! Pushes a layer error to the message bar
void onLayerError( const QString &msg );
@@ -1288,6 +1288,9 @@
</property>
</action>
<action name="mActionShowBookmarks">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionShowBookmarks.svg</normaloff>:/images/themes/default/mActionShowBookmarks.svg</iconset>
@@ -2511,7 +2514,7 @@ Acts on currently active editable layer</string>
</action>
<action name="mActionStatisticalSummary">
<property name="checkable">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">

0 comments on commit 9d2f1bb

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