Skip to content

Commit 15df931

Browse files
author
mhugent
committedJul 11, 2010
Remember last wfs connection in dialog (ticket #2878)
git-svn-id: http://svn.osgeo.org/qgis/trunk@13906 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3bc3db6 commit 15df931

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
 

‎src/plugins/wfs/qgswfssourceselect.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, QgisInterface* iface ):
4747
connect( btnChangeSpatialRefSys, SIGNAL( clicked() ), this, SLOT( changeCRS() ) );
4848
connect( treeWidget, SIGNAL( currentItemChanged( QTreeWidgetItem*, QTreeWidgetItem* ) ), this, SLOT( changeCRSFilter() ) );
4949
populateConnectionList();
50-
5150
mProjectionSelector = new QgsGenericProjectionSelector( this );
5251
mProjectionSelector->setMessage();
5352
}
@@ -86,6 +85,11 @@ void QgsWFSSourceSelect::populateConnectionList()
8685
btnEdit->setEnabled( false );
8786
btnDelete->setEnabled( false );
8887
}
88+
89+
//set last used connection
90+
QSettings s;
91+
QString selectedConnection = s.value( "/Qgis/connections-wfs/selected" ).toString();
92+
cmbConnections->setCurrentIndex( cmbConnections->findText( selectedConnection ) );
8993
}
9094

9195
QString QgsWFSSourceSelect::getPreferredCrs( const QSet<QString>& crsSet ) const
@@ -426,3 +430,9 @@ void QgsWFSSourceSelect::changeCRSFilter()
426430
}
427431
}
428432
}
433+
434+
void QgsWFSSourceSelect::on_cmbConnections_activated( int index )
435+
{
436+
QSettings s;
437+
s.setValue( "/Qgis/connections-wfs/selected", cmbConnections->currentText() );
438+
}

‎src/plugins/wfs/qgswfssourceselect.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
8080
void addLayer();
8181
void changeCRS();
8282
void changeCRSFilter();
83+
void on_cmbConnections_activated( int index );
8384

8485
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
8586
};

0 commit comments

Comments
 (0)
Please sign in to comment.