|
@@ -2360,22 +2360,40 @@ void QgisApp::createToolBars() |
|
|
|
|
|
QToolButton *bt = new QToolButton( mAttributesToolBar ); |
|
|
bt->setPopupMode( QToolButton::MenuButtonPopup ); |
|
|
QList<QAction *> selectActions; |
|
|
selectActions << mActionSelectByForm << mActionSelectByExpression << mActionSelectAll |
|
|
<< mActionInvertSelection; |
|
|
bt->addActions( selectActions ); |
|
|
bt->setDefaultAction( mActionSelectByForm ); |
|
|
QList<QAction *> selectionActions; |
|
|
selectionActions << mActionSelectByForm << mActionSelectByExpression << mActionSelectAll |
|
|
<< mActionInvertSelection; |
|
|
bt->addActions( selectionActions ); |
|
|
|
|
|
QAction *defSelectionAction = mActionSelectByForm; |
|
|
switch ( settings.value( QStringLiteral( "UI/selectionTool" ), 0 ).toInt() ) |
|
|
{ |
|
|
case 0: |
|
|
defSelectionAction = mActionSelectByForm; |
|
|
break; |
|
|
case 1: |
|
|
defSelectionAction = mActionSelectByExpression; |
|
|
break; |
|
|
case 2: |
|
|
defSelectionAction = mActionSelectAll; |
|
|
break; |
|
|
case 3: |
|
|
defSelectionAction = mActionInvertSelection; |
|
|
break; |
|
|
} |
|
|
bt->setDefaultAction( defSelectionAction ); |
|
|
QAction *selectionAction = mAttributesToolBar->insertWidget( mActionDeselectAll, bt ); |
|
|
selectionAction->setObjectName( QStringLiteral( "ActionSelection" ) ); |
|
|
connect( bt, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered ); |
|
|
|
|
|
// select tool button |
|
|
|
|
|
bt = new QToolButton( mAttributesToolBar ); |
|
|
bt->setPopupMode( QToolButton::MenuButtonPopup ); |
|
|
QList<QAction *> selectionActions; |
|
|
selectionActions << mActionSelectFeatures << mActionSelectPolygon |
|
|
<< mActionSelectFreehand << mActionSelectRadius; |
|
|
bt->addActions( selectionActions ); |
|
|
QList<QAction *> selectActions; |
|
|
selectActions << mActionSelectFeatures << mActionSelectPolygon |
|
|
<< mActionSelectFreehand << mActionSelectRadius; |
|
|
bt->addActions( selectActions ); |
|
|
|
|
|
QAction *defSelectAction = mActionSelectFeatures; |
|
|
switch ( settings.value( QStringLiteral( "UI/selectTool" ), 1 ).toInt() ) |
|
@@ -2465,7 +2483,6 @@ void QgisApp::createToolBars() |
|
|
case 4: |
|
|
defAnnotationAction = mActionAnnotation; |
|
|
break; |
|
|
|
|
|
} |
|
|
bt->setDefaultAction( defAnnotationAction ); |
|
|
QAction *annotationAction = mAttributesToolBar->addWidget( bt ); |
|
@@ -12770,6 +12787,14 @@ void QgisApp::toolButtonActionTriggered( QAction *action ) |
|
|
settings.setValue( QStringLiteral( "UI/selectTool" ), 3 ); |
|
|
else if ( action == mActionSelectFreehand ) |
|
|
settings.setValue( QStringLiteral( "UI/selectTool" ), 4 ); |
|
|
else if ( action == mActionSelectByForm ) |
|
|
settings.setValue( QStringLiteral( "UI/selectionTool" ), 0 ); |
|
|
else if ( action == mActionSelectByExpression ) |
|
|
settings.setValue( QStringLiteral( "UI/selectionTool" ), 1 ); |
|
|
else if ( action == mActionSelectAll ) |
|
|
settings.setValue( QStringLiteral( "UI/selectionTool" ), 2 ); |
|
|
else if ( action == mActionInvertSelection ) |
|
|
settings.setValue( QStringLiteral( "UI/selectionTool" ), 3 ); |
|
|
else if ( action == mActionMeasure ) |
|
|
settings.setValue( QStringLiteral( "UI/measureTool" ), 0 ); |
|
|
else if ( action == mActionMeasureArea ) |
|
|