Fix issue 662
authorunc0rr
Tue, 15 Oct 2013 22:38:32 +0400
changeset 9547 f9e82f34c904
parent 9545 f7a55d8e8f4d
child 9549 ac5c1f691ce2
Fix issue #662
QTfrontend/gameuiconfig.cpp
QTfrontend/gameuiconfig.h
QTfrontend/ui/widget/roomnameprompt.cpp
--- a/QTfrontend/gameuiconfig.cpp	Tue Oct 15 11:35:46 2013 +0200
+++ b/QTfrontend/gameuiconfig.cpp	Tue Oct 15 22:38:32 2013 +0400
@@ -159,6 +159,8 @@
     Form->ui.pageOptions->leProxyLogin->setText(value("proxy/login", "").toString());
     Form->ui.pageOptions->leProxyPassword->setText(value("proxy/password", "").toString());
 
+    applyProxySettings();
+
     { // load colors
         QStandardItemModel * model = DataManager::instance().colorsModel();
         for(int i = model->rowCount() - 1; i >= 0; --i)
@@ -310,22 +312,7 @@
             setValue("proxy/password", Form->ui.pageOptions->leProxyPassword->text());
         }
 
-        QNetworkProxy proxy;
-
-        if(proxyType == PageOptions::SystemProxy)
-        {
-            // use system proxy settings
-            proxy = QNetworkProxyFactory::systemProxyForQuery().at(0);
-        } else
-        {
-            proxy.setType(proxyTypesMap[proxyType]);
-            proxy.setHostName(Form->ui.pageOptions->leProxy->text());
-            proxy.setPort(Form->ui.pageOptions->sbProxyPort->value());
-            proxy.setUser(Form->ui.pageOptions->leProxyLogin->text());
-            proxy.setPassword(Form->ui.pageOptions->leProxyPassword->text());
-        }
-
-        QNetworkProxy::setApplicationProxy(proxy);
+        applyProxySettings();
     }
 
     { // save colors
@@ -665,3 +652,25 @@
     m_binds[bindID].strbind = strbind;
     setValue(QString("Binds/%1").arg(m_binds[bindID].action), strbind);
 }
+
+void GameUIConfig::applyProxySettings()
+{
+    QNetworkProxy proxy;
+
+    int proxyType = Form->ui.pageOptions->cbProxyType->currentIndex();
+
+    if(proxyType == PageOptions::SystemProxy)
+    {
+        // use system proxy settings
+        proxy = QNetworkProxyFactory::systemProxyForQuery().at(0);
+    } else
+    {
+        proxy.setType(proxyTypesMap[proxyType]);
+        proxy.setHostName(Form->ui.pageOptions->leProxy->text());
+        proxy.setPort(Form->ui.pageOptions->sbProxyPort->value());
+        proxy.setUser(Form->ui.pageOptions->leProxyLogin->text());
+        proxy.setPassword(Form->ui.pageOptions->leProxyPassword->text());
+    }
+
+    QNetworkProxy::setApplicationProxy(proxy);
+}
--- a/QTfrontend/gameuiconfig.h	Tue Oct 15 11:35:46 2013 +0200
+++ b/QTfrontend/gameuiconfig.h	Tue Oct 15 22:38:32 2013 +0400
@@ -99,6 +99,8 @@
         bool eventFilter(QObject *object, QEvent *event);
         QString temphash;
         QList<BindAction> m_binds;
+
+        void applyProxySettings();
 };
 
 #endif
--- a/QTfrontend/ui/widget/roomnameprompt.cpp	Tue Oct 15 11:35:46 2013 +0200
+++ b/QTfrontend/ui/widget/roomnameprompt.cpp	Tue Oct 15 22:38:32 2013 +0400
@@ -57,8 +57,8 @@
     dialogLayout->addWidget(cbSetPassword);
 
     lePassword = new QLineEdit(this);
-    //lePassword->setMaxLength(30);
-    //lePassword->setStyleSheet("QLineEdit { padding: 3px; }");
+    lePassword->setMaxLength(30);
+    lePassword->setStyleSheet("QLineEdit { padding: 3px; }");
     lePassword->setEnabled(false);
     dialogLayout->addWidget(lePassword);