Skip to content
Permalink
Browse files

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/qgis@15140 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
alexbruy
alexbruy committed Feb 8, 2011
1 parent ebbaa6f commit fb53e2d3b9b9560b67b09f17657884bf9bd9f1ee
@@ -20,7 +20,6 @@
#include <QMessageBox>
#include <QSettings>
#include <QTextStream>
#include <QDebug>

#include "qgsmanageconnectionsdialog.h"

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

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

void QgsManageConnectionsDialog::on_btnBrowse_clicked()
void QgsManageConnectionsDialog::selectFile()
{
QString fileName;
if ( mDialogMode == Save )
@@ -67,7 +70,6 @@ void QgsManageConnectionsDialog::on_btnBrowse_clicked()

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

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

void QgsManageConnectionsDialog::on_buttonBox_accepted()
void QgsManageConnectionsDialog::doSaveLoad()
{
QList<QListWidgetItem *> selection = listConnections->selectedItems();
if ( selection.isEmpty() )
@@ -150,11 +152,12 @@ void QgsManageConnectionsDialog::on_buttonBox_accepted()
{
loadPgConnections( doc, items );
}
// clear connections list
listConnections->clear();
}

mFileName = "";
leFileName->clear();
listConnections->clear();
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
}

@@ -46,8 +46,8 @@ class QgsManageConnectionsDialog : public QDialog, private Ui::QgsManageConnecti
QgsManageConnectionsDialog( QWidget *parent = NULL, Mode mode = Save, Type type = WMS );

public slots:
void on_btnBrowse_clicked();
void on_buttonBox_accepted();
void selectFile();
void doSaveLoad();

void populateConnections();

@@ -54,7 +54,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>

0 comments on commit fb53e2d

Please sign in to comment.
You can’t perform that action at this time.