diff --git a/python/core/qgsrasterdataprovider.sip b/python/core/qgsrasterdataprovider.sip index 8e8bdc85810..4c7cb1ca951 100644 --- a/python/core/qgsrasterdataprovider.sip +++ b/python/core/qgsrasterdataprovider.sip @@ -29,40 +29,6 @@ public: virtual ~QgsRasterDataProvider(); - - /** - * Gets the HTTP proxy host used for this connection - */ - virtual QString proxyHost() const = 0; - - /** - * Gets the HTTP proxy port used for this connection - */ - virtual int proxyPort() const = 0; - - /** - * Gets the HTTP proxy user name used for this connection - */ - virtual QString proxyUser() const = 0; - - /** - * Gets the HTTP proxy user password used for this connection - */ - virtual QString proxyPass() const = 0; - - /** - * - * Sets a proxy for the URL given in the constructor - * - * - * \retval TRUE if proxy setting is successful (if indeed it is supported) - */ - virtual bool setProxy(const QString & host, - int port, - const QString & user, - const QString & pass); - - /** * Add the list of WMS layer names to be rendered by this server */ diff --git a/python/core/qgsrasterlayer.sip b/python/core/qgsrasterlayer.sip index 82a17b0570e..08504176607 100644 --- a/python/core/qgsrasterlayer.sip +++ b/python/core/qgsrasterlayer.sip @@ -535,35 +535,17 @@ public: const QStringList & layers = QStringList(), const QStringList & styles = QStringList(), const QString & format = QString(), - const QString & crs = QString(), - const QString & proxyHost = QString(), - int proxyPort = 80, - const QString & proxyUser = QString(), - const QString & proxyPass = QString()); + const QString & crs = QString()); void setDataProvider( const QString & provider, const QStringList & layers, const QStringList & styles, const QString & format, - const QString & crs, - const QString & proxyHost, - int proxyPort, - const QString & proxyUser, - const QString & proxyPass ); + const QString & crs); //! Does this layer use a provider for setting/retrieving data? bool usesProvider(); - /** - * Sets a proxy for the path given in the constructor - * - * \retval TRUE if proxy setting is successful (if indeed it is supported) - */ - bool setProxy(const QString & host = 0, - int port = 80, - const QString & user = 0, - const QString & pass = 0); - //! Which provider is being used for this Raster Layer? QString providerKey(); diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 52fe8869c8d..c2350c777a9 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -331,6 +332,7 @@ static void customSrsValidation_(QgsSpatialRefSys* srs) createLegend(); createOverview(); createMapTips(); + setupProxy(); mComposer = new QgsComposer(this); // Map composer mInternalClipboard = new QgsClipboard; // create clipboard @@ -2216,12 +2218,7 @@ void QgisApp::addWmsLayer() wmss->selectedLayers(), wmss->selectedStylesForSelectedLayers(), wmss->selectedImageEncoding(), - wmss->selectedCrs(), - wmss->connProxyHost(), - wmss->connProxyPort(), - wmss->connProxyUser(), - wmss->connProxyPass() - ); + wmss->selectedCrs()); } } @@ -4355,6 +4352,7 @@ void QgisApp::options() // bool splitterRedraw = mySettings.value("/qgis/splitterRedraw", true).toBool(); // canvasLegendSplit->setOpaqueResize(splitterRedraw); // legendOverviewSplit->setOpaqueResize(splitterRedraw); + setupProxy(); } } @@ -5221,11 +5219,7 @@ QgsRasterLayer* QgisApp::addRasterLayer(QString const & rasterLayerPath, QStringList const & layers, QStringList const & styles, QString const & format, - QString const & crs, - QString const & proxyHost, - int proxyPort, - QString const & proxyUser, - QString const & proxyPassword) + QString const & crs) { QgsDebugMsg("about to get library for " + providerKey); @@ -5254,8 +5248,7 @@ QgsRasterLayer* QgisApp::addRasterLayer(QString const & rasterLayerPath, + " and CRS of " + crs ); // TODO: Remove the 0 when the raster layer becomes a full provider gateway. - layer = new QgsRasterLayer(0, rasterLayerPath, baseName, providerKey, layers, styles, format, crs, - proxyHost, proxyPort, proxyUser, proxyPassword); + layer = new QgsRasterLayer(0, rasterLayerPath, baseName, providerKey, layers, styles, format, crs); QgsDebugMsg("Constructed new layer."); @@ -5521,3 +5514,23 @@ void QgisApp::warnOlderProjectVersion(QString oldVersion) } return; } + +void QgisApp::setupProxy() +{ + QSettings mySettings; + bool myFlag = mySettings.value("proxy/proxyEnabled", "0").toBool(); + QNetworkProxy myProxy; + if (myFlag) + { + myProxy.setType(QNetworkProxy::HttpProxy); + myProxy.setHostName(mySettings.value("proxy/proxyHost", "").toString()); + myProxy.setPort(mySettings.value("proxy/proxyPort", "").toInt()); + myProxy.setUser(mySettings.value("proxy/proxyUser", "").toString()); + myProxy.setPassword(mySettings.value("proxy/proxyPassword", "").toString()); + } + else + { + // otherwise leave it blank to disable proxy usage + } + QNetworkProxy::setApplicationProxy(myProxy); +} diff --git a/src/app/qgisapp.h b/src/app/qgisapp.h index 82a64bf2910..fb90e218e30 100644 --- a/src/app/qgisapp.h +++ b/src/app/qgisapp.h @@ -102,11 +102,7 @@ class QgisApp : public QMainWindow QStringList const & layers, QStringList const & styles, QString const & format, - QString const & crs, - QString const & proxyHost = QString(), - int proxyPort = 80, - QString const & proxyUser = QString(), - QString const & proxyPassword = QString()); + QString const & crs); /** open a raster layer for the given file @returns false if unable to open a raster layer for rasterFile @@ -150,6 +146,22 @@ class QgisApp : public QMainWindow void dropEvent(QDropEvent *); + /** Setup the proxy settings from the QSettings environment. + * This is not called by default in the constructor. Rather, + * the application must explicitly call setupProx(). If + * you write your own application and wish to explicitly + * set up your own proxy rather, you should e.g. + * QNetworkProxy proxy; + * proxy.setType(QNetworkProxy::Socks5Proxy); + * proxy.setHostName("proxy.example.com"); + * proxy.setPort(1080); + * proxy.setUser("username"); + * proxy.setPassword("password"); + * QNetworkProxy::setApplicationProxy(proxy); + * + * (as documented in Qt documentation. + */ + void setupProxy(); //private slots: public slots: //! About QGis diff --git a/src/app/qgsnewhttpconnection.cpp b/src/app/qgsnewhttpconnection.cpp index 00b0369fdd4..98f2b24f80d 100644 --- a/src/app/qgsnewhttpconnection.cpp +++ b/src/app/qgsnewhttpconnection.cpp @@ -19,61 +19,48 @@ #include "qgscontexthelp.h" #include -QgsNewHttpConnection::QgsNewHttpConnection(QWidget *parent, const QString& baseKey, const QString& connName, Qt::WFlags fl): QDialog(parent, fl), mBaseKey(baseKey), mOriginalConnName(connName) +QgsNewHttpConnection::QgsNewHttpConnection( + QWidget *parent, const QString& baseKey, const QString& connName, Qt::WFlags fl): + QDialog(parent, fl), + mBaseKey(baseKey), + mOriginalConnName(connName) { setupUi(this); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(btnOk, SIGNAL(clicked()), this, SLOT(saveConnection())); if (!connName.isEmpty()) - { - // populate the dialog with the information stored for the connection - // populate the fields with the stored setting parameters - - QSettings settings; + { + // populate the dialog with the information stored for the connection + // populate the fields with the stored setting parameters - QString key = mBaseKey + connName; - txtName->setText (connName); - txtUrl->setText (settings.value(key + "/url").toString()); - txtProxyHost->setText(settings.value(key + "/proxyhost").toString()); - txtProxyPort->setText(settings.value(key + "/proxyport").toString()); - txtProxyUser->setText(settings.value(key + "/proxyuser").toString()); - txtProxyPass->setText(settings.value(key + "/proxypassword").toString()); - } + QSettings settings; + + QString key = mBaseKey + connName; + txtName->setText (connName); + txtUrl->setText (settings.value(key + "/url").toString()); + } + connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(helpRequested())); } QgsNewHttpConnection::~QgsNewHttpConnection() { } -void QgsNewHttpConnection::testConnection() -{ - // following line uses Qt SQL plugin - currently not used - // QSqlDatabase *testCon = QSqlDatabase::addDatabase("QPSQL7","testconnection"); - - -} - -void QgsNewHttpConnection::saveConnection() +void QgsNewHttpConnection::accept() { QSettings settings; QString key = mBaseKey + txtName->text(); - + //delete original entry first if(!mOriginalConnName.isNull() && mOriginalConnName != key) - { - settings.remove(mBaseKey + mOriginalConnName); - } + { + settings.remove(mBaseKey + mOriginalConnName); + } settings.setValue(key + "/url", txtUrl->text().trimmed()); - settings.setValue(key + "/proxyhost", txtProxyHost->text().trimmed()); - settings.setValue(key + "/proxyport", txtProxyPort->text().trimmed()); - settings.setValue(key + "/proxyuser", txtProxyUser->text().trimmed()); - settings.setValue(key + "/proxypassword", txtProxyPass->text().trimmed()); - - accept(); + + QDialog::accept(); } -void QgsNewHttpConnection::on_btnHelp_clicked() +void QgsNewHttpConnection::helpRequested() { QgsContextHelp::run(context_id); } diff --git a/src/app/qgsnewhttpconnection.h b/src/app/qgsnewhttpconnection.h index af568103c67..373d384b3aa 100644 --- a/src/app/qgsnewhttpconnection.h +++ b/src/app/qgsnewhttpconnection.h @@ -31,13 +31,11 @@ class QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBas 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 - void testConnection(); public slots: //! Saves the connection to ~/.qt/qgisrc - void saveConnection(); + void accept(); //! Show context help - void on_btnHelp_clicked(); + void helpRequested(); private: QString mBaseKey; QString mOriginalConnName; //store initial name to delete entry in case of rename diff --git a/src/app/qgsserversourceselect.cpp b/src/app/qgsserversourceselect.cpp index b5d278af0d1..3efa52cc82e 100644 --- a/src/app/qgsserversourceselect.cpp +++ b/src/app/qgsserversourceselect.cpp @@ -363,47 +363,7 @@ void QgsServerSourceSelect::on_btnConnect_clicked() connStringParts += settings.value(key + "/url").toString(); -/* - // Add the proxy host and port if any are defined. - if ( ! ( (part = settings.value(key + "/proxyhost").toString()).isEmpty() ) ) - { -#ifdef QGISDEBUG - std::cout << "QgsServerSourceSelect::serverConnect: Got a proxyhost - '" << part.toLocal8Bit().data() << "'." << std::endl; -#endif - connStringParts += part; - - if ( ! ( (part = settings.value(key + "/proxyport").toString()).isEmpty() ) ) - { -#ifdef QGISDEBUG - std::cout << "QgsServerSourceSelect::serverConnect: Got a proxyport - '" << part.toLocal8Bit().data() << "'." << std::endl; -#endif - connStringParts += part; - } - else - { - connStringParts += "80"; // well-known http port - } - - if ( ! ( (part = settings.value(key + "/proxyuser").toString()).isEmpty() ) ) - { -#ifdef QGISDEBUG - std::cout << "QgsServerSourceSelect::serverConnect: Got a proxyuser - '" << part.toLocal8Bit().data() << "'." << std::endl; -#endif - connStringParts += part; - - if ( ! ( (part = settings.value(key + "/proxypass").toString()).isEmpty() ) ) - { -#ifdef QGISDEBUG - std::cout << "QgsServerSourceSelect::serverConnect: Got a proxypass - '" << part.toLocal8Bit().data() << "'." << std::endl; -#endif - connStringParts += part; - } - } - } -*/ - m_connName = cmbConnections->currentText(); - // setup 'url ( + " " + proxyhost + " " + proxyport + " " + proxyuser + " " + proxypass)' m_connInfo = connStringParts.join(" "); #ifdef QGISDEBUG @@ -423,20 +383,6 @@ void QgsServerSourceSelect::on_btnConnect_clicked() { connect(mWmsProvider, SIGNAL(setStatus(QString)), this, SLOT(showStatusMessage(QString))); - // Collect and set HTTP proxy on WMS provider - - m_connProxyHost = settings.value(key + "/proxyhost").toString(), - m_connProxyPort = settings.value(key + "/proxyport").toInt(), - m_connProxyUser = settings.value(key + "/proxyuser").toString(), - m_connProxyPass = settings.value(key + "/proxypassword").toString(), - - mWmsProvider->setProxy( - m_connProxyHost, - m_connProxyPort, - m_connProxyUser, - m_connProxyPass - ); - // WMS Provider all set up; let's get some layers if (!populateLayerList(mWmsProvider)) @@ -632,26 +578,6 @@ QString QgsServerSourceSelect::connInfo() return m_connInfo; } -QString QgsServerSourceSelect::connProxyHost() -{ - return m_connProxyHost; -} - -int QgsServerSourceSelect::connProxyPort() -{ - return m_connProxyPort; -} - -QString QgsServerSourceSelect::connProxyUser() -{ - return m_connProxyUser; -} - -QString QgsServerSourceSelect::connProxyPass() -{ - return m_connProxyPass; -} - QStringList QgsServerSourceSelect::selectedLayers() { return m_selectedLayers; @@ -796,17 +722,16 @@ void QgsServerSourceSelect::addDefaultServers() if (!keys.contains(i.key())) { QString path = i.key(); - settings.setValue(path + "/proxyhost", ""); - settings.setValue(path + "/proxyport", 80); - settings.setValue(path + "/proxyuser", ""); - settings.setValue(path + "/proxypassword", ""); settings.setValue(path + "/url", i.value()); } } settings.endGroup(); populateConnectionList(); - QMessageBox::information(this, tr("WMS proxies"), tr("

Several WMS servers have been added to the server list. Note that the proxy fields have been left blank and if you access the internet via a web proxy, you will need to individually set the proxy fields with appropriate values.

")); + QMessageBox::information(this, tr("WMS proxies"), "

" + tr("Several WMS servers have " + "been added to the server list. Note that if " + "you access the internet via a web proxy, you will " + "need to set the proxy settings in the QGIS options dialog.") + "

"); } // ENDS diff --git a/src/core/qgsrasterdataprovider.h b/src/core/qgsrasterdataprovider.h index c909140023e..784f425e2f2 100644 --- a/src/core/qgsrasterdataprovider.h +++ b/src/core/qgsrasterdataprovider.h @@ -57,48 +57,6 @@ public: virtual ~QgsRasterDataProvider() {}; - /** - * Gets the HTTP proxy host used for this connection - */ - virtual QString proxyHost() const = 0; - - /** - * Gets the HTTP proxy port used for this connection - */ - virtual int proxyPort() const = 0; - - /** - * Gets the HTTP proxy user name used for this connection - */ - virtual QString proxyUser() const = 0; - - /** - * Gets the HTTP proxy user password used for this connection - */ - virtual QString proxyPass() const = 0; - - - /** - * - * Sets a proxy for the URL given in the constructor - * - * - * \retval TRUE if proxy setting is successful (if indeed it is supported) - */ - virtual bool setProxy(QString const & host, - int port, - QString const & user, - QString const & pass) - { - //this is mainly to prevent compiler warnings - if (host.isEmpty() || port < 1 || user.isEmpty() || pass.isEmpty()) - { - return FALSE; - } - - return FALSE; - } - /** * Add the list of WMS layer names to be rendered by this server */ diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index f7b14e3bd1e..8c2cd653da2 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -4164,14 +4164,7 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node ) // Collect CRS QString crs = QString("EPSG:%1").arg(srs().epsg()); - // Collect proxy information - QString proxyHost = rpNode.namedItem("wmsProxyHost").toElement().text(); - int proxyPort = rpNode.namedItem("wmsProxyPort").toElement().text().toInt(); - QString proxyUser = rpNode.namedItem("wmsProxyUser").toElement().text(); - QString proxyPass = rpNode.namedItem("wmsProxyPass").toElement().text(); - - setDataProvider( mProviderKey, layers, styles, format, crs, - proxyHost, proxyPort, proxyUser, proxyPass ); + setDataProvider( mProviderKey, layers, styles, format, crs ); } else { @@ -4447,33 +4440,6 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node ) formatElement.appendChild(formatText); rasterPropertiesElement.appendChild(formatElement); - // - QDomElement proxyHostElement = document.createElement("wmsProxyHost"); - QDomText proxyHostText = - document.createTextNode(mDataProvider->proxyHost()); - proxyHostElement.appendChild(proxyHostText); - rasterPropertiesElement.appendChild(proxyHostElement); - - // - QDomElement proxyPortElement = document.createElement("wmsProxyPort"); - QDomText proxyPortText = - document.createTextNode( QString::number(mDataProvider->proxyPort()) ); - proxyPortElement.appendChild(proxyPortText); - rasterPropertiesElement.appendChild(proxyPortElement); - - // - QDomElement proxyUserElement = document.createElement("wmsProxyUser"); - QDomText proxyUserText = - document.createTextNode(mDataProvider->proxyUser()); - proxyUserElement.appendChild(proxyUserText); - rasterPropertiesElement.appendChild(proxyUserElement); - - // - QDomElement proxyPassElement = document.createElement("wmsProxyPass"); - QDomText proxyPassText = - document.createTextNode(mDataProvider->proxyPass()); - proxyPassElement.appendChild(proxyPassText); - rasterPropertiesElement.appendChild(proxyPassElement); } // @@ -4907,11 +4873,7 @@ QgsRasterLayer::QgsRasterLayer(int dummy, QStringList const & layers, QStringList const & styles, QString const & format, - QString const & crs, - QString const & proxyHost, - int proxyPort, - QString const & proxyUser, - QString const & proxyPass ) + QString const & crs) : QgsMapLayer(RASTER, baseName, rasterLayerPath), mRasterXDim( std::numeric_limits::max() ), mRasterYDim( std::numeric_limits::max() ), @@ -4941,8 +4903,7 @@ mModified(false) // if we're given a provider type, try to create and bind one to this layer if ( ! providerKey.isEmpty() ) { - setDataProvider( providerKey, layers, styles, format, crs, - proxyHost, proxyPort, proxyUser, proxyPass ); + setDataProvider( providerKey, layers, styles, format, crs ); } // Default for the popup menu @@ -4981,11 +4942,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider, QStringList const & layers, QStringList const & styles, QString const & format, - QString const & crs, - QString const & proxyHost, - int proxyPort, - QString const & proxyUser, - QString const & proxyPass ) + QString const & crs) { // XXX should I check for and possibly delete any pre-existing providers? // XXX How often will that scenario occur? @@ -5052,7 +5009,6 @@ void QgsRasterLayer::setDataProvider( QString const & provider, mDataProvider->addLayers(layers, styles); mDataProvider->setImageEncoding(format); mDataProvider->setImageCrs(crs); - mDataProvider->setProxy(proxyHost, proxyPort, proxyUser, proxyPass); // get the extent QgsRect mbr = mDataProvider->extent(); @@ -5095,29 +5051,6 @@ void QgsRasterLayer::setDataProvider( QString const & provider, } // QgsRasterLayer::setDataProvider -bool QgsRasterLayer::setProxy(QString const & host, - int port, - QString const & user, - QString const & pass) -{ - if (!mDataProvider) - { - return FALSE; - } - else - { -#ifdef QGISDEBUG - std::cout << " QgsRasterLayer::setProxy: host = " << host.toLocal8Bit().data() << "." << std::endl; - std::cout << " QgsRasterLayer::setProxy: port = " << port << "." << std::endl; - std::cout << " QgsRasterLayer::setProxy: user = " << user.toLocal8Bit().data() << "." << std::endl; - std::cout << " QgsRasterLayer::setProxy: pass = " << pass.toLocal8Bit().data() << "." << std::endl; -#endif - return mDataProvider->setProxy(host, port, user, pass); - } -} - - - bool QgsRasterLayer::usesProvider() { if (mProviderKey.isEmpty()) diff --git a/src/core/raster/qgsrasterlayer.h b/src/core/raster/qgsrasterlayer.h index 699456a4e83..3ed0120a0a0 100644 --- a/src/core/raster/qgsrasterlayer.h +++ b/src/core/raster/qgsrasterlayer.h @@ -1090,35 +1090,18 @@ public: const QStringList & layers = QStringList(), const QStringList & styles = QStringList(), const QString & format = QString(), - const QString & crs = QString(), - const QString & proxyHost = QString(), - int proxyPort = 80, - const QString & proxyUser = QString(), - const QString & proxyPass = QString()); + const QString & crs = QString() + ); void setDataProvider( const QString & provider, const QStringList & layers, const QStringList & styles, const QString & format, - const QString & crs, - const QString & proxyHost, - int proxyPort, - const QString & proxyUser, - const QString & proxyPass ); + const QString & crs); //! Does this layer use a provider for setting/retrieving data? bool usesProvider(); - /** - * Sets a proxy for the path given in the constructor - * - * \retval TRUE if proxy setting is successful (if indeed it is supported) - */ - bool setProxy(const QString & host = 0, - int port = 80, - const QString & user = 0, - const QString & pass = 0); - //! Which provider is being used for this Raster Layer? QString providerKey(); diff --git a/src/providers/wms/qgswmsprovider.cpp b/src/providers/wms/qgswmsprovider.cpp index f3ae84daf7a..b38b9d5acb1 100644 --- a/src/providers/wms/qgswmsprovider.cpp +++ b/src/providers/wms/qgswmsprovider.cpp @@ -51,10 +51,6 @@ static QString DEFAULT_LATLON_CRS = "CRS:84"; QgsWmsProvider::QgsWmsProvider(QString const & uri) : QgsRasterDataProvider(uri), httpuri(uri), - mHttpProxyHost(0), - mHttpProxyPort(80), - mHttpProxyUser(0), - mHttpProxyPass(0), httpcapabilitiesresponse(0), imageCrs(DEFAULT_LATLON_CRS), cachedImage(0), @@ -134,42 +130,6 @@ QgsWmsProvider::~QgsWmsProvider() } -QString QgsWmsProvider::proxyHost() const -{ - return mHttpProxyHost; -} - - -int QgsWmsProvider::proxyPort() const -{ - return mHttpProxyPort; -} - - -QString QgsWmsProvider::proxyUser() const -{ - return mHttpProxyUser; -} - - -QString QgsWmsProvider::proxyPass() const -{ - return mHttpProxyPass; -} - - -bool QgsWmsProvider::setProxy(QString const & host, - int port, - QString const & user, - QString const & pass) -{ - mHttpProxyHost = host; - mHttpProxyPort = port; - mHttpProxyUser = user; - mHttpProxyPass = pass; - - return TRUE; -} bool QgsWmsProvider::supportedLayers(std::vector & layers) { @@ -655,11 +615,7 @@ QByteArray QgsWmsProvider::retrieveUrl(QString url) { QgsDebugMsg("WMS request Url: " + url); QgsHttpTransaction http( - url, - mHttpProxyHost, - mHttpProxyPort, - mHttpProxyUser, - mHttpProxyPass); + url); // Do a passthrough for the status bar text connect( diff --git a/src/providers/wms/qgswmsprovider.h b/src/providers/wms/qgswmsprovider.h index 7c15de5577c..56b1ebb4874 100644 --- a/src/providers/wms/qgswmsprovider.h +++ b/src/providers/wms/qgswmsprovider.h @@ -328,8 +328,6 @@ class QgsCoordinateTransform; interface defined in the QgsDataProvider class to provide access to spatial data residing in a OGC Web Map Service. - TODO: Make it work - */ class QgsWmsProvider : public QgsRasterDataProvider { @@ -342,8 +340,8 @@ public: /** * Constructor for the provider. * - * \param uri HTTP URL of the Web Server. If setProxy() is not also called then we will - * contact the host directly. + * \param uri HTTP URL of the Web Server. If needed a proxy will be used + * otherwise we contact the host directly. * */ QgsWmsProvider(QString const & uri = 0); @@ -351,36 +349,6 @@ public: //! Destructor virtual ~QgsWmsProvider(); - /** - * Gets the HTTP proxy host used for this connection - */ - virtual QString proxyHost() const; - - /** - * Gets the HTTP proxy port used for this connection - */ - virtual int proxyPort() const; - - /** - * Gets the HTTP proxy user name used for this connection - */ - virtual QString proxyUser() const; - - /** - * Gets the HTTP proxy user password used for this connection - */ - virtual QString proxyPass() const; - - /** - * - * Sets an HTTP proxy for the URL given in the constructor - * - */ - virtual bool setProxy(QString const & host = 0, - int port = 80, - QString const & user = 0, - QString const & pass = 0); - /** * \brief Returns a list of the supported layers of the WMS server * @@ -723,18 +691,6 @@ private: //! URL part of URI (httpuri) QString baseUrl; - //! HTTP proxy host name for the WMS for this layer - QString mHttpProxyHost; - - //! HTTP proxy port number for the WMS for this layer - int mHttpProxyPort; - - //! HTTP proxy username for the WMS for this layer - QString mHttpProxyUser; - - //! HTTP proxy password for the WMS for this layer - QString mHttpProxyPass; - /** * Flag indicating if the layer data source is a valid WMS layer */ diff --git a/src/ui/qgsnewhttpconnectionbase.ui b/src/ui/qgsnewhttpconnectionbase.ui index c1233d16c4e..4dd9817e45b 100644 --- a/src/ui/qgsnewhttpconnectionbase.ui +++ b/src/ui/qgsnewhttpconnectionbase.ui @@ -5,12 +5,12 @@ 0 0 - 437 - 256 + 431 + 159 - Create a New WMS connection + Create a new WMS connection true @@ -19,31 +19,22 @@ true - - 9 - - - 6 - - Connection Information + Connection details - - 0 - - - 5 - - - - - QFrame::NoFrame + + + + Name - - QFrame::Plain + + 5 + + + txtName @@ -63,19 +54,6 @@ - - - - Name - - - 5 - - - txtName - - - @@ -89,91 +67,6 @@ - - - - Proxy Host - - - 5 - - - txtProxyHost - - - - - - - Proxy Port - - - 5 - - - txtProxyPort - - - - - - - Proxy User - - - 5 - - - txtProxyUser - - - - - - - Proxy Password - - - 5 - - - txtProxyPass - - - - - - - - 7 - 0 - 1 - 0 - - - - Your user name for the HTTP proxy (optional) - - - - - - - - 7 - 0 - 1 - 0 - - - - Password for your HTTP proxy (optional) - - - QLineEdit::Password - - - @@ -181,104 +74,15 @@ - - - - Name of your HTTP proxy (optional) - - - - - - - - 7 - 0 - 1 - 0 - - - - Port number of your HTTP proxy (optional) - - - 5 - - - - - - - 0 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - 6 - - - - - OK - - - - - - true - - - true - - - - - - - Cancel - - - - - - true - - - - - - - true - - - Help - - - F1 - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 0 - 20 - - - - - + @@ -286,14 +90,40 @@ txtName txtUrl - txtProxyHost - txtProxyPort - txtProxyUser - txtProxyPass - btnOk - btnCancel - btnHelp - + + + buttonBox + accepted() + QgsNewHttpConnectionBase + accept() + + + 403 + 133 + + + 430 + 98 + + + + + buttonBox + rejected() + QgsNewHttpConnectionBase + reject() + + + 312 + 139 + + + 426 + 38 + + + +