Skip to content

Commit

Permalink
Small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 2, 2016
1 parent 7ca1541 commit 103ab0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -925,7 +925,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
// This turns on the map tip if they where active in the last session
if ( settings.value( "/qgis/enableMapTips", false ).toBool() )
{
mActionMapTips->trigger();
toggleMapTips( true );
}

mTrustedMacros = false;
Expand Down Expand Up @@ -1455,7 +1455,7 @@ void QgisApp::createActions()
connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) );
connect( mActionZoomNext, SIGNAL( triggered() ), this, SLOT( zoomToNext() ) );
connect( mActionZoomActualSize, SIGNAL( triggered() ), this, SLOT( zoomActualSize() ) );
connect( mActionMapTips, SIGNAL( triggered() ), this, SLOT( toggleMapTips() ) );
connect( mActionMapTips, SIGNAL( toggled( bool ) ), this, SLOT( toggleMapTips( bool ) ) );
connect( mActionNewBookmark, SIGNAL( triggered() ), this, SLOT( newBookmark() ) );
connect( mActionShowBookmarks, SIGNAL( triggered() ), this, SLOT( showBookmarks() ) );
connect( mActionDraw, SIGNAL( triggered() ), this, SLOT( refreshMapCanvas() ) );
Expand Down Expand Up @@ -7433,9 +7433,9 @@ void QgisApp::canvasRefreshFinished()
showProgress( 0, 0 ); // stop the busy indicator
}

void QgisApp::toggleMapTips()
void QgisApp::toggleMapTips( bool enabled )
{
mMapTipsVisible = !mMapTipsVisible;
mMapTipsVisible = enabled;
// Store if maptips are active
QSettings().setValue( "/qgis/enableMapTips", mMapTipsVisible );

Expand All @@ -7444,6 +7444,9 @@ void QgisApp::toggleMapTips()
{
mpMapTipsTimer->stop();
}

if ( mActionMapTips->isChecked() != mMapTipsVisible )
mActionMapTips->setChecked( mMapTipsVisible );
}

void QgisApp::toggleEditing()
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Expand Up @@ -1208,7 +1208,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void oldProjectVersionWarning( const QString& );

//! Toggle map tips on/off
void toggleMapTips();
void toggleMapTips( bool enabled );

//! Show the map tip
void showMapTip();
Expand Down

0 comments on commit 103ab0d

Please sign in to comment.