Skip to content
Permalink
Browse files
Some small changes to use QgsNewHttpConnection for non-wms http conne…
…ctions (WFS in this case)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5740 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 28, 2006
1 parent 6aa020b commit 784e8ce6cee072eb3d4e4385a0fdf22b87dec3d9
Showing with 11 additions and 14 deletions.
  1. +8 −12 src/gui/qgsnewhttpconnection.cpp
  2. +2 −1 src/gui/qgsnewhttpconnection.h
  3. +1 −1 src/gui/qgsserversourceselect.cpp
@@ -19,8 +19,7 @@
#include "qgscontexthelp.h"
#include <QSettings>

QgsNewHttpConnection::QgsNewHttpConnection(QWidget *parent, const QString& connName, Qt::WFlags fl)
: QDialog(parent, fl)
QgsNewHttpConnection::QgsNewHttpConnection(QWidget *parent, const QString& baseKey, const QString& connName, Qt::WFlags fl): QDialog(parent, fl), mBaseKey(baseKey)
{
setupUi(this);
connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
@@ -33,7 +32,7 @@ QgsNewHttpConnection::QgsNewHttpConnection(QWidget *parent, const QString& connN

QSettings settings;

QString key = "/Qgis/connections-wms/" + connName;
QString key = mBaseKey + connName;
txtName->setText (connName);
txtUrl->setText (settings.readEntry(key + "/url"));
txtProxyHost->setText(settings.readEntry(key + "/proxyhost"));
@@ -58,15 +57,12 @@ void QgsNewHttpConnection::testConnection()
void QgsNewHttpConnection::saveConnection()
{
QSettings settings;
QString baseKey = "/Qgis/connections-wms/";

baseKey += txtName->text();
settings.writeEntry(baseKey + "/url", txtUrl->text().trimmed());
settings.writeEntry(baseKey + "/proxyhost", txtProxyHost->text().trimmed());
settings.writeEntry(baseKey + "/proxyport", txtProxyPort->text().trimmed());
settings.writeEntry(baseKey + "/proxyuser", txtProxyUser->text().trimmed());
settings.writeEntry(baseKey + "/proxypassword",
txtProxyPass->text().trimmed());
QString key = mBaseKey + txtName->text();
settings.writeEntry(key + "/url", txtUrl->text().trimmed());
settings.writeEntry(key + "/proxyhost", txtProxyHost->text().trimmed());
settings.writeEntry(key + "/proxyport", txtProxyPort->text().trimmed());
settings.writeEntry(key + "/proxyuser", txtProxyUser->text().trimmed());
settings.writeEntry(key + "/proxypassword", txtProxyPass->text().trimmed());

accept();
}
@@ -28,7 +28,7 @@ class QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBas
Q_OBJECT
public:
//! Constructor
QgsNewHttpConnection(QWidget *parent = 0, const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags);
QgsNewHttpConnection(QWidget *parent = 0, const QString& baseKey = "/Qgis/connections-wms/", const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags);
//! Destructor
~QgsNewHttpConnection();
//! Tests the connection using the parameters supplied
@@ -39,6 +39,7 @@ class QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBas
//! Show context help
void on_btnHelp_clicked();
private:
QString mBaseKey;
static const int context_id = 308026563;
};

@@ -142,7 +142,7 @@ void QgsServerSourceSelect::on_btnNew_clicked()
void QgsServerSourceSelect::on_btnEdit_clicked()
{

QgsNewHttpConnection *nc = new QgsNewHttpConnection(this, cmbConnections->currentText());
QgsNewHttpConnection *nc = new QgsNewHttpConnection(this, "/Qgis/connections-wms/", cmbConnections->currentText());

if (nc->exec())
{

0 comments on commit 784e8ce

Please sign in to comment.