Skip to content
Permalink
Browse files

[needs-docs][ui] Better placement for the method combobox and auto op…

…en action

(this is a follow up to PR #33643) better combobox / checkbox placement
  • Loading branch information
nirvn committed Jan 10, 2020
1 parent cf4443a commit e99cef48ca1c8f036149d261bc68e352b66a43ba
Showing with 30 additions and 34 deletions.
  1. +14 −3 src/app/qgsidentifyresultsdialog.cpp
  2. +1 −1 src/app/qgsidentifyresultsdialog.h
  3. +15 −30 src/ui/qgsidentifyresultsbase.ui
@@ -325,10 +325,10 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
connect( cmbIdentifyMode, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsIdentifyResultsDialog::cmbIdentifyMode_currentIndexChanged );
connect( cmbViewMode, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsIdentifyResultsDialog::cmbViewMode_currentIndexChanged );
connect( mExpandNewAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::mExpandNewAction_triggered );
connect( cbxAutoFeatureForm, &QCheckBox::toggled, this, &QgsIdentifyResultsDialog::cbxAutoFeatureForm_toggled );
connect( mExpandAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::mExpandAction_triggered );
connect( mCollapseAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::mCollapseAction_triggered );
connect( mActionCopy, &QAction::triggered, this, &QgsIdentifyResultsDialog::mActionCopy_triggered );
connect( mActionAutoFeatureForm, &QAction::toggled, this, &QgsIdentifyResultsDialog::mActionAutoFeatureForm_toggled );

mOpenFormAction->setDisabled( true );

@@ -383,7 +383,6 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
cmbIdentifyMode->addItem( tr( "Top down" ), QgsMapToolIdentify::TopDownAll );
cmbIdentifyMode->addItem( tr( "Layer selection" ), QgsMapToolIdentify::LayerSelection );
cmbIdentifyMode->setCurrentIndex( cmbIdentifyMode->findData( identifyMode ) );
cbxAutoFeatureForm->setChecked( mySettings.value( QStringLiteral( "Map/identifyAutoFeatureForm" ), false ).toBool() );

// view modes
cmbViewMode->addItem( tr( "Tree" ), 0 );
@@ -417,6 +416,18 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
connect( mHelpToolButton, &QAbstractButton::clicked, this, &QgsIdentifyResultsDialog::showHelp );

initSelectionModes();

QMenu *settingsMenu = new QMenu();
QToolButton *settingsButton = new QToolButton();
settingsButton->setAutoRaise( true );
settingsButton->setToolTip( tr( "Identify Settings" ) );
settingsButton->setMenu( settingsMenu );
settingsButton->setPopupMode( QToolButton::InstantPopup );
settingsButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOptions.svg" ) ) );
mIdentifyToolbar->addWidget( settingsButton );

settingsMenu->addAction( mActionAutoFeatureForm );
mActionAutoFeatureForm->setChecked( mySettings.value( QStringLiteral( "Map/identifyAutoFeatureForm" ), false ).toBool() );
}

QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog()
@@ -2051,7 +2062,7 @@ void QgsIdentifyResultsDialog::cmbViewMode_currentIndexChanged( int index )
stackedWidget->setCurrentIndex( index );
}

void QgsIdentifyResultsDialog::cbxAutoFeatureForm_toggled( bool checked )
void QgsIdentifyResultsDialog::mActionAutoFeatureForm_toggled( bool checked )
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Map/identifyAutoFeatureForm" ), checked );
@@ -242,7 +242,7 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti

void mExpandNewAction_triggered( bool checked );

void cbxAutoFeatureForm_toggled( bool checked );
void mActionAutoFeatureForm_toggled( bool checked );

void mExpandAction_triggered( bool checked ) { Q_UNUSED( checked ) expandAll(); }
void mCollapseAction_triggered( bool checked ) { Q_UNUSED( checked ) collapseAll(); }
@@ -72,6 +72,7 @@
<addaction name="separator"/>
<addaction name="mActionCopy"/>
<addaction name="mActionPrint"/>
<addaction name="separator"/>
</widget>
</item>
<item>
@@ -115,6 +116,12 @@
</item>
<item>
<widget class="QComboBox" name="cmbIdentifyMode">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToMinimumContentsLengthWithIcon</enum>
</property>
@@ -123,36 +130,6 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_43">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cbxAutoFeatureForm">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblAutoFeatureForm">
<property name="text">
<string>Auto open form</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@@ -388,6 +365,14 @@
<string>Identify Features by Radius</string>
</property>
</action>
<action name="mActionAutoFeatureForm">
<property name="text">
<string>Auto open form for single feature results</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

0 comments on commit e99cef4

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