Skip to content
Permalink
Browse files

Add preferred value in QSettings

  • Loading branch information
pblottiere authored and nyalldawson committed May 21, 2018
1 parent c67d09c commit 64d52ff0744cb984c553711ea82f081d53949321
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/app/qgisapp.cpp
@@ -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 );

@@ -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 );
}

0 comments on commit 64d52ff

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