Skip to content

Commit

Permalink
fix #3617
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15482 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 14, 2011
1 parent 1d974e8 commit 0ee8c4b
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 142 deletions.
15 changes: 2 additions & 13 deletions src/app/postgres/qgspgsourceselect.cpp
Expand Up @@ -61,17 +61,6 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
mBuildQueryButton->setDisabled( true );

QPushButton *pb;
pb = new QPushButton( tr( "&Save" ) );
pb->setToolTip( tr( "Save connections" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );

pb = new QPushButton( tr( "&Load" ) );
pb->setToolTip( tr( "Load connections" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );

mAddButton->setEnabled( false );
populateConnectionList();

Expand Down Expand Up @@ -166,13 +155,13 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
populateConnectionList();
}

void QgsPgSourceSelect::saveClicked()
void QgsPgSourceSelect::on_btnSave_clicked()
{
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::PostGIS );
dlg.exec();
}

void QgsPgSourceSelect::loadClicked()
void QgsPgSourceSelect::on_btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), ".",
tr( "XML files (*.xml *XML)" ) );
Expand Down
4 changes: 2 additions & 2 deletions src/app/postgres/qgspgsourceselect.h
Expand Up @@ -133,9 +133,9 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
//! Deletes the selected connection
void on_btnDelete_clicked();
//! Saves the selected connections to file
void saveClicked();
void on_btnSave_clicked();
//! Loads the selected connections from file
void loadClicked();
void on_btnLoad_clicked();
void on_mSearchTableEdit_textChanged( const QString & text );
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
Expand Down
14 changes: 2 additions & 12 deletions src/app/qgswmssourceselect.cpp
Expand Up @@ -62,16 +62,6 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl )
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClicked() ) );

QPushButton *pb = new QPushButton( tr( "&Save" ) );
pb->setToolTip( tr( "Save WMS server connections to file" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );

pb = new QPushButton( tr( "&Load" ) );
pb->setToolTip( tr( "Load WMS server connections from file" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );

mLayerUpButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowUp.png" ) );
mLayerDownButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowDown.png" ) );

Expand Down Expand Up @@ -244,13 +234,13 @@ void QgsWMSSourceSelect::on_btnDelete_clicked()
}
}

void QgsWMSSourceSelect::saveClicked()
void QgsWMSSourceSelect::on_btnSave_clicked()
{
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::WMS );
dlg.exec();
}

void QgsWMSSourceSelect::loadClicked()
void QgsWMSSourceSelect::on_btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), ".",
tr( "XML files (*.xml *XML)" ) );
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgswmssourceselect.h
Expand Up @@ -60,9 +60,9 @@ class QgsWMSSourceSelect : public QDialog, private Ui::QgsWMSSourceSelectBase
//! Deletes the selected connection
void on_btnDelete_clicked();
//! Saves connections to the file
void saveClicked();
void on_btnSave_clicked();
//! Loads connections from the file
void loadClicked();
void on_btnLoad_clicked();

/*! Connects to the database using the stored connection parameters.
* Once connected, available layers are displayed.
Expand Down
2 changes: 2 additions & 0 deletions src/app/spatialite/qgsspatialitesourceselect.cpp
Expand Up @@ -46,6 +46,8 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
setWindowTitle( tr( "Add SpatiaLite Table(s)" ) );
connectionsGroupBox->setTitle( tr( "Databases" ) );
btnEdit->hide(); // hide the edit button
btnSave->hide();
btnLoad->hide();

mAddButton = new QPushButton( tr( "&Add" ) );
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
Expand Down
14 changes: 2 additions & 12 deletions src/plugins/wfs/qgswfssourceselect.cpp
Expand Up @@ -46,16 +46,6 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, QgisInterface* iface )
btnAdd = buttonBox->button( QDialogButtonBox::Ok );
btnAdd->setEnabled( false );

QPushButton *pb = new QPushButton( tr( "&Save" ) );
pb->setToolTip( tr( "Save WFS server connections to file" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );

pb = new QPushButton( tr( "&Load" ) );
pb->setToolTip( tr( "Load WFS server connections from file" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );

connect( buttonBox, SIGNAL( accepted() ), this, SLOT( addLayer() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );
Expand Down Expand Up @@ -469,13 +459,13 @@ void QgsWFSSourceSelect::on_cmbConnections_activated( int index )
s.setValue( "/Qgis/connections-wfs/selected", cmbConnections->currentText() );
}

void QgsWFSSourceSelect::saveClicked()
void QgsWFSSourceSelect::on_btnSave_clicked()
{
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::WFS );
dlg.exec();
}

void QgsWFSSourceSelect::loadClicked()
void QgsWFSSourceSelect::on_btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), ".",
tr( "XML files (*.xml *XML)" ) );
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/wfs/qgswfssourceselect.h
Expand Up @@ -66,9 +66,8 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
void on_cmbConnections_activated( int index );
void capabilitiesReplyFinished();
void capabilitiesReplyProgress( qint64, qint64 );

void saveClicked();
void loadClicked();
void on_btnSave_clicked();
void on_btnLoad_clicked();

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
};
Expand Down
140 changes: 79 additions & 61 deletions src/plugins/wfs/qgswfssourceselectbase.ui
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>577</width>
<width>590</width>
<height>503</height>
</rect>
</property>
Expand All @@ -19,68 +19,86 @@
<property name="title">
<string>Server connections</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="1">
<widget class="QPushButton" name="btnNew">
<property name="text">
<string>&amp;New</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="btnDelete">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="btnEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item row="1" column="4">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>171</width>
<height>30</height>
</size>
</property>
</spacer>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QComboBox" name="cmbConnections"/>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="btnConnect">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>C&amp;onnect</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="5">
<widget class="QComboBox" name="cmbConnections"/>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnConnect">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>C&amp;onnect</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnNew">
<property name="text">
<string>&amp;New</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnDelete">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>171</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnLoad">
<property name="toolTip">
<string>Load connections from file</string>
</property>
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnSave">
<property name="toolTip">
<string>Save connections to file</string>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
Expand Down
32 changes: 31 additions & 1 deletion src/ui/qgsdbsourceselectbase.ui
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>406</width>
<width>586</width>
<height>476</height>
</rect>
</property>
Expand Down Expand Up @@ -64,6 +64,36 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnLoad">
<property name="text">
<string comment="Load connections from file">Load</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnSave">
<property name="toolTip">
<string>Save connections to file</string>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down

0 comments on commit 0ee8c4b

Please sign in to comment.