Skip to content

Commit 42c6e25

Browse files
author
macho
committed
another few ui cleanups
git-svn-id: http://svn.osgeo.org/qgis/trunk@12029 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6ca251d commit 42c6e25

File tree

5 files changed

+326
-375
lines changed

5 files changed

+326
-375
lines changed

src/app/qgspgsourceselect.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
4343
: QDialog( parent, fl ), mColumnTypeThread( NULL ), pd( 0 )
4444
{
4545
setupUi( this );
46-
btnAdd->setEnabled( false );
46+
mAddButton = new QPushButton( tr( "&Add" ) );
47+
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
48+
connect( mAddButton,SIGNAL( clicked() ), this, SLOT( addClicked() ) );
49+
connect( buttonBox,SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );
50+
51+
mAddButton->setEnabled( false );
4752
populateConnectionList();
4853

4954
mSearchModeComboBox->addItem( tr( "Wildcard" ) );
@@ -92,7 +97,7 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
9297
deleteConnection();
9398
}
9499
// Slot for performing action when the Add button is clicked
95-
void QgsPgSourceSelect::on_btnAdd_clicked()
100+
void QgsPgSourceSelect::addClicked()
96101
{
97102
addTables();
98103
}
@@ -104,7 +109,7 @@ void QgsPgSourceSelect::on_btnEdit_clicked()
104109
}
105110

106111
// Slot for showing help
107-
void QgsPgSourceSelect::on_btnHelp_clicked()
112+
void QgsPgSourceSelect::helpClicked()
108113
{
109114
showHelp();
110115
}
@@ -466,7 +471,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
466471
}
467472
// BEGIN CHANGES ECOS
468473
if ( cmbConnections->count() > 0 )
469-
btnAdd->setEnabled( true );
474+
mAddButton->setEnabled( true );
470475
// END CHANGES ECOS
471476
}
472477
else

src/app/qgspgsourceselect.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgisgui.h"
2222
#include "qgsdbfilterproxymodel.h"
2323
#include "qgsdbtablemodel.h"
24+
#include <QPushButton>
2425

2526
extern "C"
2627
{
@@ -124,11 +125,14 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
124125
void dbChanged();
125126

126127
public slots:
128+
129+
void helpClicked();
130+
void addClicked();
131+
127132
/*! Connects to the database using the stored connection parameters.
128133
* Once connected, available layers are displayed.
129134
*/
130135
void on_btnConnect_clicked();
131-
void on_btnAdd_clicked();
132136
void on_btnNew_clicked();
133137
void on_btnEdit_clicked();
134138
void on_btnBuildQuery_clicked();
@@ -138,7 +142,6 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
138142
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
139143
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
140144
void setSql( const QModelIndex& index );
141-
void on_btnHelp_clicked();
142145
void on_cmbConnections_activated( int );
143146
void setLayerType( QString schema, QString table, QString column,
144147
QString type );
@@ -188,6 +191,7 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
188191
QgsDbFilterProxyModel mProxyModel;
189192

190193
QString layerURI( const QModelIndex &index );
194+
QPushButton * mAddButton;
191195
};
192196

193197

src/ui/qgspgsourceselectbase.ui

Lines changed: 64 additions & 121 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>672</width>
10-
<height>687</height>
9+
<width>406</width>
10+
<height>470</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -24,21 +24,8 @@
2424
<property name="modal">
2525
<bool>true</bool>
2626
</property>
27-
<layout class="QGridLayout">
28-
<property name="margin">
29-
<number>9</number>
30-
</property>
31-
<property name="spacing">
32-
<number>6</number>
33-
</property>
34-
<item row="1" column="0" colspan="6">
35-
<widget class="QTreeView" name="mTablesTreeView">
36-
<property name="selectionMode">
37-
<enum>QAbstractItemView::ExtendedSelection</enum>
38-
</property>
39-
</widget>
40-
</item>
41-
<item row="0" column="0" colspan="6">
27+
<layout class="QVBoxLayout" name="verticalLayout">
28+
<item>
4229
<widget class="QGroupBox" name="groupBox">
4330
<property name="title">
4431
<string>PostgreSQL Connections</string>
@@ -84,78 +71,44 @@
8471
</layout>
8572
</widget>
8673
</item>
87-
<item row="4" column="0" colspan="6">
88-
<layout class="QHBoxLayout">
89-
<property name="spacing">
90-
<number>6</number>
74+
<item>
75+
<widget class="QTreeView" name="mTablesTreeView">
76+
<property name="selectionMode">
77+
<enum>QAbstractItemView::ExtendedSelection</enum>
9178
</property>
92-
<property name="margin">
93-
<number>11</number>
79+
</widget>
80+
</item>
81+
<item>
82+
<widget class="QPushButton" name="btnBuildQuery">
83+
<property name="enabled">
84+
<bool>false</bool>
85+
</property>
86+
<property name="text">
87+
<string>Build query</string>
9488
</property>
95-
<item>
96-
<widget class="QPushButton" name="btnHelp">
97-
<property name="enabled">
98-
<bool>true</bool>
99-
</property>
100-
<property name="text">
101-
<string>Help</string>
102-
</property>
103-
<property name="shortcut">
104-
<string>F1</string>
105-
</property>
106-
<property name="autoDefault">
107-
<bool>true</bool>
108-
</property>
109-
</widget>
110-
</item>
111-
<item>
112-
<spacer>
113-
<property name="orientation">
114-
<enum>Qt::Horizontal</enum>
115-
</property>
116-
<property name="sizeType">
117-
<enum>QSizePolicy::Expanding</enum>
118-
</property>
119-
<property name="sizeHint" stdset="0">
120-
<size>
121-
<width>141</width>
122-
<height>21</height>
123-
</size>
124-
</property>
125-
</spacer>
126-
</item>
127-
<item>
128-
<widget class="QPushButton" name="btnAdd">
129-
<property name="text">
130-
<string>Add</string>
131-
</property>
132-
<property name="shortcut">
133-
<string/>
134-
</property>
135-
<property name="autoDefault">
136-
<bool>true</bool>
137-
</property>
138-
<property name="default">
139-
<bool>true</bool>
140-
</property>
141-
</widget>
142-
</item>
143-
<item>
144-
<widget class="QPushButton" name="btnCancel">
145-
<property name="text">
146-
<string>Close</string>
147-
</property>
148-
<property name="shortcut">
149-
<string/>
150-
</property>
151-
<property name="autoDefault">
152-
<bool>true</bool>
153-
</property>
154-
</widget>
155-
</item>
156-
</layout>
89+
</widget>
90+
</item>
91+
<item>
92+
<spacer>
93+
<property name="orientation">
94+
<enum>Qt::Horizontal</enum>
95+
</property>
96+
<property name="sizeHint" stdset="0">
97+
<size>
98+
<width>271</width>
99+
<height>20</height>
100+
</size>
101+
</property>
102+
</spacer>
157103
</item>
158-
<item row="3" column="0" colspan="6">
104+
<item>
105+
<widget class="QPushButton" name="mSearchOptionsButton">
106+
<property name="text">
107+
<string>Search options...</string>
108+
</property>
109+
</widget>
110+
</item>
111+
<item>
159112
<widget class="QGroupBox" name="mSearchGroupBox">
160113
<property name="title">
161114
<string/>
@@ -172,13 +125,19 @@
172125
<property name="text">
173126
<string>Search:</string>
174127
</property>
128+
<property name="buddy">
129+
<cstring>mSearchTableEdit</cstring>
130+
</property>
175131
</widget>
176132
</item>
177133
<item row="2" column="0" colspan="2">
178134
<widget class="QLabel" name="mSearchModeLabel">
179135
<property name="text">
180136
<string>Search mode:</string>
181137
</property>
138+
<property name="buddy">
139+
<cstring>mSearchModeComboBox</cstring>
140+
</property>
182141
</widget>
183142
</item>
184143
<item row="2" column="2">
@@ -189,6 +148,9 @@
189148
<property name="text">
190149
<string>Search in columns:</string>
191150
</property>
151+
<property name="buddy">
152+
<cstring>mSearchColumnComboBox</cstring>
153+
</property>
192154
</widget>
193155
</item>
194156
<item row="1" column="2">
@@ -200,36 +162,13 @@
200162
</layout>
201163
</widget>
202164
</item>
203-
<item row="2" column="4">
204-
<widget class="QPushButton" name="btnBuildQuery">
205-
<property name="enabled">
206-
<bool>false</bool>
207-
</property>
208-
<property name="text">
209-
<string>Build query</string>
210-
</property>
211-
</widget>
212-
</item>
213-
<item row="2" column="2">
214-
<widget class="QPushButton" name="mSearchOptionsButton">
215-
<property name="text">
216-
<string>Search options...</string>
165+
<item>
166+
<widget class="QDialogButtonBox" name="buttonBox">
167+
<property name="standardButtons">
168+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
217169
</property>
218170
</widget>
219171
</item>
220-
<item row="2" column="3">
221-
<spacer>
222-
<property name="orientation">
223-
<enum>Qt::Horizontal</enum>
224-
</property>
225-
<property name="sizeHint" stdset="0">
226-
<size>
227-
<width>271</width>
228-
<height>20</height>
229-
</size>
230-
</property>
231-
</spacer>
232-
</item>
233172
</layout>
234173
</widget>
235174
<layoutdefault spacing="6" margin="11"/>
@@ -239,25 +178,29 @@
239178
<tabstop>btnNew</tabstop>
240179
<tabstop>btnEdit</tabstop>
241180
<tabstop>btnDelete</tabstop>
242-
<tabstop>btnHelp</tabstop>
243-
<tabstop>btnAdd</tabstop>
244-
<tabstop>btnCancel</tabstop>
181+
<tabstop>mTablesTreeView</tabstop>
182+
<tabstop>btnBuildQuery</tabstop>
183+
<tabstop>mSearchOptionsButton</tabstop>
184+
<tabstop>mSearchTableEdit</tabstop>
185+
<tabstop>mSearchColumnComboBox</tabstop>
186+
<tabstop>mSearchModeComboBox</tabstop>
187+
<tabstop>buttonBox</tabstop>
245188
</tabstops>
246189
<resources/>
247190
<connections>
248191
<connection>
249-
<sender>btnCancel</sender>
250-
<signal>clicked()</signal>
192+
<sender>buttonBox</sender>
193+
<signal>rejected()</signal>
251194
<receiver>QgsPgSourceSelectBase</receiver>
252195
<slot>reject()</slot>
253196
<hints>
254197
<hint type="sourcelabel">
255-
<x>404</x>
198+
<x>353</x>
256199
<y>446</y>
257200
</hint>
258201
<hint type="destinationlabel">
259-
<x>229</x>
260-
<y>236</y>
202+
<x>404</x>
203+
<y>421</y>
261204
</hint>
262205
</hints>
263206
</connection>

0 commit comments

Comments
 (0)