mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Some small changes to use QgsNewHttpConnection for non-wms http connections (WFS in this case)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5740 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
6aa020bad1
commit
784e8ce6ce
@ -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())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user