Skip to content

Commit 9039bc7

Browse files
author
macho
committedNov 8, 2009
another few ui cleanups
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12029 c8812cc2-4d05-0410-92ff-de0c093fc19c

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>

‎src/ui/qgsprojectionselectorbase.ui

Lines changed: 71 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,188 +1,176 @@
1-
<ui version="4.0" >
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
23
<class>QgsProjectionSelectorBase</class>
3-
<widget class="QWidget" name="QgsProjectionSelectorBase" >
4-
<property name="geometry" >
4+
<widget class="QWidget" name="QgsProjectionSelectorBase">
5+
<property name="geometry">
56
<rect>
67
<x>0</x>
78
<y>0</y>
8-
<width>466</width>
9-
<height>416</height>
9+
<width>428</width>
10+
<height>313</height>
1011
</rect>
1112
</property>
12-
<property name="sizePolicy" >
13-
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
13+
<property name="sizePolicy">
14+
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
1415
<horstretch>0</horstretch>
1516
<verstretch>0</verstretch>
1617
</sizepolicy>
1718
</property>
18-
<property name="windowTitle" >
19+
<property name="windowTitle">
1920
<string>Coordinate Reference System Selector</string>
2021
</property>
21-
<property name="windowIcon" >
22+
<property name="windowIcon">
2223
<iconset>
2324
<normaloff/>
2425
</iconset>
2526
</property>
26-
<layout class="QGridLayout" >
27-
<property name="leftMargin" >
27+
<layout class="QGridLayout">
28+
<property name="verticalSpacing">
2829
<number>3</number>
2930
</property>
30-
<property name="topMargin" >
31+
<property name="margin">
3132
<number>3</number>
3233
</property>
33-
<property name="rightMargin" >
34-
<number>3</number>
35-
</property>
36-
<property name="bottomMargin" >
37-
<number>3</number>
38-
</property>
39-
<property name="verticalSpacing" >
40-
<number>3</number>
41-
</property>
42-
<item row="0" column="0" >
43-
<widget class="QTreeWidget" name="lstCoordinateSystems" >
44-
<property name="alternatingRowColors" >
34+
<item row="0" column="0">
35+
<widget class="QTreeWidget" name="lstCoordinateSystems">
36+
<property name="alternatingRowColors">
4537
<bool>true</bool>
4638
</property>
47-
<property name="uniformRowHeights" >
39+
<property name="uniformRowHeights">
4840
<bool>true</bool>
4941
</property>
50-
<property name="columnCount" >
42+
<property name="columnCount">
5143
<number>3</number>
5244
</property>
5345
<column>
54-
<property name="text" >
46+
<property name="text">
5547
<string>Coordinate Reference System</string>
5648
</property>
5749
</column>
5850
<column>
59-
<property name="text" >
51+
<property name="text">
6052
<string>EPSG</string>
6153
</property>
6254
</column>
6355
<column>
64-
<property name="text" >
56+
<property name="text">
6557
<string>ID</string>
6658
</property>
6759
</column>
6860
</widget>
6961
</item>
70-
<item row="1" column="0" >
71-
<widget class="QTextEdit" name="teProjection" >
72-
<property name="sizePolicy" >
73-
<sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
62+
<item row="1" column="0">
63+
<widget class="QTextEdit" name="teProjection">
64+
<property name="sizePolicy">
65+
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
7466
<horstretch>0</horstretch>
7567
<verstretch>0</verstretch>
7668
</sizepolicy>
7769
</property>
78-
<property name="minimumSize" >
70+
<property name="minimumSize">
7971
<size>
8072
<width>0</width>
8173
<height>30</height>
8274
</size>
8375
</property>
84-
<property name="maximumSize" >
76+
<property name="maximumSize">
8577
<size>
8678
<width>16777215</width>
8779
<height>50</height>
8880
</size>
8981
</property>
90-
<property name="baseSize" >
82+
<property name="baseSize">
9183
<size>
9284
<width>0</width>
9385
<height>50</height>
9486
</size>
9587
</property>
96-
<property name="autoFormatting" >
88+
<property name="autoFormatting">
9789
<set>QTextEdit::AutoBulletList</set>
9890
</property>
99-
<property name="readOnly" >
91+
<property name="readOnly">
10092
<bool>true</bool>
10193
</property>
10294
</widget>
10395
</item>
104-
<item row="2" column="0" >
105-
<widget class="QGroupBox" name="groupBox" >
106-
<property name="sizePolicy" >
107-
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
96+
<item row="2" column="0">
97+
<widget class="QGroupBox" name="groupBox">
98+
<property name="sizePolicy">
99+
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
108100
<horstretch>0</horstretch>
109101
<verstretch>0</verstretch>
110102
</sizepolicy>
111103
</property>
112-
<property name="title" >
104+
<property name="title">
113105
<string>Search</string>
114106
</property>
115-
<layout class="QGridLayout" >
116-
<item row="0" column="0" >
117-
<widget class="QRadioButton" name="radEpsgCrsId" >
118-
<property name="text" >
107+
<layout class="QGridLayout">
108+
<item row="0" column="0">
109+
<widget class="QRadioButton" name="radEpsgCrsId">
110+
<property name="text">
119111
<string>EPSG ID</string>
120112
</property>
121-
<property name="iconSize" >
113+
<property name="iconSize">
122114
<size>
123115
<width>16</width>
124116
<height>10</height>
125117
</size>
126118
</property>
127-
<property name="checked" >
119+
<property name="checked">
128120
<bool>true</bool>
129121
</property>
130122
</widget>
131123
</item>
132-
<item row="0" column="1" >
133-
<widget class="QRadioButton" name="radName" >
134-
<property name="text" >
124+
<item row="0" column="1">
125+
<widget class="QRadioButton" name="radName">
126+
<property name="text">
135127
<string>Name</string>
136128
</property>
137-
<property name="iconSize" >
129+
<property name="iconSize">
138130
<size>
139131
<width>16</width>
140132
<height>10</height>
141133
</size>
142134
</property>
143135
</widget>
144136
</item>
145-
<item row="0" column="2" >
146-
<widget class="QLineEdit" name="leSearch" />
137+
<item row="0" column="2">
138+
<widget class="QLineEdit" name="leSearch"/>
147139
</item>
148-
<item row="0" column="3" >
149-
<widget class="QPushButton" name="pbnFind" >
150-
<property name="maximumSize" >
140+
<item row="0" column="3">
141+
<widget class="QPushButton" name="pbnFind">
142+
<property name="maximumSize">
151143
<size>
152144
<width>100</width>
153145
<height>16777215</height>
154146
</size>
155147
</property>
156-
<property name="text" >
148+
<property name="text">
157149
<string>Find</string>
158150
</property>
159-
<property name="default" >
151+
<property name="default">
160152
<bool>true</bool>
161153
</property>
162154
</widget>
163155
</item>
164156
</layout>
165157
</widget>
166158
</item>
167-
<item row="3" column="0" >
168-
<widget class="QPushButton" name="pbnPopular1">
169-
</widget>
170-
</item>
171-
<item row="4" column="0" >
172-
<widget class="QPushButton" name="pbnPopular2">
173-
</widget>
174-
</item>
175-
<item row="5" column="0" >
176-
<widget class="QPushButton" name="pbnPopular3">
177-
</widget>
178-
</item>
179-
<item row="6" column="0" >
180-
<widget class="QPushButton" name="pbnPopular4">
181-
</widget>
182-
</item>
159+
<item row="3" column="0">
160+
<widget class="QPushButton" name="pbnPopular1"/>
161+
</item>
162+
<item row="4" column="0">
163+
<widget class="QPushButton" name="pbnPopular2"/>
164+
</item>
165+
<item row="5" column="0">
166+
<widget class="QPushButton" name="pbnPopular3"/>
167+
</item>
168+
<item row="6" column="0">
169+
<widget class="QPushButton" name="pbnPopular4"/>
170+
</item>
183171
</layout>
184172
</widget>
185-
<layoutdefault spacing="6" margin="11" />
173+
<layoutdefault spacing="6" margin="11"/>
186174
<resources/>
187175
<connections>
188176
<connection>
@@ -191,13 +179,13 @@
191179
<receiver>pbnFind</receiver>
192180
<slot>click()</slot>
193181
<hints>
194-
<hint type="sourcelabel" >
195-
<x>292</x>
196-
<y>380</y>
182+
<hint type="sourcelabel">
183+
<x>362</x>
184+
<y>276</y>
197185
</hint>
198-
<hint type="destinationlabel" >
199-
<x>375</x>
200-
<y>373</y>
186+
<hint type="destinationlabel">
187+
<x>453</x>
188+
<y>277</y>
201189
</hint>
202190
</hints>
203191
</connection>

‎src/ui/qgsprojectpropertiesbase.ui

Lines changed: 176 additions & 165 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.