Skip to content

Commit a1563a3

Browse files
author
jef
committed
fix #2526
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13017 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 82764c6 commit a1563a3

File tree

3 files changed

+149
-53
lines changed

3 files changed

+149
-53
lines changed

src/app/postgres/qgspgsourceselect.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
5050
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
5151
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addTables() ) );
5252

53+
QPushButton *pb = new QPushButton( tr( "&Save" ) );
54+
pb->setToolTip( tr( "Save connections" ) );
55+
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
56+
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );
57+
58+
pb = new QPushButton( tr( "&Load" ) );
59+
pb->setToolTip( tr( "Load connections" ) );
60+
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
61+
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );
62+
5363
mAddButton->setEnabled( false );
5464
populateConnectionList();
5565

@@ -94,7 +104,7 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
94104
}
95105

96106
//hide the search options by default
97-
//they will be shown when the user ticks
107+
//they will be shown when the user ticks
98108
//the search options group box
99109
mSearchLabel->setVisible( false );
100110
mSearchColumnComboBox->setVisible( false );
@@ -139,13 +149,13 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
139149
populateConnectionList();
140150
}
141151

142-
void QgsPgSourceSelect::on_btnSave_clicked()
152+
void QgsPgSourceSelect::saveClicked()
143153
{
144154
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Save, QgsManageConnectionsDialog::PostGIS );
145155
dlg.exec();
146156
}
147157

148-
void QgsPgSourceSelect::on_btnLoad_clicked()
158+
void QgsPgSourceSelect::loadClicked()
149159
{
150160
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Load, QgsManageConnectionsDialog::PostGIS );
151161
dlg.exec();
@@ -840,7 +850,6 @@ void QgsGeomColumnTypeThread::getLayerTypes()
840850
// Now tell the layer list dialog box...
841851
emit setLayerType( schemas[i], tables[i], columns[i], type );
842852
}
843-
844853
}
845854

846855
PQfinish( pd );

src/app/postgres/qgspgsourceselect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
132132
//! Deletes the selected connection
133133
void on_btnDelete_clicked();
134134
//! Saves the selected connections to the file
135-
void on_btnSave_clicked();
135+
void saveClicked();
136136
//! Loads the selected connections from the file
137-
void on_btnLoad_clicked();
137+
void loadClicked();
138138
void on_mSearchTableEdit_textChanged( const QString & text );
139139
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
140140
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );

src/ui/qgspgsourceselectbase.ui

Lines changed: 134 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>406</width>
10-
<height>500</height>
9+
<width>362</width>
10+
<height>476</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -71,24 +71,6 @@
7171
</layout>
7272
</widget>
7373
</item>
74-
<item>
75-
<layout class="QHBoxLayout" name="horizontalLayout">
76-
<item>
77-
<widget class="QPushButton" name="btnSave">
78-
<property name="text">
79-
<string>Save connections</string>
80-
</property>
81-
</widget>
82-
</item>
83-
<item>
84-
<widget class="QPushButton" name="btnLoad">
85-
<property name="text">
86-
<string>Load connections</string>
87-
</property>
88-
</widget>
89-
</item>
90-
</layout>
91-
</item>
9274
<item>
9375
<widget class="QTreeView" name="mTablesTreeView">
9476
<property name="selectionMode">
@@ -107,29 +89,18 @@
10789
</widget>
10890
</item>
10991
<item>
110-
<spacer>
111-
<property name="orientation">
112-
<enum>Qt::Horizontal</enum>
92+
<widget class="QGroupBox" name="mSearchGroupBox">
93+
<property name="title">
94+
<string>Search options</string>
11395
</property>
114-
<property name="sizeHint" stdset="0">
115-
<size>
116-
<width>271</width>
117-
<height>20</height>
118-
</size>
96+
<property name="flat">
97+
<bool>true</bool>
11998
</property>
120-
</spacer>
121-
</item>
122-
<item>
123-
<widget class="QPushButton" name="mSearchOptionsButton">
124-
<property name="text">
125-
<string>Search options...</string>
99+
<property name="checkable">
100+
<bool>true</bool>
126101
</property>
127-
</widget>
128-
</item>
129-
<item>
130-
<widget class="QGroupBox" name="mSearchGroupBox">
131-
<property name="title">
132-
<string/>
102+
<property name="checked">
103+
<bool>false</bool>
133104
</property>
134105
<layout class="QGridLayout">
135106
<property name="margin">
@@ -140,6 +111,9 @@
140111
</property>
141112
<item row="0" column="0">
142113
<widget class="QLabel" name="mSearchLabel">
114+
<property name="enabled">
115+
<bool>true</bool>
116+
</property>
143117
<property name="text">
144118
<string>Search:</string>
145119
</property>
@@ -150,6 +124,9 @@
150124
</item>
151125
<item row="2" column="0" colspan="2">
152126
<widget class="QLabel" name="mSearchModeLabel">
127+
<property name="enabled">
128+
<bool>true</bool>
129+
</property>
153130
<property name="text">
154131
<string>Search mode:</string>
155132
</property>
@@ -159,10 +136,17 @@
159136
</widget>
160137
</item>
161138
<item row="2" column="2">
162-
<widget class="QComboBox" name="mSearchModeComboBox"/>
139+
<widget class="QComboBox" name="mSearchModeComboBox">
140+
<property name="enabled">
141+
<bool>true</bool>
142+
</property>
143+
</widget>
163144
</item>
164145
<item row="1" column="0" colspan="2">
165146
<widget class="QLabel" name="mSearchColumnsLabel">
147+
<property name="enabled">
148+
<bool>true</bool>
149+
</property>
166150
<property name="text">
167151
<string>Search in columns:</string>
168152
</property>
@@ -172,10 +156,18 @@
172156
</widget>
173157
</item>
174158
<item row="1" column="2">
175-
<widget class="QComboBox" name="mSearchColumnComboBox"/>
159+
<widget class="QComboBox" name="mSearchColumnComboBox">
160+
<property name="enabled">
161+
<bool>true</bool>
162+
</property>
163+
</widget>
176164
</item>
177165
<item row="0" column="1" colspan="2">
178-
<widget class="QLineEdit" name="mSearchTableEdit"/>
166+
<widget class="QLineEdit" name="mSearchTableEdit">
167+
<property name="enabled">
168+
<bool>true</bool>
169+
</property>
170+
</widget>
179171
</item>
180172
</layout>
181173
</widget>
@@ -198,7 +190,6 @@
198190
<tabstop>btnDelete</tabstop>
199191
<tabstop>mTablesTreeView</tabstop>
200192
<tabstop>btnBuildQuery</tabstop>
201-
<tabstop>mSearchOptionsButton</tabstop>
202193
<tabstop>mSearchTableEdit</tabstop>
203194
<tabstop>mSearchColumnComboBox</tabstop>
204195
<tabstop>mSearchModeComboBox</tabstop>
@@ -213,14 +204,110 @@
213204
<slot>reject()</slot>
214205
<hints>
215206
<hint type="sourcelabel">
216-
<x>353</x>
217-
<y>446</y>
207+
<x>352</x>
208+
<y>466</y>
218209
</hint>
219210
<hint type="destinationlabel">
220-
<x>404</x>
211+
<x>361</x>
221212
<y>421</y>
222213
</hint>
223214
</hints>
224215
</connection>
216+
<connection>
217+
<sender>mSearchGroupBox</sender>
218+
<signal>toggled(bool)</signal>
219+
<receiver>mSearchTableEdit</receiver>
220+
<slot>setVisible(bool)</slot>
221+
<hints>
222+
<hint type="sourcelabel">
223+
<x>85</x>
224+
<y>324</y>
225+
</hint>
226+
<hint type="destinationlabel">
227+
<x>177</x>
228+
<y>360</y>
229+
</hint>
230+
</hints>
231+
</connection>
232+
<connection>
233+
<sender>mSearchGroupBox</sender>
234+
<signal>toggled(bool)</signal>
235+
<receiver>mSearchColumnComboBox</receiver>
236+
<slot>setVisible(bool)</slot>
237+
<hints>
238+
<hint type="sourcelabel">
239+
<x>88</x>
240+
<y>325</y>
241+
</hint>
242+
<hint type="destinationlabel">
243+
<x>254</x>
244+
<y>381</y>
245+
</hint>
246+
</hints>
247+
</connection>
248+
<connection>
249+
<sender>mSearchGroupBox</sender>
250+
<signal>toggled(bool)</signal>
251+
<receiver>mSearchModeComboBox</receiver>
252+
<slot>setVisible(bool)</slot>
253+
<hints>
254+
<hint type="sourcelabel">
255+
<x>106</x>
256+
<y>333</y>
257+
</hint>
258+
<hint type="destinationlabel">
259+
<x>281</x>
260+
<y>410</y>
261+
</hint>
262+
</hints>
263+
</connection>
264+
<connection>
265+
<sender>mSearchGroupBox</sender>
266+
<signal>toggled(bool)</signal>
267+
<receiver>mSearchLabel</receiver>
268+
<slot>setVisible(bool)</slot>
269+
<hints>
270+
<hint type="sourcelabel">
271+
<x>124</x>
272+
<y>327</y>
273+
</hint>
274+
<hint type="destinationlabel">
275+
<x>58</x>
276+
<y>360</y>
277+
</hint>
278+
</hints>
279+
</connection>
280+
<connection>
281+
<sender>mSearchGroupBox</sender>
282+
<signal>toggled(bool)</signal>
283+
<receiver>mSearchColumnsLabel</receiver>
284+
<slot>setVisible(bool)</slot>
285+
<hints>
286+
<hint type="sourcelabel">
287+
<x>42</x>
288+
<y>327</y>
289+
</hint>
290+
<hint type="destinationlabel">
291+
<x>39</x>
292+
<y>379</y>
293+
</hint>
294+
</hints>
295+
</connection>
296+
<connection>
297+
<sender>mSearchGroupBox</sender>
298+
<signal>toggled(bool)</signal>
299+
<receiver>mSearchModeLabel</receiver>
300+
<slot>setVisible(bool)</slot>
301+
<hints>
302+
<hint type="sourcelabel">
303+
<x>73</x>
304+
<y>322</y>
305+
</hint>
306+
<hint type="destinationlabel">
307+
<x>68</x>
308+
<y>411</y>
309+
</hint>
310+
</hints>
311+
</connection>
225312
</connections>
226313
</ui>

0 commit comments

Comments
 (0)