@@ -2360,22 +2360,40 @@ void QgisApp::createToolBars()
2360
2360
2361
2361
QToolButton *bt = new QToolButton ( mAttributesToolBar );
2362
2362
bt->setPopupMode ( QToolButton::MenuButtonPopup );
2363
- QList<QAction *> selectActions;
2364
- selectActions << mActionSelectByForm << mActionSelectByExpression << mActionSelectAll
2365
- << mActionInvertSelection ;
2366
- bt->addActions ( selectActions );
2367
- bt->setDefaultAction ( mActionSelectByForm );
2363
+ QList<QAction *> selectionActions;
2364
+ selectionActions << mActionSelectByForm << mActionSelectByExpression << mActionSelectAll
2365
+ << mActionInvertSelection ;
2366
+ bt->addActions ( selectionActions );
2367
+
2368
+ QAction *defSelectionAction = mActionSelectByForm ;
2369
+ switch ( settings.value ( QStringLiteral ( " UI/selectionTool" ), 0 ).toInt () )
2370
+ {
2371
+ case 0 :
2372
+ defSelectionAction = mActionSelectByForm ;
2373
+ break ;
2374
+ case 1 :
2375
+ defSelectionAction = mActionSelectByExpression ;
2376
+ break ;
2377
+ case 2 :
2378
+ defSelectionAction = mActionSelectAll ;
2379
+ break ;
2380
+ case 3 :
2381
+ defSelectionAction = mActionInvertSelection ;
2382
+ break ;
2383
+ }
2384
+ bt->setDefaultAction ( defSelectionAction );
2368
2385
QAction *selectionAction = mAttributesToolBar ->insertWidget ( mActionDeselectAll , bt );
2369
2386
selectionAction->setObjectName ( QStringLiteral ( " ActionSelection" ) );
2387
+ connect ( bt, &QToolButton::triggered, this , &QgisApp::toolButtonActionTriggered );
2370
2388
2371
2389
// select tool button
2372
2390
2373
2391
bt = new QToolButton ( mAttributesToolBar );
2374
2392
bt->setPopupMode ( QToolButton::MenuButtonPopup );
2375
- QList<QAction *> selectionActions ;
2376
- selectionActions << mActionSelectFeatures << mActionSelectPolygon
2377
- << mActionSelectFreehand << mActionSelectRadius ;
2378
- bt->addActions ( selectionActions );
2393
+ QList<QAction *> selectActions ;
2394
+ selectActions << mActionSelectFeatures << mActionSelectPolygon
2395
+ << mActionSelectFreehand << mActionSelectRadius ;
2396
+ bt->addActions ( selectActions );
2379
2397
2380
2398
QAction *defSelectAction = mActionSelectFeatures ;
2381
2399
switch ( settings.value ( QStringLiteral ( " UI/selectTool" ), 1 ).toInt () )
@@ -2465,7 +2483,6 @@ void QgisApp::createToolBars()
2465
2483
case 4 :
2466
2484
defAnnotationAction = mActionAnnotation ;
2467
2485
break ;
2468
-
2469
2486
}
2470
2487
bt->setDefaultAction ( defAnnotationAction );
2471
2488
QAction *annotationAction = mAttributesToolBar ->addWidget ( bt );
@@ -12770,6 +12787,14 @@ void QgisApp::toolButtonActionTriggered( QAction *action )
12770
12787
settings.setValue ( QStringLiteral ( " UI/selectTool" ), 3 );
12771
12788
else if ( action == mActionSelectFreehand )
12772
12789
settings.setValue ( QStringLiteral ( " UI/selectTool" ), 4 );
12790
+ else if ( action == mActionSelectByForm )
12791
+ settings.setValue ( QStringLiteral ( " UI/selectionTool" ), 0 );
12792
+ else if ( action == mActionSelectByExpression )
12793
+ settings.setValue ( QStringLiteral ( " UI/selectionTool" ), 1 );
12794
+ else if ( action == mActionSelectAll )
12795
+ settings.setValue ( QStringLiteral ( " UI/selectionTool" ), 2 );
12796
+ else if ( action == mActionInvertSelection )
12797
+ settings.setValue ( QStringLiteral ( " UI/selectionTool" ), 3 );
12773
12798
else if ( action == mActionMeasure )
12774
12799
settings.setValue ( QStringLiteral ( " UI/measureTool" ), 0 );
12775
12800
else if ( action == mActionMeasureArea )
0 commit comments