Skip to content

Commit

Permalink
Remember last wfs connection in dialog (ticket #2878)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@13906 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jul 11, 2010
1 parent 3bc3db6 commit 15df931
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/plugins/wfs/qgswfssourceselect.cpp
Expand Up @@ -47,7 +47,6 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, QgisInterface* iface ):
connect( btnChangeSpatialRefSys, SIGNAL( clicked() ), this, SLOT( changeCRS() ) );
connect( treeWidget, SIGNAL( currentItemChanged( QTreeWidgetItem*, QTreeWidgetItem* ) ), this, SLOT( changeCRSFilter() ) );
populateConnectionList();

mProjectionSelector = new QgsGenericProjectionSelector( this );
mProjectionSelector->setMessage();
}
Expand Down Expand Up @@ -86,6 +85,11 @@ void QgsWFSSourceSelect::populateConnectionList()
btnEdit->setEnabled( false );
btnDelete->setEnabled( false );
}

//set last used connection
QSettings s;
QString selectedConnection = s.value( "/Qgis/connections-wfs/selected" ).toString();
cmbConnections->setCurrentIndex( cmbConnections->findText( selectedConnection ) );
}

QString QgsWFSSourceSelect::getPreferredCrs( const QSet<QString>& crsSet ) const
Expand Down Expand Up @@ -426,3 +430,9 @@ void QgsWFSSourceSelect::changeCRSFilter()
}
}
}

void QgsWFSSourceSelect::on_cmbConnections_activated( int index )
{
QSettings s;
s.setValue( "/Qgis/connections-wfs/selected", cmbConnections->currentText() );
}
1 change: 1 addition & 0 deletions src/plugins/wfs/qgswfssourceselect.h
Expand Up @@ -80,6 +80,7 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
void addLayer();
void changeCRS();
void changeCRSFilter();
void on_cmbConnections_activated( int index );

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
};
Expand Down

0 comments on commit 15df931

Please sign in to comment.