Skip to content

Commit de2ffe1

Browse files
author
jef
committedFeb 28, 2011
database source select: 'move build query' to button box
git-svn-id: http://svn.osgeo.org/qgis/trunk@15283 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6d2c488 commit de2ffe1

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed
 

‎src/app/spatialite/qgsspatialitesourceselect.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
4747
connectionsGroupBox->setTitle( tr( "Databases" ) );
4848
btnEdit->hide(); // hide the edit button
4949

50+
mBuildQueryButton = new QPushButton( tr( "&Build Query" ) );
51+
buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
52+
connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
53+
mBuildQueryButton->setEnabled( false );
54+
5055
mAddButton = new QPushButton( tr( "&Add" ) );
5156
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
5257
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClicked() ) );
@@ -101,14 +106,14 @@ void QgsSpatiaLiteSourceSelect::on_cmbConnections_activated( int )
101106
dbChanged();
102107
}
103108

104-
void QgsSpatiaLiteSourceSelect::on_btnBuildQuery_clicked()
109+
void QgsSpatiaLiteSourceSelect::buildQuery()
105110
{
106111
setSql( mTablesTreeView->currentIndex() );
107112
}
108113

109114
void QgsSpatiaLiteSourceSelect::on_mTablesTreeView_clicked( const QModelIndex &index )
110115
{
111-
btnBuildQuery->setEnabled( index.parent().isValid() );
116+
mBuildQueryButton->setEnabled( index.parent().isValid() );
112117
}
113118

114119
void QgsSpatiaLiteSourceSelect::on_mTablesTreeView_doubleClicked( const QModelIndex &index )

‎src/app/spatialite/qgsspatialitesourceselect.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsDbSourceSelectBa
7676
* Once connected, available layers are displayed.
7777
*/
7878
void on_btnConnect_clicked();
79+
void buildQuery();
7980
void addClicked();
8081
//! Opens the create connection dialog to build a new connection
8182
void on_btnNew_clicked();
82-
void on_btnBuildQuery_clicked();
8383
//! Deletes the selected connection
8484
void on_btnDelete_clicked();
8585
void on_mSearchTableEdit_textChanged( const QString & text );
@@ -151,6 +151,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsDbSourceSelectBa
151151
QgsDbFilterProxyModel mProxyModel;
152152

153153
QString layerURI( const QModelIndex &index );
154+
QPushButton *mBuildQueryButton;
154155
QPushButton *mAddButton;
155156
};
156157

‎src/plugins/sqlanywhere/sasourceselect.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ SaSourceSelect::SaSourceSelect( QWidget *parent, Qt::WFlags fl )
5959
{
6060
setupUi( this );
6161

62+
mBuildQueryButton = new QPushButton( tr( "&Build Query" ) );
63+
buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
64+
connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
65+
mBuildQueryButton->setEnabled( false );
66+
6267
mAddButton = new QPushButton( tr( "&Add" ) );
6368
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
6469
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addTables() ) );
@@ -168,7 +173,7 @@ void SaSourceSelect::on_cmbConnections_activated( int )
168173
settings.setValue( "/SQLAnywhere/connections/selected", cmbConnections->currentText() );
169174
}
170175

171-
void SaSourceSelect::on_btnBuildQuery_clicked()
176+
void SaSourceSelect::buildQuery()
172177
{
173178
setSql( mTablesTreeView->currentIndex() );
174179
}

‎src/plugins/sqlanywhere/sasourceselect.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class SaSourceSelect : public QDialog, private Ui::SaSourceSelectBase
114114
public slots:
115115
//! Determines the tables the user selected and closes the dialog
116116
void addTables();
117+
void buildQuery();
117118

118119
/*! Connects to the database using the stored connection parameters.
119120
* Once connected, available layers are displayed.
@@ -123,7 +124,6 @@ class SaSourceSelect : public QDialog, private Ui::SaSourceSelectBase
123124
void on_btnNew_clicked();
124125
//! Opens a dialog to edit an existing connection
125126
void on_btnEdit_clicked();
126-
void on_btnBuildQuery_clicked();
127127
//! Deletes the selected connection
128128
void on_btnDelete_clicked();
129129
void on_mSearchTableEdit_textChanged( const QString & text );
@@ -183,6 +183,9 @@ class SaSourceSelect : public QDialog, private Ui::SaSourceSelectBase
183183
SaDbTableModel mTableModel;
184184
SaDbFilterProxyModel mProxyModel;
185185

186+
// button for building queries
187+
QPushButton *mBuildQueryButton;
188+
186189
// button for adding layers
187190
QPushButton *mAddButton;
188191
};

‎src/ui/qgsdbsourceselectbase.ui

-10
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@
8383
</property>
8484
</widget>
8585
</item>
86-
<item>
87-
<widget class="QPushButton" name="btnBuildQuery">
88-
<property name="enabled">
89-
<bool>false</bool>
90-
</property>
91-
<property name="text">
92-
<string>Build query</string>
93-
</property>
94-
</widget>
95-
</item>
9686
<item>
9787
<widget class="QGroupBox" name="mSearchGroupBox">
9888
<property name="title">

0 commit comments

Comments
 (0)
Please sign in to comment.