diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index f2246c76fb..1515acd27d 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -243,10 +243,10 @@ public class MageFrame extends javax.swing.JFrame { SwingUtilities.invokeLater(new Runnable() { public void run() { + disableButtons(); if (autoConnect()) enableButtons(); else { - disableButtons(); connectDialog.showDialog(); } } @@ -474,7 +474,7 @@ public class MageFrame extends javax.swing.JFrame { int port = Integer.parseInt(prefs.get("serverPort", "")); String proxyServer = prefs.get("proxyAddress", ""); int proxyPort = Integer.parseInt(prefs.get("proxyPort", "")); - ProxyType proxyType = Connection.ProxyType.valueOf(prefs.get("proxyType", "None")); + ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None")); String proxyUsername = prefs.get("proxyUsername", ""); try { setCursor(new Cursor(Cursor.WAIT_CURSOR)); diff --git a/Mage.Common/src/mage/utils/Connection.java b/Mage.Common/src/mage/utils/Connection.java index 11d7465a40..e00d78740d 100644 --- a/Mage.Common/src/mage/utils/Connection.java +++ b/Mage.Common/src/mage/utils/Connection.java @@ -65,6 +65,13 @@ public class Connection { public String toString() { return text; } + + public static ProxyType valueByText(String value) { + for (ProxyType type : values()) { + if (type.text.equals(value)) return type; + } + return NONE; + } } public String getHost() {