Skip to content

Commit be632a9

Browse files
author
jef
committedFeb 27, 2011
allow switching between geometry and all tables in the selection dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15281 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed
 

‎src/app/postgres/qgspgsourceselect.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
117117
mSearchModeComboBox->setVisible( false );
118118
mSearchModeLabel->setVisible( false );
119119
mSearchTableEdit->setVisible( false );
120+
121+
cbxAllowGeometrylessTables->setDisabled( true );
120122
}
121123
/** Autoconnected SLOTS **/
122124
// Slot for adding a new connection
@@ -147,6 +149,7 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
147149
settings.remove( key + "/sslmode" );
148150
settings.remove( key + "/publicOnly" );
149151
settings.remove( key + "/geometryColumnsOnly" );
152+
settings.remove( key + "/allowGeometrylessTables" );
150153
settings.remove( key + "/estimatedMetadata" );
151154
settings.remove( key + "/saveUsername" );
152155
settings.remove( key + "/savePassword" );
@@ -194,6 +197,15 @@ void QgsPgSourceSelect::on_cmbConnections_activated( int )
194197
// Remember which database was selected.
195198
QSettings settings;
196199
settings.setValue( "/PostgreSQL/connections/selected", cmbConnections->currentText() );
200+
201+
cbxAllowGeometrylessTables->blockSignals( true );
202+
cbxAllowGeometrylessTables->setChecked( settings.value( "/PostgreSQL/connections/" + cmbConnections->currentText() + "/allowGeometrylessTables", false ).toBool() );
203+
cbxAllowGeometrylessTables->blockSignals( false );
204+
}
205+
206+
void QgsPgSourceSelect::on_cbxAllowGeometrylessTables_stateChanged( int )
207+
{
208+
on_btnConnect_clicked();
197209
}
198210

199211
void QgsPgSourceSelect::on_btnBuildQuery_clicked()
@@ -410,6 +422,8 @@ void QgsPgSourceSelect::addTables()
410422

411423
void QgsPgSourceSelect::on_btnConnect_clicked()
412424
{
425+
cbxAllowGeometrylessTables->setEnabled( true );
426+
413427
if ( mColumnTypeThread )
414428
{
415429
mColumnTypeThread->stop();
@@ -444,7 +458,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
444458

445459
bool searchPublicOnly = settings.value( key + "/publicOnly" ).toBool();
446460
bool searchGeometryColumnsOnly = settings.value( key + "/geometryColumnsOnly" ).toBool();
447-
bool allowGeometrylessTables = settings.value( key + "/allowGeometrylessTables", false ).toBool();
461+
bool allowGeometrylessTables = cbxAllowGeometrylessTables->isChecked();
448462
mUseEstimatedMetadata = settings.value( key + "/estimatedMetadata" ).toBool();
449463
// Need to escape the password to allow for single quotes and backslashes
450464

‎src/app/postgres/qgspgsourceselect.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
124124
* Once connected, available layers are displayed.
125125
*/
126126
void on_btnConnect_clicked();
127+
void on_cbxAllowGeometrylessTables_stateChanged( int );
127128
//! Opens the create connection dialog to build a new connection
128129
void on_btnNew_clicked();
129130
//! Opens a dialog to edit an existing connection

‎src/app/spatialite/qgsspatialitesourceselect.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
8484
mSearchModeComboBox->setVisible( false );
8585
mSearchModeLabel->setVisible( false );
8686
mSearchTableEdit->setVisible( false );
87+
cbxAllowGeometrylessTables->setVisible( false );
8788
}
8889

8990
// Slot for performing action when the Add button is clicked

‎src/ui/qgsdbsourceselectbase.ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@
7676
</property>
7777
</widget>
7878
</item>
79+
<item>
80+
<widget class="QCheckBox" name="cbxAllowGeometrylessTables">
81+
<property name="text">
82+
<string>Allow geometryless tables</string>
83+
</property>
84+
</widget>
85+
</item>
7986
<item>
8087
<widget class="QPushButton" name="btnBuildQuery">
8188
<property name="enabled">

0 commit comments

Comments
 (0)
Please sign in to comment.