[QGIS Commit] r15281 - in trunk/qgis/src: app/postgres app/spatialite ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Feb 27 18:33:32 EST 2011


Author: jef
Date: 2011-02-27 15:33:32 -0800 (Sun, 27 Feb 2011)
New Revision: 15281

Modified:
   trunk/qgis/src/app/postgres/qgspgsourceselect.cpp
   trunk/qgis/src/app/postgres/qgspgsourceselect.h
   trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp
   trunk/qgis/src/ui/qgsdbsourceselectbase.ui
Log:
allow switching between geometry and all tables in the selection dialog

Modified: trunk/qgis/src/app/postgres/qgspgsourceselect.cpp
===================================================================
--- trunk/qgis/src/app/postgres/qgspgsourceselect.cpp	2011-02-27 19:48:46 UTC (rev 15280)
+++ trunk/qgis/src/app/postgres/qgspgsourceselect.cpp	2011-02-27 23:33:32 UTC (rev 15281)
@@ -117,6 +117,8 @@
   mSearchModeComboBox->setVisible( false );
   mSearchModeLabel->setVisible( false );
   mSearchTableEdit->setVisible( false );
+
+  cbxAllowGeometrylessTables->setDisabled( true );
 }
 /** Autoconnected SLOTS **/
 // Slot for adding a new connection
@@ -147,6 +149,7 @@
   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,8 +197,17 @@
   // 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()
 {
   setSql( mTablesTreeView->currentIndex() );
@@ -410,6 +422,8 @@
 
 void QgsPgSourceSelect::on_btnConnect_clicked()
 {
+  cbxAllowGeometrylessTables->setEnabled( true );
+
   if ( mColumnTypeThread )
   {
     mColumnTypeThread->stop();
@@ -444,7 +458,7 @@
 
   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
 

Modified: trunk/qgis/src/app/postgres/qgspgsourceselect.h
===================================================================
--- trunk/qgis/src/app/postgres/qgspgsourceselect.h	2011-02-27 19:48:46 UTC (rev 15280)
+++ trunk/qgis/src/app/postgres/qgspgsourceselect.h	2011-02-27 23:33:32 UTC (rev 15281)
@@ -124,6 +124,7 @@
     * 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

Modified: trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp
===================================================================
--- trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp	2011-02-27 19:48:46 UTC (rev 15280)
+++ trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp	2011-02-27 23:33:32 UTC (rev 15281)
@@ -84,6 +84,7 @@
   mSearchModeComboBox->setVisible( false );
   mSearchModeLabel->setVisible( false );
   mSearchTableEdit->setVisible( false );
+  cbxAllowGeometrylessTables->setVisible( false );
 }
 
 // Slot for performing action when the Add button is clicked

Modified: trunk/qgis/src/ui/qgsdbsourceselectbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsdbsourceselectbase.ui	2011-02-27 19:48:46 UTC (rev 15280)
+++ trunk/qgis/src/ui/qgsdbsourceselectbase.ui	2011-02-27 23:33:32 UTC (rev 15281)
@@ -77,6 +77,13 @@
     </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">
       <bool>false</bool>



More information about the QGIS-commit mailing list