stores username/password, also removed default urls; closed #13
This commit is contained in:
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -157,21 +157,6 @@
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
@@ -280,7 +265,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="resources.qrc">:/icons/indicator-0.jpg</pixmap>
|
||||
<pixmap>:/icons/indicator-0.jpg</pixmap>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
|
@@ -58,50 +58,44 @@
|
||||
<translation>Test-URL:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="162"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>http://update.swisssign.com</source>
|
||||
<translation>http://update.swisssign.com</translation>
|
||||
<translation type="obsolete">http://update.swisssign.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="167"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source>http://google.com</source>
|
||||
<translation>http://google.com</translation>
|
||||
<translation type="obsolete">http://google.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="172"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>http://heise.de</source>
|
||||
<translation>http://heise.de</translation>
|
||||
<translation type="obsolete">http://heise.de</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="180"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<location filename="proxy.ui" line="165"/>
|
||||
<location filename="ui_proxy.hxx" line="319"/>
|
||||
<source>Testen</source>
|
||||
<translation>Testen</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="208"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<location filename="proxy.ui" line="193"/>
|
||||
<location filename="ui_proxy.hxx" line="320"/>
|
||||
<source><span style="color:green;font-size:x-large">✔</span></source>
|
||||
<translation><span style="color:green;font-size:x-large">✔</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="224"/>
|
||||
<location filename="ui_proxy.hxx" line="327"/>
|
||||
<location filename="proxy.ui" line="209"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>Internetverbindung vorhanden</source>
|
||||
<translation>Verbindung erfolgreich</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="244"/>
|
||||
<location filename="ui_proxy.hxx" line="328"/>
|
||||
<location filename="proxy.ui" line="229"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source><span style="color:red;font-size:x-large">✘</span></source>
|
||||
<translation><span style="color:red;font-size:x-large">✘</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="260"/>
|
||||
<location filename="ui_proxy.hxx" line="329"/>
|
||||
<location filename="proxy.ui" line="245"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>Keine Internetverbindung</source>
|
||||
<translation>Verbindung fehlgeschlagen</translation>
|
||||
</message>
|
||||
@@ -110,14 +104,14 @@
|
||||
<translation type="obsolete"><span style=" font-size:x-large; color:red;">?</span></translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="299"/>
|
||||
<location filename="ui_proxy.hxx" line="331"/>
|
||||
<location filename="proxy.ui" line="284"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<source>Prüfe Internetverbindung ...</source>
|
||||
<translation>Prüfe...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="329"/>
|
||||
<location filename="ui_proxy.hxx" line="332"/>
|
||||
<location filename="proxy.ui" line="314"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<source>Einstellungen speichern</source>
|
||||
<translation>Einstellungen speichern</translation>
|
||||
</message>
|
||||
|
@@ -58,50 +58,44 @@
|
||||
<translation>Test URL:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="162"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>http://update.swisssign.com</source>
|
||||
<translation>http://update.swisssign.com</translation>
|
||||
<translation type="obsolete">http://update.swisssign.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="167"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source>http://google.com</source>
|
||||
<translation>http://google.com</translation>
|
||||
<translation type="obsolete">http://google.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="172"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>http://heise.de</source>
|
||||
<translation>http://heise.de</translation>
|
||||
<translation type="obsolete">http://heise.de</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="180"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<location filename="proxy.ui" line="165"/>
|
||||
<location filename="ui_proxy.hxx" line="319"/>
|
||||
<source>Testen</source>
|
||||
<translation>Test</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="208"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<location filename="proxy.ui" line="193"/>
|
||||
<location filename="ui_proxy.hxx" line="320"/>
|
||||
<source><span style="color:green;font-size:x-large">✔</span></source>
|
||||
<translation><span style="color:green;font-size:x-large">✔</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="224"/>
|
||||
<location filename="ui_proxy.hxx" line="327"/>
|
||||
<location filename="proxy.ui" line="209"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>Internetverbindung vorhanden</source>
|
||||
<translation>Connection successful</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="244"/>
|
||||
<location filename="ui_proxy.hxx" line="328"/>
|
||||
<location filename="proxy.ui" line="229"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source><span style="color:red;font-size:x-large">✘</span></source>
|
||||
<translation><span style="color:red;font-size:x-large">✘</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="260"/>
|
||||
<location filename="ui_proxy.hxx" line="329"/>
|
||||
<location filename="proxy.ui" line="245"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>Keine Internetverbindung</source>
|
||||
<translation>Connection error</translation>
|
||||
</message>
|
||||
@@ -110,14 +104,14 @@
|
||||
<translation type="obsolete"><span style=" font-size:x-large; color:red;">?</span></translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="299"/>
|
||||
<location filename="ui_proxy.hxx" line="331"/>
|
||||
<location filename="proxy.ui" line="284"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<source>Prüfe Internetverbindung ...</source>
|
||||
<translation>Checking...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="329"/>
|
||||
<location filename="ui_proxy.hxx" line="332"/>
|
||||
<location filename="proxy.ui" line="314"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<source>Einstellungen speichern</source>
|
||||
<translation>Save settings</translation>
|
||||
</message>
|
||||
|
@@ -58,50 +58,44 @@
|
||||
<translation>Test de l'URL:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="162"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>http://update.swisssign.com</source>
|
||||
<translation>http://update.swisssign.com</translation>
|
||||
<translation type="obsolete">http://update.swisssign.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="167"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source>http://google.com</source>
|
||||
<translation>http://google.com</translation>
|
||||
<translation type="obsolete">http://google.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="172"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>http://heise.de</source>
|
||||
<translation>http://heise.de</translation>
|
||||
<translation type="obsolete">http://heise.de</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="180"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<location filename="proxy.ui" line="165"/>
|
||||
<location filename="ui_proxy.hxx" line="319"/>
|
||||
<source>Testen</source>
|
||||
<translation>Tester</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="208"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<location filename="proxy.ui" line="193"/>
|
||||
<location filename="ui_proxy.hxx" line="320"/>
|
||||
<source><span style="color:green;font-size:x-large">✔</span></source>
|
||||
<translation><span style="color:green;font-size:x-large">✔</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="224"/>
|
||||
<location filename="ui_proxy.hxx" line="327"/>
|
||||
<location filename="proxy.ui" line="209"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>Internetverbindung vorhanden</source>
|
||||
<translation>Connexion réussie</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="244"/>
|
||||
<location filename="ui_proxy.hxx" line="328"/>
|
||||
<location filename="proxy.ui" line="229"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source><span style="color:red;font-size:x-large">✘</span></source>
|
||||
<translation><span style="color:red;font-size:x-large">✘</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="260"/>
|
||||
<location filename="ui_proxy.hxx" line="329"/>
|
||||
<location filename="proxy.ui" line="245"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>Keine Internetverbindung</source>
|
||||
<translation>Erreur de connexion</translation>
|
||||
</message>
|
||||
@@ -110,14 +104,14 @@
|
||||
<translation type="obsolete"><span style=" font-size:x-large; color:red;">?</span></translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="299"/>
|
||||
<location filename="ui_proxy.hxx" line="331"/>
|
||||
<location filename="proxy.ui" line="284"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<source>Prüfe Internetverbindung ...</source>
|
||||
<translation>Vérification...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="329"/>
|
||||
<location filename="ui_proxy.hxx" line="332"/>
|
||||
<location filename="proxy.ui" line="314"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<source>Einstellungen speichern</source>
|
||||
<translation>Enregistrer les paramètres</translation>
|
||||
</message>
|
||||
|
@@ -58,50 +58,44 @@
|
||||
<translation>Testare URL:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="162"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>http://update.swisssign.com</source>
|
||||
<translation>http://update.swisssign.com</translation>
|
||||
<translation type="obsolete">http://update.swisssign.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="167"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source>http://google.com</source>
|
||||
<translation>http://google.com</translation>
|
||||
<translation type="obsolete">http://google.com</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="172"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>http://heise.de</source>
|
||||
<translation>http://heise.de</translation>
|
||||
<translation type="obsolete">http://heise.de</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="180"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<location filename="proxy.ui" line="165"/>
|
||||
<location filename="ui_proxy.hxx" line="319"/>
|
||||
<source>Testen</source>
|
||||
<translation>Test</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="208"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<location filename="proxy.ui" line="193"/>
|
||||
<location filename="ui_proxy.hxx" line="320"/>
|
||||
<source><span style="color:green;font-size:x-large">✔</span></source>
|
||||
<translation><span style="color:green;font-size:x-large">✔</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="224"/>
|
||||
<location filename="ui_proxy.hxx" line="327"/>
|
||||
<location filename="proxy.ui" line="209"/>
|
||||
<location filename="ui_proxy.hxx" line="321"/>
|
||||
<source>Internetverbindung vorhanden</source>
|
||||
<translation>Connessione riuscita</translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="244"/>
|
||||
<location filename="ui_proxy.hxx" line="328"/>
|
||||
<location filename="proxy.ui" line="229"/>
|
||||
<location filename="ui_proxy.hxx" line="322"/>
|
||||
<source><span style="color:red;font-size:x-large">✘</span></source>
|
||||
<translation><span style="color:red;font-size:x-large">✘</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="260"/>
|
||||
<location filename="ui_proxy.hxx" line="329"/>
|
||||
<location filename="proxy.ui" line="245"/>
|
||||
<location filename="ui_proxy.hxx" line="323"/>
|
||||
<source>Keine Internetverbindung</source>
|
||||
<translation>Errore connessione</translation>
|
||||
</message>
|
||||
@@ -110,14 +104,14 @@
|
||||
<translation type="obsolete"><span style=" font-size:x-large; color:red;">?</span></translation>
|
||||
</message>
|
||||
<message utf8="true">
|
||||
<location filename="proxy.ui" line="299"/>
|
||||
<location filename="ui_proxy.hxx" line="331"/>
|
||||
<location filename="proxy.ui" line="284"/>
|
||||
<location filename="ui_proxy.hxx" line="325"/>
|
||||
<source>Prüfe Internetverbindung ...</source>
|
||||
<translation>Controllo... </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="329"/>
|
||||
<location filename="ui_proxy.hxx" line="332"/>
|
||||
<location filename="proxy.ui" line="314"/>
|
||||
<location filename="ui_proxy.hxx" line="326"/>
|
||||
<source>Einstellungen speichern</source>
|
||||
<translation>Salva impostazioni</translation>
|
||||
</message>
|
||||
|
Reference in New Issue
Block a user