stores username/password, also removed default urls; closed #13

master
Marc Wäckerlin 14 years ago
parent 3f9bfde245
commit 0f8fd2dc4e
  1. 24
      proxyface/proxy.hxx
  2. 17
      proxyface/proxy.ui
  3. 40
      proxyface/proxy_de.ts
  4. 40
      proxyface/proxy_en.ts
  5. 40
      proxyface/proxy_fr.ts
  6. 40
      proxyface/proxy_it.ts

@ -32,7 +32,8 @@ namespace gui {
public: public:
Proxy(QString testUrl, QWidget* p=0): Proxy(QString testUrl, QWidget* p=0):
QDialog(p), _lastDefaultProxy(QNetworkProxy()) { QDialog(p), _lastDefaultProxy(QNetworkProxy()),
_proxyAuth(this), _found(false) {
setupUi(this); setupUi(this);
_testUrl->insertItem(0, testUrl); _testUrl->insertItem(0, testUrl);
_internetWait->setMovie(new QMovie(":/icons/indicator.gif")); _internetWait->setMovie(new QMovie(":/icons/indicator.gif"));
@ -138,26 +139,21 @@ namespace gui {
void proxyAuthenticationRequired(const QNetworkProxy& p, void proxyAuthenticationRequired(const QNetworkProxy& p,
QAuthenticator* auth) { QAuthenticator* auth) {
qDebug()<<"proxyAuthenticationRequired"; qDebug()<<"proxyAuthenticationRequired";
ProxyAuth proxyAuth(this); _proxyAuth._realm->setText(auth->realm());
proxyAuth._realm->setText(auth->realm());
_auto.pause(); _auto.pause();
if (proxyAuth.exec()==QDialog::Accepted) { if (_found || _proxyAuth.exec()==QDialog::Accepted) {
auth->setUser(proxyAuth._username->text()); auth->setUser(_proxyAuth._username->text());
auth->setPassword(proxyAuth._password->text()); auth->setPassword(_proxyAuth._password->text());
_found = false;
} }
_auto.restart(); _auto.restart();
} }
void authenticationRequired(QNetworkReply*, QAuthenticator* auth) { 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) { void proxyFoundSlot(const QUrl&, const QNetworkProxy& p) {
_found = true;
_stackInternet->setCurrentIndex(SERVER_FOUND); _stackInternet->setCurrentIndex(SERVER_FOUND);
QNetworkProxy prx(p.type()==QNetworkProxy::DefaultProxy QNetworkProxy prx(p.type()==QNetworkProxy::DefaultProxy
?QNetworkProxy::applicationProxy():p); ?QNetworkProxy::applicationProxy():p);
@ -165,6 +161,8 @@ namespace gui {
if (!_url->isEnabled()) _url->setText(prx.hostName()); if (!_url->isEnabled()) _url->setText(prx.hostName());
if (!_port->isEnabled()) _port->setValue(prx.port()); if (!_port->isEnabled()) _port->setValue(prx.port());
if (p.type()==QNetworkProxy::DefaultProxy) return; if (p.type()==QNetworkProxy::DefaultProxy) return;
prx.setUser(_proxyAuth._username->text());
prx.setPassword(_proxyAuth._password->text());
QNetworkProxy::setApplicationProxy(prx); QNetworkProxy::setApplicationProxy(prx);
} }
@ -224,6 +222,8 @@ namespace gui {
QString _lastUrl; QString _lastUrl;
int _lastPort; int _lastPort;
QNetworkProxy _lastDefaultProxy; QNetworkProxy _lastDefaultProxy;
ProxyAuth _proxyAuth;
bool _found;
}; };

@ -157,21 +157,6 @@
<property name="editable"> <property name="editable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<item>
<property name="text">
<string>http://update.swisssign.com</string>
</property>
</item>
<item>
<property name="text">
<string>http://google.com</string>
</property>
</item>
<item>
<property name="text">
<string>http://heise.de</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item> <item>
@ -280,7 +265,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="resources.qrc">:/icons/indicator-0.jpg</pixmap> <pixmap>:/icons/indicator-0.jpg</pixmap>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>

@ -58,50 +58,44 @@
<translation>Test-URL:</translation> <translation>Test-URL:</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="162"/>
<location filename="ui_proxy.hxx" line="321"/>
<source>http://update.swisssign.com</source> <source>http://update.swisssign.com</source>
<translation>http://update.swisssign.com</translation> <translation type="obsolete">http://update.swisssign.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="167"/>
<location filename="ui_proxy.hxx" line="322"/>
<source>http://google.com</source> <source>http://google.com</source>
<translation>http://google.com</translation> <translation type="obsolete">http://google.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="172"/>
<location filename="ui_proxy.hxx" line="323"/>
<source>http://heise.de</source> <source>http://heise.de</source>
<translation>http://heise.de</translation> <translation type="obsolete">http://heise.de</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="180"/> <location filename="proxy.ui" line="165"/>
<location filename="ui_proxy.hxx" line="325"/> <location filename="ui_proxy.hxx" line="319"/>
<source>Testen</source> <source>Testen</source>
<translation>Testen</translation> <translation>Testen</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="208"/> <location filename="proxy.ui" line="193"/>
<location filename="ui_proxy.hxx" line="326"/> <location filename="ui_proxy.hxx" line="320"/>
<source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="224"/> <location filename="proxy.ui" line="209"/>
<location filename="ui_proxy.hxx" line="327"/> <location filename="ui_proxy.hxx" line="321"/>
<source>Internetverbindung vorhanden</source> <source>Internetverbindung vorhanden</source>
<translation>Verbindung erfolgreich</translation> <translation>Verbindung erfolgreich</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="244"/> <location filename="proxy.ui" line="229"/>
<location filename="ui_proxy.hxx" line="328"/> <location filename="ui_proxy.hxx" line="322"/>
<source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="260"/> <location filename="proxy.ui" line="245"/>
<location filename="ui_proxy.hxx" line="329"/> <location filename="ui_proxy.hxx" line="323"/>
<source>Keine Internetverbindung</source> <source>Keine Internetverbindung</source>
<translation>Verbindung fehlgeschlagen</translation> <translation>Verbindung fehlgeschlagen</translation>
</message> </message>
@ -110,14 +104,14 @@
<translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation> <translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="299"/> <location filename="proxy.ui" line="284"/>
<location filename="ui_proxy.hxx" line="331"/> <location filename="ui_proxy.hxx" line="325"/>
<source>Prüfe Internetverbindung ...</source> <source>Prüfe Internetverbindung ...</source>
<translation>Prüfe...</translation> <translation>Prüfe...</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="329"/> <location filename="proxy.ui" line="314"/>
<location filename="ui_proxy.hxx" line="332"/> <location filename="ui_proxy.hxx" line="326"/>
<source>Einstellungen speichern</source> <source>Einstellungen speichern</source>
<translation>Einstellungen speichern</translation> <translation>Einstellungen speichern</translation>
</message> </message>

@ -58,50 +58,44 @@
<translation>Test URL:</translation> <translation>Test URL:</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="162"/>
<location filename="ui_proxy.hxx" line="321"/>
<source>http://update.swisssign.com</source> <source>http://update.swisssign.com</source>
<translation>http://update.swisssign.com</translation> <translation type="obsolete">http://update.swisssign.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="167"/>
<location filename="ui_proxy.hxx" line="322"/>
<source>http://google.com</source> <source>http://google.com</source>
<translation>http://google.com</translation> <translation type="obsolete">http://google.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="172"/>
<location filename="ui_proxy.hxx" line="323"/>
<source>http://heise.de</source> <source>http://heise.de</source>
<translation>http://heise.de</translation> <translation type="obsolete">http://heise.de</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="180"/> <location filename="proxy.ui" line="165"/>
<location filename="ui_proxy.hxx" line="325"/> <location filename="ui_proxy.hxx" line="319"/>
<source>Testen</source> <source>Testen</source>
<translation>Test</translation> <translation>Test</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="208"/> <location filename="proxy.ui" line="193"/>
<location filename="ui_proxy.hxx" line="326"/> <location filename="ui_proxy.hxx" line="320"/>
<source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="224"/> <location filename="proxy.ui" line="209"/>
<location filename="ui_proxy.hxx" line="327"/> <location filename="ui_proxy.hxx" line="321"/>
<source>Internetverbindung vorhanden</source> <source>Internetverbindung vorhanden</source>
<translation>Connection successful</translation> <translation>Connection successful</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="244"/> <location filename="proxy.ui" line="229"/>
<location filename="ui_proxy.hxx" line="328"/> <location filename="ui_proxy.hxx" line="322"/>
<source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="260"/> <location filename="proxy.ui" line="245"/>
<location filename="ui_proxy.hxx" line="329"/> <location filename="ui_proxy.hxx" line="323"/>
<source>Keine Internetverbindung</source> <source>Keine Internetverbindung</source>
<translation>Connection error</translation> <translation>Connection error</translation>
</message> </message>
@ -110,14 +104,14 @@
<translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation> <translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="299"/> <location filename="proxy.ui" line="284"/>
<location filename="ui_proxy.hxx" line="331"/> <location filename="ui_proxy.hxx" line="325"/>
<source>Prüfe Internetverbindung ...</source> <source>Prüfe Internetverbindung ...</source>
<translation>Checking...</translation> <translation>Checking...</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="329"/> <location filename="proxy.ui" line="314"/>
<location filename="ui_proxy.hxx" line="332"/> <location filename="ui_proxy.hxx" line="326"/>
<source>Einstellungen speichern</source> <source>Einstellungen speichern</source>
<translation>Save settings</translation> <translation>Save settings</translation>
</message> </message>

@ -58,50 +58,44 @@
<translation>Test de l&apos;URL:</translation> <translation>Test de l&apos;URL:</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="162"/>
<location filename="ui_proxy.hxx" line="321"/>
<source>http://update.swisssign.com</source> <source>http://update.swisssign.com</source>
<translation>http://update.swisssign.com</translation> <translation type="obsolete">http://update.swisssign.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="167"/>
<location filename="ui_proxy.hxx" line="322"/>
<source>http://google.com</source> <source>http://google.com</source>
<translation>http://google.com</translation> <translation type="obsolete">http://google.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="172"/>
<location filename="ui_proxy.hxx" line="323"/>
<source>http://heise.de</source> <source>http://heise.de</source>
<translation>http://heise.de</translation> <translation type="obsolete">http://heise.de</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="180"/> <location filename="proxy.ui" line="165"/>
<location filename="ui_proxy.hxx" line="325"/> <location filename="ui_proxy.hxx" line="319"/>
<source>Testen</source> <source>Testen</source>
<translation>Tester</translation> <translation>Tester</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="208"/> <location filename="proxy.ui" line="193"/>
<location filename="ui_proxy.hxx" line="326"/> <location filename="ui_proxy.hxx" line="320"/>
<source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="224"/> <location filename="proxy.ui" line="209"/>
<location filename="ui_proxy.hxx" line="327"/> <location filename="ui_proxy.hxx" line="321"/>
<source>Internetverbindung vorhanden</source> <source>Internetverbindung vorhanden</source>
<translation>Connexion réussie</translation> <translation>Connexion réussie</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="244"/> <location filename="proxy.ui" line="229"/>
<location filename="ui_proxy.hxx" line="328"/> <location filename="ui_proxy.hxx" line="322"/>
<source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="260"/> <location filename="proxy.ui" line="245"/>
<location filename="ui_proxy.hxx" line="329"/> <location filename="ui_proxy.hxx" line="323"/>
<source>Keine Internetverbindung</source> <source>Keine Internetverbindung</source>
<translation>Erreur de connexion</translation> <translation>Erreur de connexion</translation>
</message> </message>
@ -110,14 +104,14 @@
<translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation> <translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="299"/> <location filename="proxy.ui" line="284"/>
<location filename="ui_proxy.hxx" line="331"/> <location filename="ui_proxy.hxx" line="325"/>
<source>Prüfe Internetverbindung ...</source> <source>Prüfe Internetverbindung ...</source>
<translation>Vérification...</translation> <translation>Vérification...</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="329"/> <location filename="proxy.ui" line="314"/>
<location filename="ui_proxy.hxx" line="332"/> <location filename="ui_proxy.hxx" line="326"/>
<source>Einstellungen speichern</source> <source>Einstellungen speichern</source>
<translation>Enregistrer les paramètres</translation> <translation>Enregistrer les paramètres</translation>
</message> </message>

@ -58,50 +58,44 @@
<translation>Testare URL:</translation> <translation>Testare URL:</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="162"/>
<location filename="ui_proxy.hxx" line="321"/>
<source>http://update.swisssign.com</source> <source>http://update.swisssign.com</source>
<translation>http://update.swisssign.com</translation> <translation type="obsolete">http://update.swisssign.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="167"/>
<location filename="ui_proxy.hxx" line="322"/>
<source>http://google.com</source> <source>http://google.com</source>
<translation>http://google.com</translation> <translation type="obsolete">http://google.com</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="172"/>
<location filename="ui_proxy.hxx" line="323"/>
<source>http://heise.de</source> <source>http://heise.de</source>
<translation>http://heise.de</translation> <translation type="obsolete">http://heise.de</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="180"/> <location filename="proxy.ui" line="165"/>
<location filename="ui_proxy.hxx" line="325"/> <location filename="ui_proxy.hxx" line="319"/>
<source>Testen</source> <source>Testen</source>
<translation>Test</translation> <translation>Test</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="208"/> <location filename="proxy.ui" line="193"/>
<location filename="ui_proxy.hxx" line="326"/> <location filename="ui_proxy.hxx" line="320"/>
<source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:green;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="224"/> <location filename="proxy.ui" line="209"/>
<location filename="ui_proxy.hxx" line="327"/> <location filename="ui_proxy.hxx" line="321"/>
<source>Internetverbindung vorhanden</source> <source>Internetverbindung vorhanden</source>
<translation>Connessione riuscita</translation> <translation>Connessione riuscita</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="244"/> <location filename="proxy.ui" line="229"/>
<location filename="ui_proxy.hxx" line="328"/> <location filename="ui_proxy.hxx" line="322"/>
<source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source> <source>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</source>
<translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation> <translation>&lt;span style=&quot;color:red;font-size:x-large&quot;&gt;&lt;/span&gt;</translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="260"/> <location filename="proxy.ui" line="245"/>
<location filename="ui_proxy.hxx" line="329"/> <location filename="ui_proxy.hxx" line="323"/>
<source>Keine Internetverbindung</source> <source>Keine Internetverbindung</source>
<translation>Errore connessione</translation> <translation>Errore connessione</translation>
</message> </message>
@ -110,14 +104,14 @@
<translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation> <translation type="obsolete">&lt;span style=&quot; font-size:x-large; color:red;&quot;&gt;?&lt;/span&gt;</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<location filename="proxy.ui" line="299"/> <location filename="proxy.ui" line="284"/>
<location filename="ui_proxy.hxx" line="331"/> <location filename="ui_proxy.hxx" line="325"/>
<source>Prüfe Internetverbindung ...</source> <source>Prüfe Internetverbindung ...</source>
<translation>Controllo... </translation> <translation>Controllo... </translation>
</message> </message>
<message> <message>
<location filename="proxy.ui" line="329"/> <location filename="proxy.ui" line="314"/>
<location filename="ui_proxy.hxx" line="332"/> <location filename="ui_proxy.hxx" line="326"/>
<source>Einstellungen speichern</source> <source>Einstellungen speichern</source>
<translation>Salva impostazioni</translation> <translation>Salva impostazioni</translation>
</message> </message>

Loading…
Cancel
Save