Skip to content
Permalink
Browse files

allow switching between geometry and all tables in the selection dialog

git-svn-id: http://svn.osgeo.org/qgis/trunk@15281 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Feb 27, 2011
1 parent ed9af81 commit e4bcb6ad9932734fd4b4b5cf4e6e7802ae8407ef
@@ -117,6 +117,8 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
mSearchModeComboBox->setVisible( false );
mSearchModeLabel->setVisible( false );
mSearchTableEdit->setVisible( false );

cbxAllowGeometrylessTables->setDisabled( true );
}
/** Autoconnected SLOTS **/
// Slot for adding a new connection
@@ -147,6 +149,7 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
settings.remove( key + "/sslmode" );
settings.remove( key + "/publicOnly" );
settings.remove( key + "/geometryColumnsOnly" );
settings.remove( key + "/allowGeometrylessTables" );
settings.remove( key + "/estimatedMetadata" );
settings.remove( key + "/saveUsername" );
settings.remove( key + "/savePassword" );
@@ -194,6 +197,15 @@ void QgsPgSourceSelect::on_cmbConnections_activated( int )
// Remember which database was selected.
QSettings settings;
settings.setValue( "/PostgreSQL/connections/selected", cmbConnections->currentText() );

cbxAllowGeometrylessTables->blockSignals( true );
cbxAllowGeometrylessTables->setChecked( settings.value( "/PostgreSQL/connections/" + cmbConnections->currentText() + "/allowGeometrylessTables", false ).toBool() );
cbxAllowGeometrylessTables->blockSignals( false );
}

void QgsPgSourceSelect::on_cbxAllowGeometrylessTables_stateChanged( int )
{
on_btnConnect_clicked();
}

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

void QgsPgSourceSelect::on_btnConnect_clicked()
{
cbxAllowGeometrylessTables->setEnabled( true );

if ( mColumnTypeThread )
{
mColumnTypeThread->stop();
@@ -444,7 +458,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()

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

@@ -124,6 +124,7 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
* Once connected, available layers are displayed.
*/
void on_btnConnect_clicked();
void on_cbxAllowGeometrylessTables_stateChanged( int );
//! Opens the create connection dialog to build a new connection
void on_btnNew_clicked();
//! Opens a dialog to edit an existing connection
@@ -84,6 +84,7 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
mSearchModeComboBox->setVisible( false );
mSearchModeLabel->setVisible( false );
mSearchTableEdit->setVisible( false );
cbxAllowGeometrylessTables->setVisible( false );
}

// Slot for performing action when the Add button is clicked
@@ -76,6 +76,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxAllowGeometrylessTables">
<property name="text">
<string>Allow geometryless tables</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnBuildQuery">
<property name="enabled">

0 comments on commit e4bcb6a

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