diff --git a/proxyface/proxy.hxx b/proxyface/proxy.hxx index 3d96fab..8795c1a 100644 --- a/proxyface/proxy.hxx +++ b/proxyface/proxy.hxx @@ -32,7 +32,8 @@ namespace gui { public: Proxy(QString testUrl, QWidget* p=0): - QDialog(p), _lastDefaultProxy(QNetworkProxy()) { + QDialog(p), _lastDefaultProxy(QNetworkProxy()), + _proxyAuth(this), _found(false) { setupUi(this); _testUrl->insertItem(0, testUrl); _internetWait->setMovie(new QMovie(":/icons/indicator.gif")); @@ -138,26 +139,21 @@ namespace gui { void proxyAuthenticationRequired(const QNetworkProxy& p, QAuthenticator* auth) { qDebug()<<"proxyAuthenticationRequired"; - ProxyAuth proxyAuth(this); - proxyAuth._realm->setText(auth->realm()); + _proxyAuth._realm->setText(auth->realm()); _auto.pause(); - if (proxyAuth.exec()==QDialog::Accepted) { - auth->setUser(proxyAuth._username->text()); - auth->setPassword(proxyAuth._password->text()); + if (_found || _proxyAuth.exec()==QDialog::Accepted) { + auth->setUser(_proxyAuth._username->text()); + auth->setPassword(_proxyAuth._password->text()); + _found = false; } _auto.restart(); } void authenticationRequired(QNetworkReply*, QAuthenticator* auth) { - static ProxyAuth proxyAuth(this); - proxyAuth._realm->setText(auth->realm()); - if (proxyAuth.exec()) { - auth->setUser(proxyAuth._username->text()); - auth->setPassword(proxyAuth._password->text()); - } } void proxyFoundSlot(const QUrl&, const QNetworkProxy& p) { + _found = true; _stackInternet->setCurrentIndex(SERVER_FOUND); QNetworkProxy prx(p.type()==QNetworkProxy::DefaultProxy ?QNetworkProxy::applicationProxy():p); @@ -165,6 +161,8 @@ namespace gui { if (!_url->isEnabled()) _url->setText(prx.hostName()); if (!_port->isEnabled()) _port->setValue(prx.port()); if (p.type()==QNetworkProxy::DefaultProxy) return; + prx.setUser(_proxyAuth._username->text()); + prx.setPassword(_proxyAuth._password->text()); QNetworkProxy::setApplicationProxy(prx); } @@ -224,6 +222,8 @@ namespace gui { QString _lastUrl; int _lastPort; QNetworkProxy _lastDefaultProxy; + ProxyAuth _proxyAuth; + bool _found; }; diff --git a/proxyface/proxy.ui b/proxyface/proxy.ui index 4b326a3..1c63c47 100644 --- a/proxyface/proxy.ui +++ b/proxyface/proxy.ui @@ -157,21 +157,6 @@ true - - - http://update.swisssign.com - - - - - http://google.com - - - - - http://heise.de - - @@ -280,7 +265,7 @@ - :/icons/indicator-0.jpg + :/icons/indicator-0.jpg Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse diff --git a/proxyface/proxy_de.ts b/proxyface/proxy_de.ts index bfad948..3262581 100644 --- a/proxyface/proxy_de.ts +++ b/proxyface/proxy_de.ts @@ -58,50 +58,44 @@ Test-URL: - - http://update.swisssign.com - http://update.swisssign.com + http://update.swisssign.com - - http://google.com - http://google.com + http://google.com - - http://heise.de - http://heise.de + http://heise.de - - + + Testen Testen - - + + <span style="color:green;font-size:x-large">✔</span> <span style="color:green;font-size:x-large">✔</span> - - + + Internetverbindung vorhanden Verbindung erfolgreich - - + + <span style="color:red;font-size:x-large">✘</span> <span style="color:red;font-size:x-large">✘</span> - - + + Keine Internetverbindung Verbindung fehlgeschlagen @@ -110,14 +104,14 @@ <span style=" font-size:x-large; color:red;">?</span> - - + + Prüfe Internetverbindung ... Prüfe... - - + + Einstellungen speichern Einstellungen speichern diff --git a/proxyface/proxy_en.ts b/proxyface/proxy_en.ts index 80e529d..ceea774 100644 --- a/proxyface/proxy_en.ts +++ b/proxyface/proxy_en.ts @@ -58,50 +58,44 @@ Test URL: - - http://update.swisssign.com - http://update.swisssign.com + http://update.swisssign.com - - http://google.com - http://google.com + http://google.com - - http://heise.de - http://heise.de + http://heise.de - - + + Testen Test - - + + <span style="color:green;font-size:x-large">✔</span> <span style="color:green;font-size:x-large">✔</span> - - + + Internetverbindung vorhanden Connection successful - - + + <span style="color:red;font-size:x-large">✘</span> <span style="color:red;font-size:x-large">✘</span> - - + + Keine Internetverbindung Connection error @@ -110,14 +104,14 @@ <span style=" font-size:x-large; color:red;">?</span> - - + + Prüfe Internetverbindung ... Checking... - - + + Einstellungen speichern Save settings diff --git a/proxyface/proxy_fr.ts b/proxyface/proxy_fr.ts index 30c9529..6cba13a 100644 --- a/proxyface/proxy_fr.ts +++ b/proxyface/proxy_fr.ts @@ -58,50 +58,44 @@ Test de l'URL: - - http://update.swisssign.com - http://update.swisssign.com + http://update.swisssign.com - - http://google.com - http://google.com + http://google.com - - http://heise.de - http://heise.de + http://heise.de - - + + Testen Tester - - + + <span style="color:green;font-size:x-large">✔</span> <span style="color:green;font-size:x-large">✔</span> - - + + Internetverbindung vorhanden Connexion réussie - - + + <span style="color:red;font-size:x-large">✘</span> <span style="color:red;font-size:x-large">✘</span> - - + + Keine Internetverbindung Erreur de connexion @@ -110,14 +104,14 @@ <span style=" font-size:x-large; color:red;">?</span> - - + + Prüfe Internetverbindung ... Vérification... - - + + Einstellungen speichern Enregistrer les paramètres diff --git a/proxyface/proxy_it.ts b/proxyface/proxy_it.ts index 24c3737..58cb183 100644 --- a/proxyface/proxy_it.ts +++ b/proxyface/proxy_it.ts @@ -58,50 +58,44 @@ Testare URL: - - http://update.swisssign.com - http://update.swisssign.com + http://update.swisssign.com - - http://google.com - http://google.com + http://google.com - - http://heise.de - http://heise.de + http://heise.de - - + + Testen Test - - + + <span style="color:green;font-size:x-large">✔</span> <span style="color:green;font-size:x-large">✔</span> - - + + Internetverbindung vorhanden Connessione riuscita - - + + <span style="color:red;font-size:x-large">✘</span> <span style="color:red;font-size:x-large">✘</span> - - + + Keine Internetverbindung Errore connessione @@ -110,14 +104,14 @@ <span style=" font-size:x-large; color:red;">?</span> - - + + Prüfe Internetverbindung ... Controllo... - - + + Einstellungen speichern Salva impostazioni