Skip to content

Commit e97aab1

Browse files
author
alexbruy
committed
don't close Manage connections dialog after processing selected file.
Allow user select another file and run save/load operation again git-svn-id: http://svn.osgeo.org/qgis/trunk@15140 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 04af2f9 commit e97aab1

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/app/qgsmanageconnectionsdialog.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <QMessageBox>
2121
#include <QSettings>
2222
#include <QTextStream>
23-
#include <QDebug>
2423

2524
#include "qgsmanageconnectionsdialog.h"
2625

@@ -39,10 +38,14 @@ QgsManageConnectionsDialog::QgsManageConnectionsDialog( QWidget *parent, Mode mo
3938
populateConnections();
4039
}
4140

41+
connect( btnBrowse, SIGNAL( clicked() ), this, SLOT( selectFile() ) );
42+
// use Ok button for starting import and export operations
43+
disconnect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
44+
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( doSaveLoad() ) );
4245
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
4346
}
4447

45-
void QgsManageConnectionsDialog::on_btnBrowse_clicked()
48+
void QgsManageConnectionsDialog::selectFile()
4649
{
4750
QString fileName;
4851
if ( mDialogMode == Save )
@@ -67,7 +70,6 @@ void QgsManageConnectionsDialog::on_btnBrowse_clicked()
6770

6871
mFileName = fileName;
6972
leFileName->setText( mFileName );
70-
//buttonBox->button( QDialogButtonBox::Ok )->setEnabled( true );
7173

7274
if ( mDialogMode == Load )
7375
{
@@ -77,7 +79,7 @@ void QgsManageConnectionsDialog::on_btnBrowse_clicked()
7779
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( true );
7880
}
7981

80-
void QgsManageConnectionsDialog::on_buttonBox_accepted()
82+
void QgsManageConnectionsDialog::doSaveLoad()
8183
{
8284
QList<QListWidgetItem *> selection = listConnections->selectedItems();
8385
if ( selection.isEmpty() )
@@ -150,11 +152,12 @@ void QgsManageConnectionsDialog::on_buttonBox_accepted()
150152
{
151153
loadPgConnections( doc, items );
152154
}
155+
// clear connections list
156+
listConnections->clear();
153157
}
154158

155159
mFileName = "";
156160
leFileName->clear();
157-
listConnections->clear();
158161
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
159162
}
160163

src/app/qgsmanageconnectionsdialog.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class QgsManageConnectionsDialog : public QDialog, private Ui::QgsManageConnecti
4646
QgsManageConnectionsDialog( QWidget *parent = NULL, Mode mode = Save, Type type = WMS );
4747

4848
public slots:
49-
void on_btnBrowse_clicked();
50-
void on_buttonBox_accepted();
49+
void selectFile();
50+
void doSaveLoad();
5151

5252
void populateConnections();
5353

src/ui/qgsmanageconnectionsdialogbase.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<enum>Qt::Horizontal</enum>
5555
</property>
5656
<property name="standardButtons">
57-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
57+
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
5858
</property>
5959
</widget>
6060
</item>

0 commit comments

Comments
 (0)