Skip to content

Commit fe94d6b

Browse files
author
macho
committedNov 10, 2009
ui cleanup to buttonbox
git-svn-id: http://svn.osgeo.org/qgis/trunk@12079 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6b7ad07 commit fe94d6b

9 files changed

+269
-375
lines changed
 

‎src/app/qgsmapserverexport.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ email : sherman at mrcc.com
1919
#include "qgis.h"
2020
#include "qgsdatasourceuri.h"
2121
#include "qgshelpviewer.h"
22+
#include "qgscontexthelp.h"
2223
#include "qgsmapcanvas.h"
2324
#include "qgsmaplayer.h"
2425
#include "qgsrectangle.h"
@@ -37,6 +38,7 @@ QgsMapserverExport::QgsMapserverExport( QgsMapCanvas * _map, QWidget * parent, Q
3738
: QDialog( parent, fl ), map( _map )
3839
{
3940
setupUi( this );
41+
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( help() ) );
4042
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
4143
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
4244
// These values shouldn't be translated, the units should be in english in the map file
@@ -360,11 +362,12 @@ void QgsMapserverExport::on_btnChooseFile_clicked()
360362
txtMapFilePath->setText( s );
361363
}
362364

363-
void QgsMapserverExport::on_buttonHelp_clicked()
365+
void QgsMapserverExport::help()
364366
{
367+
QgsContextHelp::run( context_id );
365368
//QMessageBox::information(this, "Help","Help");
366-
QgsHelpViewer *hv = new QgsHelpViewer( this );
369+
//QgsHelpViewer *hv = new QgsHelpViewer( this );
367370
// causes problems in qt3.1.x: hv->setModal(false);
368-
hv->setCaption( "QGIS Help - Mapserver Export" );
369-
hv->show();
371+
//hv->setCaption( "QGIS Help - Mapserver Export" );
372+
//hv->show();
370373
}

‎src/app/qgsmapserverexport.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ class QgsMapserverExport: public QDialog, private Ui::QgsMapserverExportBase
5555
public slots:
5656
void on_chkExpLayersOnly_clicked();
5757
void on_btnChooseFile_clicked();
58-
void on_buttonHelp_clicked();
58+
void help();
59+
5960
private:
6061
void writeMapFile( void );
6162
QString fileName;
6263
QString fullPath;
6364
bool neverSaved;
6465
QgsMapCanvas *map;
6566
int action;
67+
static const int context_id = 0;
6668
};
6769

6870
#endif //QGSMAPSERVEREXPORT_H

‎src/app/qgsnewconnection.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ QgsNewConnection::QgsNewConnection( QWidget *parent, const QString& connName, Qt
3333
: QDialog( parent, fl ), mOriginalConnName( connName )
3434
{
3535
setupUi( this );
36-
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( help() ) );
36+
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( helpClicked() ) );
3737

3838
cbxSSLmode->insertItem( QgsDataSourceURI::SSLprefer, tr( "prefer" ) );
3939
cbxSSLmode->insertItem( QgsDataSourceURI::SSLrequire, tr( "require" ) );
@@ -84,9 +84,9 @@ void QgsNewConnection::accept()
8484
QDialog::accept();
8585
}
8686

87-
void QgsNewConnection::help()
87+
void QgsNewConnection::helpClicked()
8888
{
89-
helpInfo();
89+
QgsContextHelp::run( context_id );
9090
}
9191

9292
void QgsNewConnection::on_btnConnect_clicked()
@@ -151,11 +151,6 @@ void QgsNewConnection::saveConnection()
151151
settings.setValue( baseKey + "/sslmode", cbxSSLmode->currentIndex() );
152152
}
153153

154-
void QgsNewConnection::helpInfo()
155-
{
156-
QgsContextHelp::run( context_id );
157-
}
158-
159154
#if 0
160155
void QgsNewConnection::saveConnection()
161156
{

‎src/app/qgsnewconnection.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ class QgsNewConnection : public QDialog, private Ui::QgsNewConnectionBase
3535
void testConnection();
3636
//! Saves the connection to ~/.qt/qgisrc
3737
void saveConnection();
38-
//! Display the context help
39-
void helpInfo();
4038
public slots:
4139
void accept();
42-
void help();
40+
void helpClicked();
4341
void on_btnConnect_clicked();
4442
void on_cb_geometryColumnsOnly_clicked();
4543
private:

‎src/app/qgsspatialitesourceselect.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
3939
QDialog( app, fl ), qgisApp( app )
4040
{
4141
setupUi( this );
42-
btnAdd->setEnabled( false );
42+
mAddButton = new QPushButton( tr( "&Add" ) );
43+
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
44+
connect( mAddButton,SIGNAL( clicked() ), this, SLOT( addClicked() ) );
45+
connect( buttonBox,SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );
46+
47+
mAddButton->setEnabled( false );
4348
populateConnectionList();
4449

4550
mSearchModeComboBox->addItem( tr( "Wildcard" ) );
@@ -79,15 +84,15 @@ void QgsSpatiaLiteSourceSelect::on_btnDelete_clicked()
7984
}
8085

8186
// Slot for performing action when the Add button is clicked
82-
void QgsSpatiaLiteSourceSelect::on_btnAdd_clicked()
87+
void QgsSpatiaLiteSourceSelect::addClicked()
8388
{
8489
addTables();
8590
}
8691

8792
// Slot for showing help
88-
void QgsSpatiaLiteSourceSelect::on_btnHelp_clicked()
93+
void QgsSpatiaLiteSourceSelect::helpClicked()
8994
{
90-
showHelp();
95+
QgsContextHelp::run( context_id );
9196
}
9297

9398
/** End Autoconnected SLOTS **/
@@ -475,7 +480,7 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked()
475480

476481
// BEGIN CHANGES ECOS
477482
if ( cmbConnections->count() > 0 )
478-
btnAdd->setEnabled( true );
483+
mAddButton->setEnabled( true );
479484
// END CHANGES ECOS
480485

481486
mTablesTreeView->sortByColumn( 0, Qt::AscendingOrder );
@@ -553,11 +558,6 @@ bool QgsSpatiaLiteSourceSelect::getTableInfo( sqlite3 * handle )
553558
return false;
554559
}
555560

556-
void QgsSpatiaLiteSourceSelect::showHelp()
557-
{
558-
QgsContextHelp::run( context_id );
559-
}
560-
561561
QString QgsSpatiaLiteSourceSelect::fullDescription( QString table, QString column, QString type )
562562
{
563563
QString full_desc = "";

‎src/app/qgsspatialitesourceselect.h

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

2526
extern "C"
2627
{
@@ -80,14 +81,14 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
8081
* Once connected, available layers are displayed.
8182
*/
8283
void on_btnConnect_clicked();
83-
void on_btnAdd_clicked();
84+
void addClicked();
8485
void on_btnNew_clicked();
8586
void on_btnDelete_clicked();
8687
void on_mSearchOptionsButton_clicked();
8788
void on_mSearchTableEdit_textChanged( const QString & text );
8889
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
8990
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
90-
void on_btnHelp_clicked();
91+
void helpClicked();
9192
void on_cmbConnections_activated( int );
9293
void setLayerType( QString table, QString column, QString type );
9394
//!Sets a new regular expression to the model
@@ -115,8 +116,6 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
115116
// Set the position of the database connection list to the last
116117
// used one.
117118
void setConnectionListPosition();
118-
// Show the context help for the dialog
119-
void showHelp();
120119
// Combine the table and column data into a single string
121120
// useful for display to the user
122121
QString fullDescription( QString table, QString column, QString type );
@@ -132,6 +131,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
132131
//! Model that acts as datasource for mTableTreeWidget
133132
QgsSpatiaLiteTableModel mTableModel;
134133
QgsSpatiaLiteFilterProxyModel mProxyModel;
134+
QPushButton * mAddButton;
135135
};
136136

137137
#endif // QGSSPATIALITESOURCESELECT_H

‎src/ui/qgsmapserverexportbase.ui

Lines changed: 147 additions & 183 deletions
Large diffs are not rendered by default.

‎src/ui/qgsmessageviewer.ui

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
<property name="spacing">
2424
<number>6</number>
2525
</property>
26-
<item row="1" column="0">
27-
<widget class="QCheckBox" name="checkBox">
28-
<property name="text">
29-
<string>Don't show this message again</string>
30-
</property>
31-
</widget>
32-
</item>
3326
<item row="0" column="0" colspan="3">
3427
<widget class="QTextEdit" name="txtMessage">
3528
<property name="lineWidth">
@@ -50,28 +43,18 @@
5043
</property>
5144
</widget>
5245
</item>
53-
<item row="2" column="0">
54-
<spacer>
55-
<property name="orientation">
56-
<enum>Qt::Horizontal</enum>
57-
</property>
58-
<property name="sizeType">
59-
<enum>QSizePolicy::Expanding</enum>
60-
</property>
61-
<property name="sizeHint" stdset="0">
62-
<size>
63-
<width>191</width>
64-
<height>31</height>
65-
</size>
46+
<item row="1" column="1">
47+
<widget class="QCheckBox" name="checkBox">
48+
<property name="text">
49+
<string>Don't show this message again</string>
6650
</property>
67-
</spacer>
51+
</widget>
6852
</item>
6953
</layout>
7054
</widget>
7155
<layoutdefault spacing="6" margin="11"/>
7256
<tabstops>
7357
<tabstop>txtMessage</tabstop>
74-
<tabstop>checkBox</tabstop>
7558
</tabstops>
7659
<resources/>
7760
<connections>

‎src/ui/qgsspatialitesourceselectbase.ui

Lines changed: 89 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,244 +1,193 @@
1-
<ui version="4.0" >
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
23
<class>QgsSpatiaLiteSourceSelectBase</class>
3-
<widget class="QDialog" name="QgsSpatiaLiteSourceSelectBase" >
4-
<property name="geometry" >
4+
<widget class="QDialog" name="QgsSpatiaLiteSourceSelectBase">
5+
<property name="geometry">
56
<rect>
67
<x>0</x>
78
<y>0</y>
89
<width>472</width>
910
<height>687</height>
1011
</rect>
1112
</property>
12-
<property name="windowTitle" >
13+
<property name="windowTitle">
1314
<string>Add SpatiaLite Table(s)</string>
1415
</property>
15-
<property name="windowIcon" >
16+
<property name="windowIcon">
1617
<iconset>
1718
<normaloff/>
1819
</iconset>
1920
</property>
20-
<property name="sizeGripEnabled" >
21+
<property name="sizeGripEnabled">
2122
<bool>true</bool>
2223
</property>
23-
<property name="modal" >
24+
<property name="modal">
2425
<bool>true</bool>
2526
</property>
26-
<layout class="QGridLayout" >
27-
<property name="margin" >
27+
<layout class="QGridLayout">
28+
<property name="margin">
2829
<number>9</number>
2930
</property>
30-
<property name="spacing" >
31+
<property name="spacing">
3132
<number>6</number>
3233
</property>
33-
<item row="2" column="0" >
34+
<item row="2" column="0">
3435
<spacer>
35-
<property name="orientation" >
36+
<property name="orientation">
3637
<enum>Qt::Horizontal</enum>
3738
</property>
38-
<property name="sizeHint" >
39+
<property name="sizeHint" stdset="0">
3940
<size>
4041
<width>271</width>
4142
<height>20</height>
4243
</size>
4344
</property>
4445
</spacer>
4546
</item>
46-
<item row="1" column="0" colspan="2" >
47-
<widget class="QTreeView" name="mTablesTreeView" >
48-
<property name="selectionMode" >
47+
<item row="1" column="0" colspan="2">
48+
<widget class="QTreeView" name="mTablesTreeView">
49+
<property name="selectionMode">
4950
<enum>QAbstractItemView::MultiSelection</enum>
5051
</property>
5152
</widget>
5253
</item>
53-
<item row="0" column="0" colspan="2" >
54-
<widget class="QGroupBox" name="groupBox" >
55-
<property name="title" >
54+
<item row="0" column="0" colspan="2">
55+
<widget class="QGroupBox" name="groupBox">
56+
<property name="title">
5657
<string>SpatiaLite DBs</string>
5758
</property>
58-
<layout class="QGridLayout" >
59-
<property name="margin" >
59+
<layout class="QGridLayout">
60+
<property name="margin">
6061
<number>11</number>
6162
</property>
62-
<property name="spacing" >
63+
<property name="spacing">
6364
<number>6</number>
6465
</property>
65-
<item row="1" column="2" >
66-
<widget class="QPushButton" name="btnDelete" >
67-
<property name="text" >
66+
<item row="1" column="2">
67+
<widget class="QPushButton" name="btnDelete">
68+
<property name="text">
6869
<string>Delete</string>
6970
</property>
7071
</widget>
7172
</item>
72-
<item row="1" column="1" >
73-
<widget class="QPushButton" name="btnNew" >
74-
<property name="text" >
73+
<item row="1" column="1">
74+
<widget class="QPushButton" name="btnNew">
75+
<property name="text">
7576
<string>New</string>
7677
</property>
7778
</widget>
7879
</item>
79-
<item row="1" column="0" >
80-
<widget class="QPushButton" name="btnConnect" >
81-
<property name="text" >
80+
<item row="1" column="0">
81+
<widget class="QPushButton" name="btnConnect">
82+
<property name="text">
8283
<string>Connect</string>
8384
</property>
8485
</widget>
8586
</item>
86-
<item row="0" column="0" colspan="3" >
87-
<widget class="QComboBox" name="cmbConnections" />
87+
<item row="0" column="0" colspan="3">
88+
<widget class="QComboBox" name="cmbConnections"/>
8889
</item>
8990
</layout>
9091
</widget>
9192
</item>
92-
<item row="4" column="0" colspan="2" >
93-
<layout class="QHBoxLayout" >
94-
<property name="margin" >
95-
<number>11</number>
96-
</property>
97-
<property name="spacing" >
98-
<number>6</number>
99-
</property>
100-
<item>
101-
<widget class="QPushButton" name="btnHelp" >
102-
<property name="enabled" >
103-
<bool>true</bool>
104-
</property>
105-
<property name="text" >
106-
<string>Help</string>
107-
</property>
108-
<property name="shortcut" >
109-
<string>F1</string>
110-
</property>
111-
<property name="autoDefault" >
112-
<bool>true</bool>
113-
</property>
114-
</widget>
115-
</item>
116-
<item>
117-
<spacer>
118-
<property name="orientation" >
119-
<enum>Qt::Horizontal</enum>
120-
</property>
121-
<property name="sizeType" >
122-
<enum>QSizePolicy::Expanding</enum>
123-
</property>
124-
<property name="sizeHint" >
125-
<size>
126-
<width>141</width>
127-
<height>21</height>
128-
</size>
129-
</property>
130-
</spacer>
131-
</item>
132-
<item>
133-
<widget class="QPushButton" name="btnAdd" >
134-
<property name="text" >
135-
<string>Add</string>
136-
</property>
137-
<property name="shortcut" >
138-
<string/>
139-
</property>
140-
<property name="autoDefault" >
141-
<bool>true</bool>
142-
</property>
143-
<property name="default" >
144-
<bool>true</bool>
145-
</property>
146-
</widget>
147-
</item>
148-
<item>
149-
<widget class="QPushButton" name="btnCancel" >
150-
<property name="text" >
151-
<string>Close</string>
152-
</property>
153-
<property name="shortcut" >
154-
<string/>
155-
</property>
156-
<property name="autoDefault" >
157-
<bool>true</bool>
158-
</property>
159-
</widget>
160-
</item>
161-
</layout>
162-
</item>
163-
<item row="3" column="0" colspan="2" >
164-
<widget class="QGroupBox" name="mSearchGroupBox" >
165-
<property name="title" >
93+
<item row="3" column="0" colspan="2">
94+
<widget class="QGroupBox" name="mSearchGroupBox">
95+
<property name="title">
16696
<string/>
16797
</property>
168-
<layout class="QGridLayout" >
169-
<property name="margin" >
98+
<layout class="QGridLayout">
99+
<property name="margin">
170100
<number>9</number>
171101
</property>
172-
<property name="spacing" >
102+
<property name="spacing">
173103
<number>6</number>
174104
</property>
175-
<item row="0" column="0" >
176-
<widget class="QLabel" name="mSearchLabel" >
177-
<property name="text" >
105+
<item row="0" column="0">
106+
<widget class="QLabel" name="mSearchLabel">
107+
<property name="text">
178108
<string>Search:</string>
179109
</property>
110+
<property name="buddy">
111+
<cstring>mSearchTableEdit</cstring>
112+
</property>
180113
</widget>
181114
</item>
182-
<item row="2" column="0" colspan="2" >
183-
<widget class="QLabel" name="mSearchModeLabel" >
184-
<property name="text" >
115+
<item row="2" column="0" colspan="2">
116+
<widget class="QLabel" name="mSearchModeLabel">
117+
<property name="text">
185118
<string>Search mode:</string>
186119
</property>
120+
<property name="buddy">
121+
<cstring>mSearchModeComboBox</cstring>
122+
</property>
187123
</widget>
188124
</item>
189-
<item row="2" column="2" >
190-
<widget class="QComboBox" name="mSearchModeComboBox" />
125+
<item row="2" column="2">
126+
<widget class="QComboBox" name="mSearchModeComboBox"/>
191127
</item>
192-
<item row="1" column="0" colspan="2" >
193-
<widget class="QLabel" name="mSearchColumnsLabel" >
194-
<property name="text" >
128+
<item row="1" column="0" colspan="2">
129+
<widget class="QLabel" name="mSearchColumnsLabel">
130+
<property name="text">
195131
<string>Search in columns:</string>
196132
</property>
133+
<property name="buddy">
134+
<cstring>mSearchColumnComboBox</cstring>
135+
</property>
197136
</widget>
198137
</item>
199-
<item row="1" column="2" >
200-
<widget class="QComboBox" name="mSearchColumnComboBox" />
138+
<item row="1" column="2">
139+
<widget class="QComboBox" name="mSearchColumnComboBox"/>
201140
</item>
202-
<item row="0" column="1" colspan="2" >
203-
<widget class="QLineEdit" name="mSearchTableEdit" />
141+
<item row="0" column="1" colspan="2">
142+
<widget class="QLineEdit" name="mSearchTableEdit"/>
204143
</item>
205144
</layout>
206145
</widget>
207146
</item>
208-
<item row="2" column="1" >
209-
<widget class="QPushButton" name="mSearchOptionsButton" >
210-
<property name="text" >
147+
<item row="2" column="1">
148+
<widget class="QPushButton" name="mSearchOptionsButton">
149+
<property name="text">
211150
<string>Search options...</string>
212151
</property>
213152
</widget>
214153
</item>
154+
<item row="4" column="0" colspan="2">
155+
<widget class="QDialogButtonBox" name="buttonBox">
156+
<property name="standardButtons">
157+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
158+
</property>
159+
</widget>
160+
</item>
215161
</layout>
216162
</widget>
217-
<layoutdefault spacing="6" margin="11" />
163+
<layoutdefault spacing="6" margin="11"/>
218164
<tabstops>
219165
<tabstop>cmbConnections</tabstop>
220166
<tabstop>btnConnect</tabstop>
221167
<tabstop>btnNew</tabstop>
222168
<tabstop>btnDelete</tabstop>
223-
<tabstop>btnHelp</tabstop>
224-
<tabstop>btnAdd</tabstop>
225-
<tabstop>btnCancel</tabstop>
169+
<tabstop>mTablesTreeView</tabstop>
170+
<tabstop>mSearchOptionsButton</tabstop>
171+
<tabstop>mSearchTableEdit</tabstop>
172+
<tabstop>mSearchColumnComboBox</tabstop>
173+
<tabstop>mSearchModeComboBox</tabstop>
174+
<tabstop>buttonBox</tabstop>
226175
</tabstops>
227176
<resources/>
228177
<connections>
229178
<connection>
230-
<sender>btnCancel</sender>
231-
<signal>clicked()</signal>
179+
<sender>buttonBox</sender>
180+
<signal>rejected()</signal>
232181
<receiver>QgsSpatiaLiteSourceSelectBase</receiver>
233182
<slot>reject()</slot>
234183
<hints>
235-
<hint type="sourcelabel" >
236-
<x>404</x>
237-
<y>446</y>
184+
<hint type="sourcelabel">
185+
<x>431</x>
186+
<y>666</y>
238187
</hint>
239-
<hint type="destinationlabel" >
240-
<x>229</x>
241-
<y>236</y>
188+
<hint type="destinationlabel">
189+
<x>465</x>
190+
<y>527</y>
242191
</hint>
243192
</hints>
244193
</connection>

0 commit comments

Comments
 (0)
Please sign in to comment.