From 370d305287ffd63727a6b131cc41e552bac98548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Fri, 20 Mar 2009 14:31:35 +0000 Subject: [PATCH] show found proxy in gui --- proxyface/gui/proxy.hxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/proxyface/gui/proxy.hxx b/proxyface/gui/proxy.hxx index 8ca9ba7..3a986b8 100644 --- a/proxyface/gui/proxy.hxx +++ b/proxyface/gui/proxy.hxx @@ -29,7 +29,7 @@ class Proxy: public QDialog, private Ui::Proxy { QSettings s("SwissSign", "ProxySettings"); _type->setCurrentIndex(s.value("default-type", 0).toInt()); _url->setText(s.value("default-server", QString()).toString()); - _port->setValue(s.value("default-port", 80).toInt()); + _port->setValue(s.value("default-port", 0).toInt()); connect(&_auto, SIGNAL(proxyFound(const QUrl&, const QNetworkProxy&)), SLOT(proxyFound(const QUrl&, const QNetworkProxy&))); accept(); @@ -74,6 +74,27 @@ class Proxy: public QDialog, private Ui::Proxy { void proxyFound(const QUrl&, const QNetworkProxy& p) { QNetworkProxy::setApplicationProxy(p); + _url->setText(p.hostName()); + _port->setValue(p.port()); + qDebug()<<"Auto Proxy Found:" + <<(QNetworkProxy::applicationProxy().type() + ==QNetworkProxy::NoProxy + ?trUtf8("Kein Proxy") + :QNetworkProxy::applicationProxy().type() + ==QNetworkProxy::HttpProxy + ?trUtf8("HTTP:") + :QNetworkProxy::applicationProxy().type() + ==QNetworkProxy::Socks5Proxy + ?trUtf8("Socks5Proxy:") + :trUtf8("System")) + <<(QNetworkProxy::applicationProxy().type() + ==QNetworkProxy::NoProxy || + QNetworkProxy::applicationProxy().type() + ==QNetworkProxy::DefaultProxy + ?QString() + :trUtf8("%1:%2", "proxy host/port") + .arg(QNetworkProxy::applicationProxy().hostName()) + .arg(QNetworkProxy::applicationProxy().port())); } void on__save_clicked(bool=false) {