20
20
#include < QMessageBox>
21
21
#include < QSettings>
22
22
#include < QTextStream>
23
- #include < QDebug>
24
23
25
24
#include " qgsmanageconnectionsdialog.h"
26
25
@@ -39,10 +38,14 @@ QgsManageConnectionsDialog::QgsManageConnectionsDialog( QWidget *parent, Mode mo
39
38
populateConnections ();
40
39
}
41
40
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 () ) );
42
45
buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( false );
43
46
}
44
47
45
- void QgsManageConnectionsDialog::on_btnBrowse_clicked ()
48
+ void QgsManageConnectionsDialog::selectFile ()
46
49
{
47
50
QString fileName;
48
51
if ( mDialogMode == Save )
@@ -67,7 +70,6 @@ void QgsManageConnectionsDialog::on_btnBrowse_clicked()
67
70
68
71
mFileName = fileName;
69
72
leFileName->setText ( mFileName );
70
- // buttonBox->button( QDialogButtonBox::Ok )->setEnabled( true );
71
73
72
74
if ( mDialogMode == Load )
73
75
{
@@ -77,7 +79,7 @@ void QgsManageConnectionsDialog::on_btnBrowse_clicked()
77
79
buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( true );
78
80
}
79
81
80
- void QgsManageConnectionsDialog::on_buttonBox_accepted ()
82
+ void QgsManageConnectionsDialog::doSaveLoad ()
81
83
{
82
84
QList<QListWidgetItem *> selection = listConnections->selectedItems ();
83
85
if ( selection.isEmpty () )
@@ -150,11 +152,12 @@ void QgsManageConnectionsDialog::on_buttonBox_accepted()
150
152
{
151
153
loadPgConnections ( doc, items );
152
154
}
155
+ // clear connections list
156
+ listConnections->clear ();
153
157
}
154
158
155
159
mFileName = " " ;
156
160
leFileName->clear ();
157
- listConnections->clear ();
158
161
buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( false );
159
162
}
160
163
0 commit comments