Store usrName and password per server. Update input boxes with corresponding values when server is changed in ConnectDialog. Save prefs on successful requests in RegisterUserDialog and ResetPasswordDialog.

This commit is contained in:
Me Car 2016-01-14 18:00:04 +09:00
parent f5765383c7
commit b114c17135
4 changed files with 48 additions and 10 deletions

View file

@ -745,10 +745,13 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
}
private boolean performConnect() {
String userName = prefs.get("userName", "");
String password = prefs.get("password", "");
// TODO: Create MagePreference class to consolidate duplicated preference code in
// MageFrame, ConnectDialog and PreferencesDialog.
String server = prefs.get("serverAddress", "");
int port = Integer.parseInt(prefs.get("serverPort", ""));
// For userName and password we save preference per server.
String userName = prefs.get(server + "/userName", "");
String password = prefs.get(server + "/password", "");
String proxyServer = prefs.get("proxyAddress", "");
int proxyPort = Integer.parseInt(prefs.get("proxyPort", "0"));
ProxyType proxyType = ProxyType.valueByText(prefs.get("proxyType", "None"));