Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add preferred value in QSettings
  • Loading branch information
pblottiere authored and nyalldawson committed Jul 20, 2018
1 parent c67d09c commit 64d52ff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -2885,6 +2885,15 @@ void QgisApp::createToolBars()
vertexToolButton->addAction( mActionVertexToolActiveLayer );
mAdvancedDigitizeToolBar->insertWidget( mActionDeleteSelected, vertexToolButton );
QAction *defActionVertexTool = mActionVertexTool;
switch ( settings.value( QStringLiteral( "UI/defaultVertexTool" ), 0 ).toInt() )
{
case 0:
defActionVertexTool = mActionVertexTool;
break;
case 1:
defActionVertexTool = mActionVertexToolActiveLayer;
break;
};
vertexToolButton->setDefaultAction( defActionVertexTool );
connect( vertexToolButton, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );

Expand Down Expand Up @@ -13602,6 +13611,10 @@ void QgisApp::toolButtonActionTriggered( QAction *action )
settings.setValue( QStringLiteral( "UI/defaultMoveTool" ), 0 );
else if ( action == mActionMoveFeatureCopy )
settings.setValue( QStringLiteral( "UI/defaultMoveTool" ), 1 );
else if ( action == mActionVertexTool )
settings.setValue( QStringLiteral( "UI/defaultVertexTool" ), 0 );
else if ( action == mActionVertexToolActiveLayer )
settings.setValue( QStringLiteral( "UI/defaultVertexTool" ), 1 );

bt->setDefaultAction( action );
}
Expand Down

0 comments on commit 64d52ff

Please sign in to comment.