From SwissStick-Ticket #150: Fallback for Proxy Configuration - If the configured proxy can't be found, try detection

master
Marc Wäckerlin 15 years ago
parent 97b41e1277
commit a563d8995a
  1. 40
      proxyface/proxy.hxx
  2. 20
      proxyface/proxy_de.ts
  3. 20
      proxyface/proxy_en.ts
  4. 20
      proxyface/proxy_fr.ts
  5. 20
      proxyface/proxy_it.ts

@ -53,32 +53,13 @@ namespace gui {
_url->setEnabled(false); _url->setEnabled(false);
_port->setEnabled(false); _port->setEnabled(false);
type=QNetworkProxy::NoProxy; type=QNetworkProxy::NoProxy;
_auto.proxy(_testUrl);
} catch (...) {} break; } catch (...) {} break;
case 1: type=QNetworkProxy::HttpProxy; break; case 1: type=QNetworkProxy::HttpProxy; break;
case 2: type=QNetworkProxy::Socks5Proxy; break; case 2: type=QNetworkProxy::Socks5Proxy; break;
} }
QNetworkProxy::setApplicationProxy QNetworkProxy::setApplicationProxy
(QNetworkProxy(type, _url->text(), _port->value())); (QNetworkProxy(type, _url->text(), _port->value()));
qDebug()<<"Proxy:" _auto.proxy(_testUrl);
<<(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()));
} }
Q_SIGNALS: Q_SIGNALS:
@ -92,25 +73,6 @@ namespace gui {
QNetworkProxy::setApplicationProxy(p); QNetworkProxy::setApplicationProxy(p);
_url->setText(p.hostName()); _url->setText(p.hostName());
_port->setValue(p.port()); _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__type_currentIndexChanged(int index) { void on__type_currentIndexChanged(int index) {

@ -63,35 +63,25 @@
<context> <context>
<name>gui::Proxy</name> <name>gui::Proxy</name>
<message> <message>
<location filename="proxy.hxx" line="66"/>
<location filename="proxy.hxx" line="98"/>
<source>Kein Proxy</source> <source>Kein Proxy</source>
<translation>Kein Proxy</translation> <translation type="obsolete">Kein Proxy</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="69"/>
<location filename="proxy.hxx" line="101"/>
<source>HTTP:</source> <source>HTTP:</source>
<translation>HTTP:</translation> <translation type="obsolete">HTTP:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="72"/>
<location filename="proxy.hxx" line="104"/>
<source>Socks5Proxy:</source> <source>Socks5Proxy:</source>
<translation>Socks5Proxy:</translation> <translation type="obsolete">Socks5Proxy:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="73"/>
<location filename="proxy.hxx" line="105"/>
<source>System</source> <source>System</source>
<translation>System</translation> <translation type="obsolete">System</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="79"/>
<location filename="proxy.hxx" line="111"/>
<source>%1:%2</source> <source>%1:%2</source>
<comment>proxy host/port</comment> <comment>proxy host/port</comment>
<translation>%1:%2</translation> <translation type="obsolete">%1:%2</translation>
</message> </message>
</context> </context>
</TS> </TS>

@ -63,35 +63,25 @@
<context> <context>
<name>gui::Proxy</name> <name>gui::Proxy</name>
<message> <message>
<location filename="proxy.hxx" line="66"/>
<location filename="proxy.hxx" line="98"/>
<source>Kein Proxy</source> <source>Kein Proxy</source>
<translation>No proxy</translation> <translation type="obsolete">No proxy</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="69"/>
<location filename="proxy.hxx" line="101"/>
<source>HTTP:</source> <source>HTTP:</source>
<translation>HTTP:</translation> <translation type="obsolete">HTTP:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="72"/>
<location filename="proxy.hxx" line="104"/>
<source>Socks5Proxy:</source> <source>Socks5Proxy:</source>
<translation>Socks5Proxy:</translation> <translation type="obsolete">Socks5Proxy:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="73"/>
<location filename="proxy.hxx" line="105"/>
<source>System</source> <source>System</source>
<translation>System</translation> <translation type="obsolete">System</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="79"/>
<location filename="proxy.hxx" line="111"/>
<source>%1:%2</source> <source>%1:%2</source>
<comment>proxy host/port</comment> <comment>proxy host/port</comment>
<translation>%1:%2</translation> <translation type="obsolete">%1:%2</translation>
</message> </message>
</context> </context>
</TS> </TS>

@ -63,35 +63,25 @@
<context> <context>
<name>gui::Proxy</name> <name>gui::Proxy</name>
<message> <message>
<location filename="proxy.hxx" line="66"/>
<location filename="proxy.hxx" line="98"/>
<source>Kein Proxy</source> <source>Kein Proxy</source>
<translation>Pas de Proxy</translation> <translation type="obsolete">Pas de Proxy</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="69"/>
<location filename="proxy.hxx" line="101"/>
<source>HTTP:</source> <source>HTTP:</source>
<translation>HTTP:</translation> <translation type="obsolete">HTTP:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="72"/>
<location filename="proxy.hxx" line="104"/>
<source>Socks5Proxy:</source> <source>Socks5Proxy:</source>
<translation>Socks5Proxy:</translation> <translation type="obsolete">Socks5Proxy:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="73"/>
<location filename="proxy.hxx" line="105"/>
<source>System</source> <source>System</source>
<translation>Système</translation> <translation type="obsolete">Système</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="79"/>
<location filename="proxy.hxx" line="111"/>
<source>%1:%2</source> <source>%1:%2</source>
<comment>proxy host/port</comment> <comment>proxy host/port</comment>
<translation>%1:%2</translation> <translation type="obsolete">%1:%2</translation>
</message> </message>
</context> </context>
</TS> </TS>

@ -63,35 +63,25 @@
<context> <context>
<name>gui::Proxy</name> <name>gui::Proxy</name>
<message> <message>
<location filename="proxy.hxx" line="66"/>
<location filename="proxy.hxx" line="98"/>
<source>Kein Proxy</source> <source>Kein Proxy</source>
<translation>Senza Proxy</translation> <translation type="obsolete">Senza Proxy</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="69"/>
<location filename="proxy.hxx" line="101"/>
<source>HTTP:</source> <source>HTTP:</source>
<translation>HTTP:</translation> <translation type="obsolete">HTTP:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="72"/>
<location filename="proxy.hxx" line="104"/>
<source>Socks5Proxy:</source> <source>Socks5Proxy:</source>
<translation>Socks5Proxy:</translation> <translation type="obsolete">Socks5Proxy:</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="73"/>
<location filename="proxy.hxx" line="105"/>
<source>System</source> <source>System</source>
<translation>Sistema</translation> <translation type="obsolete">Sistema</translation>
</message> </message>
<message> <message>
<location filename="proxy.hxx" line="79"/>
<location filename="proxy.hxx" line="111"/>
<source>%1:%2</source> <source>%1:%2</source>
<comment>proxy host/port</comment> <comment>proxy host/port</comment>
<translation>%1:%2</translation> <translation type="obsolete">%1:%2</translation>
</message> </message>
</context> </context>
</TS> </TS>

Loading…
Cancel
Save