mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Fixed autoconnect(). Fixed not disabling button on autoconnect exception (Fixed Issue 124).
This commit is contained in:
parent
31585f73b1
commit
1e92d061e5
2 changed files with 9 additions and 2 deletions
|
|
@ -243,10 +243,10 @@ public class MageFrame extends javax.swing.JFrame {
|
||||||
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
disableButtons();
|
||||||
if (autoConnect())
|
if (autoConnect())
|
||||||
enableButtons();
|
enableButtons();
|
||||||
else {
|
else {
|
||||||
disableButtons();
|
|
||||||
connectDialog.showDialog();
|
connectDialog.showDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -474,7 +474,7 @@ public class MageFrame extends javax.swing.JFrame {
|
||||||
int port = Integer.parseInt(prefs.get("serverPort", ""));
|
int port = Integer.parseInt(prefs.get("serverPort", ""));
|
||||||
String proxyServer = prefs.get("proxyAddress", "");
|
String proxyServer = prefs.get("proxyAddress", "");
|
||||||
int proxyPort = Integer.parseInt(prefs.get("proxyPort", ""));
|
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", "");
|
String proxyUsername = prefs.get("proxyUsername", "");
|
||||||
try {
|
try {
|
||||||
setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,13 @@ public class Connection {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ProxyType valueByText(String value) {
|
||||||
|
for (ProxyType type : values()) {
|
||||||
|
if (type.text.equals(value)) return type;
|
||||||
|
}
|
||||||
|
return NONE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHost() {
|
public String getHost() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue