Skip to content

Commit 467d684

Browse files
author
jef
committedMar 14, 2011
fix #3617
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15482 c8812cc2-4d05-0410-92ff-de0c093fc19c

10 files changed

+174
-142
lines changed
 

‎src/app/postgres/qgspgsourceselect.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,6 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
6161
connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
6262
mBuildQueryButton->setDisabled( true );
6363

64-
QPushButton *pb;
65-
pb = new QPushButton( tr( "&Save" ) );
66-
pb->setToolTip( tr( "Save connections" ) );
67-
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
68-
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );
69-
70-
pb = new QPushButton( tr( "&Load" ) );
71-
pb->setToolTip( tr( "Load connections" ) );
72-
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
73-
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );
74-
7564
mAddButton->setEnabled( false );
7665
populateConnectionList();
7766

@@ -166,13 +155,13 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
166155
populateConnectionList();
167156
}
168157

169-
void QgsPgSourceSelect::saveClicked()
158+
void QgsPgSourceSelect::on_btnSave_clicked()
170159
{
171160
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::PostGIS );
172161
dlg.exec();
173162
}
174163

175-
void QgsPgSourceSelect::loadClicked()
164+
void QgsPgSourceSelect::on_btnLoad_clicked()
176165
{
177166
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), ".",
178167
tr( "XML files (*.xml *XML)" ) );

‎src/app/postgres/qgspgsourceselect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
133133
//! Deletes the selected connection
134134
void on_btnDelete_clicked();
135135
//! Saves the selected connections to file
136-
void saveClicked();
136+
void on_btnSave_clicked();
137137
//! Loads the selected connections from file
138-
void loadClicked();
138+
void on_btnLoad_clicked();
139139
void on_mSearchTableEdit_textChanged( const QString & text );
140140
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
141141
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );

‎src/app/qgswmssourceselect.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,6 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl )
6262
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
6363
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClicked() ) );
6464

65-
QPushButton *pb = new QPushButton( tr( "&Save" ) );
66-
pb->setToolTip( tr( "Save WMS server connections to file" ) );
67-
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
68-
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );
69-
70-
pb = new QPushButton( tr( "&Load" ) );
71-
pb->setToolTip( tr( "Load WMS server connections from file" ) );
72-
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
73-
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );
74-
7565
mLayerUpButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowUp.png" ) );
7666
mLayerDownButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowDown.png" ) );
7767

@@ -244,13 +234,13 @@ void QgsWMSSourceSelect::on_btnDelete_clicked()
244234
}
245235
}
246236

247-
void QgsWMSSourceSelect::saveClicked()
237+
void QgsWMSSourceSelect::on_btnSave_clicked()
248238
{
249239
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::WMS );
250240
dlg.exec();
251241
}
252242

253-
void QgsWMSSourceSelect::loadClicked()
243+
void QgsWMSSourceSelect::on_btnLoad_clicked()
254244
{
255245
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), ".",
256246
tr( "XML files (*.xml *XML)" ) );

‎src/app/qgswmssourceselect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class QgsWMSSourceSelect : public QDialog, private Ui::QgsWMSSourceSelectBase
6060
//! Deletes the selected connection
6161
void on_btnDelete_clicked();
6262
//! Saves connections to the file
63-
void saveClicked();
63+
void on_btnSave_clicked();
6464
//! Loads connections from the file
65-
void loadClicked();
65+
void on_btnLoad_clicked();
6666

6767
/*! Connects to the database using the stored connection parameters.
6868
* Once connected, available layers are displayed.

‎src/app/spatialite/qgsspatialitesourceselect.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
4646
setWindowTitle( tr( "Add SpatiaLite Table(s)" ) );
4747
connectionsGroupBox->setTitle( tr( "Databases" ) );
4848
btnEdit->hide(); // hide the edit button
49+
btnSave->hide();
50+
btnLoad->hide();
4951

5052
mAddButton = new QPushButton( tr( "&Add" ) );
5153
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );

‎src/plugins/wfs/qgswfssourceselect.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, QgisInterface* iface )
4646
btnAdd = buttonBox->button( QDialogButtonBox::Ok );
4747
btnAdd->setEnabled( false );
4848

49-
QPushButton *pb = new QPushButton( tr( "&Save" ) );
50-
pb->setToolTip( tr( "Save WFS server connections to file" ) );
51-
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
52-
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );
53-
54-
pb = new QPushButton( tr( "&Load" ) );
55-
pb->setToolTip( tr( "Load WFS server connections from file" ) );
56-
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
57-
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );
58-
5949
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( addLayer() ) );
6050
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
6151
connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );
@@ -469,13 +459,13 @@ void QgsWFSSourceSelect::on_cmbConnections_activated( int index )
469459
s.setValue( "/Qgis/connections-wfs/selected", cmbConnections->currentText() );
470460
}
471461

472-
void QgsWFSSourceSelect::saveClicked()
462+
void QgsWFSSourceSelect::on_btnSave_clicked()
473463
{
474464
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::WFS );
475465
dlg.exec();
476466
}
477467

478-
void QgsWFSSourceSelect::loadClicked()
468+
void QgsWFSSourceSelect::on_btnLoad_clicked()
479469
{
480470
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), ".",
481471
tr( "XML files (*.xml *XML)" ) );

‎src/plugins/wfs/qgswfssourceselect.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
6666
void on_cmbConnections_activated( int index );
6767
void capabilitiesReplyFinished();
6868
void capabilitiesReplyProgress( qint64, qint64 );
69-
70-
void saveClicked();
71-
void loadClicked();
69+
void on_btnSave_clicked();
70+
void on_btnLoad_clicked();
7271

7372
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
7473
};

‎src/plugins/wfs/qgswfssourceselectbase.ui

Lines changed: 79 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>577</width>
9+
<width>590</width>
1010
<height>503</height>
1111
</rect>
1212
</property>
@@ -19,68 +19,86 @@
1919
<property name="title">
2020
<string>Server connections</string>
2121
</property>
22-
<layout class="QGridLayout">
23-
<property name="margin">
24-
<number>9</number>
25-
</property>
26-
<property name="spacing">
27-
<number>6</number>
28-
</property>
29-
<item row="1" column="1">
30-
<widget class="QPushButton" name="btnNew">
31-
<property name="text">
32-
<string>&amp;New</string>
33-
</property>
34-
</widget>
35-
</item>
36-
<item row="1" column="3">
37-
<widget class="QPushButton" name="btnDelete">
38-
<property name="enabled">
39-
<bool>false</bool>
40-
</property>
41-
<property name="text">
42-
<string>Delete</string>
43-
</property>
44-
</widget>
45-
</item>
46-
<item row="1" column="2">
47-
<widget class="QPushButton" name="btnEdit">
48-
<property name="enabled">
49-
<bool>false</bool>
50-
</property>
51-
<property name="text">
52-
<string>Edit</string>
53-
</property>
54-
</widget>
55-
</item>
56-
<item row="1" column="4">
57-
<spacer>
58-
<property name="orientation">
59-
<enum>Qt::Horizontal</enum>
60-
</property>
61-
<property name="sizeType">
62-
<enum>QSizePolicy::Expanding</enum>
63-
</property>
64-
<property name="sizeHint" stdset="0">
65-
<size>
66-
<width>171</width>
67-
<height>30</height>
68-
</size>
69-
</property>
70-
</spacer>
22+
<layout class="QGridLayout" name="gridLayout_2">
23+
<item row="0" column="0">
24+
<widget class="QComboBox" name="cmbConnections"/>
7125
</item>
7226
<item row="1" column="0">
73-
<widget class="QPushButton" name="btnConnect">
74-
<property name="enabled">
75-
<bool>false</bool>
76-
</property>
77-
<property name="text">
78-
<string>C&amp;onnect</string>
79-
</property>
80-
</widget>
81-
</item>
82-
<item row="0" column="0" colspan="5">
83-
<widget class="QComboBox" name="cmbConnections"/>
27+
<layout class="QHBoxLayout" name="horizontalLayout">
28+
<item>
29+
<widget class="QPushButton" name="btnConnect">
30+
<property name="enabled">
31+
<bool>false</bool>
32+
</property>
33+
<property name="text">
34+
<string>C&amp;onnect</string>
35+
</property>
36+
</widget>
37+
</item>
38+
<item>
39+
<widget class="QPushButton" name="btnNew">
40+
<property name="text">
41+
<string>&amp;New</string>
42+
</property>
43+
</widget>
44+
</item>
45+
<item>
46+
<widget class="QPushButton" name="btnEdit">
47+
<property name="enabled">
48+
<bool>false</bool>
49+
</property>
50+
<property name="text">
51+
<string>Edit</string>
52+
</property>
53+
</widget>
54+
</item>
55+
<item>
56+
<widget class="QPushButton" name="btnDelete">
57+
<property name="enabled">
58+
<bool>false</bool>
59+
</property>
60+
<property name="text">
61+
<string>Delete</string>
62+
</property>
63+
</widget>
64+
</item>
65+
<item>
66+
<spacer>
67+
<property name="orientation">
68+
<enum>Qt::Horizontal</enum>
69+
</property>
70+
<property name="sizeType">
71+
<enum>QSizePolicy::Expanding</enum>
72+
</property>
73+
<property name="sizeHint" stdset="0">
74+
<size>
75+
<width>171</width>
76+
<height>30</height>
77+
</size>
78+
</property>
79+
</spacer>
80+
</item>
81+
<item>
82+
<widget class="QPushButton" name="btnLoad">
83+
<property name="toolTip">
84+
<string>Load connections from file</string>
85+
</property>
86+
<property name="text">
87+
<string>Load</string>
88+
</property>
89+
</widget>
90+
</item>
91+
<item>
92+
<widget class="QPushButton" name="btnSave">
93+
<property name="toolTip">
94+
<string>Save connections to file</string>
95+
</property>
96+
<property name="text">
97+
<string>Save</string>
98+
</property>
99+
</widget>
100+
</item>
101+
</layout>
84102
</item>
85103
</layout>
86104
</widget>

‎src/ui/qgsdbsourceselectbase.ui

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>406</width>
9+
<width>586</width>
1010
<height>476</height>
1111
</rect>
1212
</property>
@@ -64,6 +64,36 @@
6464
</property>
6565
</widget>
6666
</item>
67+
<item>
68+
<spacer name="horizontalSpacer">
69+
<property name="orientation">
70+
<enum>Qt::Horizontal</enum>
71+
</property>
72+
<property name="sizeHint" stdset="0">
73+
<size>
74+
<width>40</width>
75+
<height>20</height>
76+
</size>
77+
</property>
78+
</spacer>
79+
</item>
80+
<item>
81+
<widget class="QPushButton" name="btnLoad">
82+
<property name="text">
83+
<string comment="Load connections from file">Load</string>
84+
</property>
85+
</widget>
86+
</item>
87+
<item>
88+
<widget class="QPushButton" name="btnSave">
89+
<property name="toolTip">
90+
<string>Save connections to file</string>
91+
</property>
92+
<property name="text">
93+
<string>Save</string>
94+
</property>
95+
</widget>
96+
</item>
6797
</layout>
6898
</item>
6999
</layout>

‎src/ui/qgswmssourceselectbase.ui

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>564</width>
9+
<width>767</width>
1010
<height>539</height>
1111
</rect>
1212
</property>
@@ -17,13 +17,39 @@
1717
<iconset>
1818
<normaloff>../../../../.designer/backup</normaloff>../../../../.designer/backup</iconset>
1919
</property>
20+
<property name="toolTip">
21+
<string>Save connections to file</string>
22+
</property>
2023
<property name="sizeGripEnabled">
2124
<bool>true</bool>
2225
</property>
2326
<property name="modal">
2427
<bool>true</bool>
2528
</property>
2629
<layout class="QGridLayout" name="gridLayout_2">
30+
<item row="3" column="0">
31+
<widget class="QDialogButtonBox" name="buttonBox">
32+
<property name="standardButtons">
33+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
34+
</property>
35+
</widget>
36+
</item>
37+
<item row="4" column="0">
38+
<widget class="QLabel" name="labelStatus">
39+
<property name="sizePolicy">
40+
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
41+
<horstretch>0</horstretch>
42+
<verstretch>0</verstretch>
43+
</sizepolicy>
44+
</property>
45+
<property name="text">
46+
<string>Ready</string>
47+
</property>
48+
<property name="wordWrap">
49+
<bool>false</bool>
50+
</property>
51+
</widget>
52+
</item>
2753
<item row="0" column="0">
2854
<widget class="QTabWidget" name="tabServers">
2955
<property name="enabled">
@@ -37,7 +63,7 @@
3763
<string>Layers</string>
3864
</attribute>
3965
<layout class="QGridLayout" name="gridLayout">
40-
<item row="0" column="0" colspan="8">
66+
<item row="0" column="0" colspan="12">
4167
<widget class="QComboBox" name="cmbConnections"/>
4268
</item>
4369
<item row="1" column="0" colspan="2">
@@ -77,7 +103,7 @@
77103
</property>
78104
</widget>
79105
</item>
80-
<item row="1" column="6">
106+
<item row="1" column="7">
81107
<spacer name="horizontalSpacer_2">
82108
<property name="orientation">
83109
<enum>Qt::Horizontal</enum>
@@ -90,7 +116,7 @@
90116
</property>
91117
</spacer>
92118
</item>
93-
<item row="1" column="7">
119+
<item row="1" column="11">
94120
<widget class="QPushButton" name="btnAddDefault">
95121
<property name="statusTip">
96122
<string>Adds a few example WMS servers</string>
@@ -103,7 +129,7 @@
103129
</property>
104130
</widget>
105131
</item>
106-
<item row="2" column="0" colspan="8">
132+
<item row="2" column="0" colspan="12">
107133
<widget class="QTreeWidget" name="lstLayers">
108134
<property name="sizePolicy">
109135
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@@ -139,7 +165,7 @@
139165
</column>
140166
</widget>
141167
</item>
142-
<item row="3" column="0" colspan="8">
168+
<item row="3" column="0" colspan="12">
143169
<widget class="QGroupBox" name="btnGrpImageEncoding">
144170
<property name="sizePolicy">
145171
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -158,7 +184,7 @@
158184
</property>
159185
</widget>
160186
</item>
161-
<item row="4" column="0" colspan="8">
187+
<item row="4" column="0" colspan="12">
162188
<widget class="QGroupBox" name="gbCRS">
163189
<property name="title">
164190
<string>Options</string>
@@ -224,6 +250,23 @@
224250
</layout>
225251
</widget>
226252
</item>
253+
<item row="1" column="9">
254+
<widget class="QPushButton" name="btnSave">
255+
<property name="text">
256+
<string>Save</string>
257+
</property>
258+
</widget>
259+
</item>
260+
<item row="1" column="8">
261+
<widget class="QPushButton" name="btnLoad">
262+
<property name="toolTip">
263+
<string>Load connections from file</string>
264+
</property>
265+
<property name="text">
266+
<string>Load</string>
267+
</property>
268+
</widget>
269+
</item>
227270
</layout>
228271
</widget>
229272
<widget class="QWidget" name="tabLayerOrder">
@@ -299,9 +342,6 @@
299342
<attribute name="verticalHeaderVisible">
300343
<bool>false</bool>
301344
</attribute>
302-
<attribute name="verticalHeaderVisible">
303-
<bool>false</bool>
304-
</attribute>
305345
<column>
306346
<property name="text">
307347
<string>Layers</string>
@@ -363,9 +403,6 @@
363403
<attribute name="verticalHeaderVisible">
364404
<bool>false</bool>
365405
</attribute>
366-
<attribute name="verticalHeaderVisible">
367-
<bool>false</bool>
368-
</attribute>
369406
<column>
370407
<property name="text">
371408
<string>Title</string>
@@ -394,29 +431,6 @@
394431
</widget>
395432
</widget>
396433
</item>
397-
<item row="3" column="0">
398-
<widget class="QDialogButtonBox" name="buttonBox">
399-
<property name="standardButtons">
400-
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
401-
</property>
402-
</widget>
403-
</item>
404-
<item row="4" column="0">
405-
<widget class="QLabel" name="labelStatus">
406-
<property name="sizePolicy">
407-
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
408-
<horstretch>0</horstretch>
409-
<verstretch>0</verstretch>
410-
</sizepolicy>
411-
</property>
412-
<property name="text">
413-
<string>Ready</string>
414-
</property>
415-
<property name="wordWrap">
416-
<bool>false</bool>
417-
</property>
418-
</widget>
419-
</item>
420434
</layout>
421435
</widget>
422436
<layoutdefault spacing="6" margin="11"/>

0 commit comments

Comments
 (0)
Please sign in to comment.