[QGIS Commit] r15283 - in trunk/qgis/src: app/spatialite plugins/sqlanywhere ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Feb 28 12:00:47 EST 2011


Author: jef
Date: 2011-02-28 09:00:46 -0800 (Mon, 28 Feb 2011)
New Revision: 15283

Modified:
   trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp
   trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.h
   trunk/qgis/src/plugins/sqlanywhere/sasourceselect.cpp
   trunk/qgis/src/plugins/sqlanywhere/sasourceselect.h
   trunk/qgis/src/ui/qgsdbsourceselectbase.ui
Log:
database source select: 'move build query' to button box

Modified: trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp
===================================================================
--- trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp	2011-02-28 08:09:22 UTC (rev 15282)
+++ trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.cpp	2011-02-28 17:00:46 UTC (rev 15283)
@@ -47,6 +47,11 @@
   connectionsGroupBox->setTitle( tr( "Databases" ) );
   btnEdit->hide();  // hide the edit button
 
+  mBuildQueryButton = new QPushButton( tr( "&Build Query" ) );
+  buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
+  connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
+  mBuildQueryButton->setEnabled( false );
+
   mAddButton = new QPushButton( tr( "&Add" ) );
   buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
   connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClicked() ) );
@@ -101,14 +106,14 @@
   dbChanged();
 }
 
-void QgsSpatiaLiteSourceSelect::on_btnBuildQuery_clicked()
+void QgsSpatiaLiteSourceSelect::buildQuery()
 {
   setSql( mTablesTreeView->currentIndex() );
 }
 
 void QgsSpatiaLiteSourceSelect::on_mTablesTreeView_clicked( const QModelIndex &index )
 {
-  btnBuildQuery->setEnabled( index.parent().isValid() );
+  mBuildQueryButton->setEnabled( index.parent().isValid() );
 }
 
 void QgsSpatiaLiteSourceSelect::on_mTablesTreeView_doubleClicked( const QModelIndex &index )

Modified: trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.h
===================================================================
--- trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.h	2011-02-28 08:09:22 UTC (rev 15282)
+++ trunk/qgis/src/app/spatialite/qgsspatialitesourceselect.h	2011-02-28 17:00:46 UTC (rev 15283)
@@ -76,10 +76,10 @@
      * Once connected, available layers are displayed.
      */
     void on_btnConnect_clicked();
+    void buildQuery();
     void addClicked();
     //! Opens the create connection dialog to build a new connection
     void on_btnNew_clicked();
-    void on_btnBuildQuery_clicked();
     //! Deletes the selected connection
     void on_btnDelete_clicked();
     void on_mSearchTableEdit_textChanged( const QString & text );
@@ -151,6 +151,7 @@
     QgsDbFilterProxyModel mProxyModel;
 
     QString layerURI( const QModelIndex &index );
+    QPushButton *mBuildQueryButton;
     QPushButton *mAddButton;
 };
 

Modified: trunk/qgis/src/plugins/sqlanywhere/sasourceselect.cpp
===================================================================
--- trunk/qgis/src/plugins/sqlanywhere/sasourceselect.cpp	2011-02-28 08:09:22 UTC (rev 15282)
+++ trunk/qgis/src/plugins/sqlanywhere/sasourceselect.cpp	2011-02-28 17:00:46 UTC (rev 15283)
@@ -59,6 +59,11 @@
 {
   setupUi( this );
 
+  mBuildQueryButton = new QPushButton( tr( "&Build Query" ) );
+  buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
+  connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
+  mBuildQueryButton->setEnabled( false );
+
   mAddButton = new QPushButton( tr( "&Add" ) );
   buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
   connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addTables() ) );
@@ -168,7 +173,7 @@
   settings.setValue( "/SQLAnywhere/connections/selected", cmbConnections->currentText() );
 }
 
-void SaSourceSelect::on_btnBuildQuery_clicked()
+void SaSourceSelect::buildQuery()
 {
   setSql( mTablesTreeView->currentIndex() );
 }

Modified: trunk/qgis/src/plugins/sqlanywhere/sasourceselect.h
===================================================================
--- trunk/qgis/src/plugins/sqlanywhere/sasourceselect.h	2011-02-28 08:09:22 UTC (rev 15282)
+++ trunk/qgis/src/plugins/sqlanywhere/sasourceselect.h	2011-02-28 17:00:46 UTC (rev 15283)
@@ -114,6 +114,7 @@
   public slots:
     //! Determines the tables the user selected and closes the dialog
     void addTables();
+    void buildQuery();
 
     /*! Connects to the database using the stored connection parameters.
     * Once connected, available layers are displayed.
@@ -123,7 +124,6 @@
     void on_btnNew_clicked();
     //! Opens a dialog to edit an existing connection
     void on_btnEdit_clicked();
-    void on_btnBuildQuery_clicked();
     //! Deletes the selected connection
     void on_btnDelete_clicked();
     void on_mSearchTableEdit_textChanged( const QString & text );
@@ -183,6 +183,9 @@
     SaDbTableModel mTableModel;
     SaDbFilterProxyModel mProxyModel;
 
+    // button for building queries
+    QPushButton *mBuildQueryButton;
+
     // button for adding layers
     QPushButton *mAddButton;
 };

Modified: trunk/qgis/src/ui/qgsdbsourceselectbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsdbsourceselectbase.ui	2011-02-28 08:09:22 UTC (rev 15282)
+++ trunk/qgis/src/ui/qgsdbsourceselectbase.ui	2011-02-28 17:00:46 UTC (rev 15283)
@@ -84,16 +84,6 @@
     </widget>
    </item>
    <item>
-    <widget class="QPushButton" name="btnBuildQuery">
-     <property name="enabled">
-      <bool>false</bool>
-     </property>
-     <property name="text">
-      <string>Build query</string>
-     </property>
-    </widget>
-   </item>
-   <item>
     <widget class="QGroupBox" name="mSearchGroupBox">
      <property name="title">
       <string>Search options</string>



More information about the QGIS-commit mailing list