Skip to content

Commit 467d684

Browse files
author
jef
committed
fix #3617
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15482 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent c54b8e5 commit 467d684

10 files changed

+174
-142
lines changed

src/app/postgres/qgspgsourceselect.cpp

+2-13
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

+2-2
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

+2-12
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

+2-2
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

+2
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

+2-12
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

+2-3
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

+79-61
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

+31-1
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>

0 commit comments

Comments
 (0)