Skip to content

Commit d6fc8d5

Browse files
author
alexbruy
committed
manage connections dialog cleanup and usability improvement. Also add support for service parameter in PostgreSQL connection introduced in r15258
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15264 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 599d159 commit d6fc8d5

7 files changed

+164
-109
lines changed

src/app/postgres/qgspgsourceselect.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ email : sherman at mrcc.com
3030
#include "qgsvectorlayer.h"
3131
#include "qgscredentials.h"
3232

33+
#include <QFileDialog>
3334
#include <QInputDialog>
3435
#include <QMessageBox>
3536
#include <QSettings>
@@ -157,13 +158,20 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
157158

158159
void QgsPgSourceSelect::saveClicked()
159160
{
160-
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Save, QgsManageConnectionsDialog::PostGIS );
161+
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Export, QgsManageConnectionsDialog::PostGIS );
161162
dlg.exec();
162163
}
163164

164165
void QgsPgSourceSelect::loadClicked()
165166
{
166-
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Load, QgsManageConnectionsDialog::PostGIS );
167+
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections )" ), ".",
168+
tr( "XML files (*.xml *XML)" ) );
169+
if ( fileName.isEmpty() )
170+
{
171+
return;
172+
}
173+
174+
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Import, QgsManageConnectionsDialog::PostGIS, fileName );
167175
dlg.exec();
168176
populateConnectionList();
169177
}

src/app/postgres/qgspgsourceselect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
131131
void on_btnBuildQuery_clicked();
132132
//! Deletes the selected connection
133133
void on_btnDelete_clicked();
134-
//! Saves the selected connections to the file
134+
//! Saves the selected connections to file
135135
void saveClicked();
136-
//! Loads the selected connections from the file
136+
//! Loads the selected connections from file
137137
void loadClicked();
138138
void on_mSearchTableEdit_textChanged( const QString & text );
139139
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );

0 commit comments

Comments
 (0)