Skip to content

Commit

Permalink
Remove option to change selection mode of postgres and oracle dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 25, 2019
1 parent 35297b4 commit 916529f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 46 deletions.
4 changes: 0 additions & 4 deletions src/app/qgsoptions.cpp
Expand Up @@ -665,8 +665,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
cbxCheckVersion->setChecked( mSettings->value( QStringLiteral( "/qgis/checkVersion" ), true ).toBool() );
cbxCheckVersion->setVisible( mSettings->value( QStringLiteral( "/qgis/allowVersionCheck" ), true ).toBool() );
cbxAttributeTableDocked->setChecked( mSettings->value( QStringLiteral( "/qgis/dockAttributeTable" ), false ).toBool() );
cbxAddPostgisDC->setChecked( mSettings->value( QStringLiteral( "/qgis/addPostgisDC" ), true ).toBool() );
cbxAddOracleDC->setChecked( mSettings->value( QStringLiteral( "/qgis/addOracleDC" ), true ).toBool() );
cbxCompileExpressions->setChecked( mSettings->value( QStringLiteral( "/qgis/compileExpressions" ), true ).toBool() );

mComboCopyFeatureFormat->addItem( tr( "Plain text, no geometry" ), QgsClipboard::AttributesOnly );
Expand Down Expand Up @@ -1468,8 +1466,6 @@ void QgsOptions::saveOptions()
mSettings->setValue( QStringLiteral( "/qgis/ignoreShapeEncoding" ), cbxIgnoreShapeEncoding->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/mainSnappingWidgetMode" ), mSnappingMainDialogComboBox->currentData() );

mSettings->setValue( QStringLiteral( "/qgis/addPostgisDC" ), cbxAddPostgisDC->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/addOracleDC" ), cbxAddOracleDC->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/compileExpressions" ), cbxCompileExpressions->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/defaultLegendGraphicResolution" ), mLegendGraphicResolutionSpinBox->value() );
mSettings->setValue( QStringLiteral( "/qgis/mapTipsDelay" ), mMapTipsDelaySpinBox->value() );
Expand Down
16 changes: 2 additions & 14 deletions src/providers/oracle/qgsoraclesourceselect.cpp
Expand Up @@ -220,11 +220,7 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags f

connect( mTablesTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsOracleSourceSelect::treeWidgetSelectionChanged );

QgsSettings settings;
mTablesTreeView->setSelectionMode( settings.value( QStringLiteral( "qgis/addOracleDC" ), true ).toBool() ?
QAbstractItemView::ExtendedSelection :
QAbstractItemView::MultiSelection );

mTablesTreeView->setSelectionMode( QAbstractItemView::ExtendedSelection );

//for Qt < 4.3.2, passing -1 to include all model columns
//in search does not seem to work
Expand Down Expand Up @@ -350,15 +346,7 @@ void QgsOracleSourceSelect::on_mTablesTreeView_clicked( const QModelIndex &index

void QgsOracleSourceSelect::on_mTablesTreeView_doubleClicked( const QModelIndex &index )
{
QgsSettings settings;
if ( settings.value( QStringLiteral( "qgis/addOracleDC" ), true ).toBool() )
{
addButtonClicked();
}
else
{
setSql( index );
}
addButtonClicked();
}

void QgsOracleSourceSelect::on_mSearchGroupBox_toggled( bool checked )
Expand Down
18 changes: 4 additions & 14 deletions src/providers/postgres/qgspgsourceselect.cpp
Expand Up @@ -271,15 +271,13 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsPr

connect( mTablesTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsPgSourceSelect::treeWidgetSelectionChanged );

QgsSettings settings;
mTablesTreeView->setSelectionMode( settings.value( QStringLiteral( "qgis/addPostgisDC" ), true ).toBool() ?
QAbstractItemView::ExtendedSelection :
QAbstractItemView::MultiSelection );
mTablesTreeView->setSelectionMode( QAbstractItemView::ExtendedSelection );

//for Qt < 4.3.2, passing -1 to include all model columns
//in search does not seem to work
mSearchColumnComboBox->setCurrentIndex( 2 );

QgsSettings settings;
mHoldDialogOpen->setChecked( settings.value( QStringLiteral( "Windows/PgSourceSelect/HoldDialogOpen" ), false ).toBool() );

for ( int i = 0; i < mTableModel.columnCount(); i++ )
Expand Down Expand Up @@ -383,17 +381,9 @@ void QgsPgSourceSelect::mTablesTreeView_clicked( const QModelIndex &index )
mBuildQueryButton->setEnabled( index.parent().isValid() );
}

void QgsPgSourceSelect::mTablesTreeView_doubleClicked( const QModelIndex &index )
void QgsPgSourceSelect::mTablesTreeView_doubleClicked( const QModelIndex & )
{
QgsSettings settings;
if ( settings.value( QStringLiteral( "qgis/addPostgisDC" ), true ).toBool() )
{
addButtonClicked();
}
else
{
setSql( index );
}
addButtonClicked();
}

void QgsPgSourceSelect::mSearchGroupBox_toggled( bool checked )
Expand Down
14 changes: 0 additions & 14 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -1991,20 +1991,6 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<widget class="QCheckBox" name="cbxAddPostgisDC">
<property name="text">
<string>Add PostGIS layers with double-click and select in extended mode</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<widget class="QCheckBox" name="cbxAddOracleDC">
<property name="text">
<string>Add Oracle layers with double-click and select in extended mode</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="cmbScanZipInBrowser">
<property name="currentIndex">
Expand Down

0 comments on commit 916529f

Please sign in to comment.