mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
* Fixed a bug that some options in preferences were handled with the wrong state as long as never set manually.
This commit is contained in:
parent
f5b411c516
commit
e2453abbb5
2 changed files with 6 additions and 5 deletions
|
@ -2565,6 +2565,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private static void load(Preferences prefs, JCheckBox checkBox, String propName, String yesValue, String defaultValue) {
|
||||
String prop = prefs.get(propName, defaultValue);
|
||||
checkBox.setSelected(prop.equals(yesValue));
|
||||
updateCache(propName, prop);
|
||||
}
|
||||
|
||||
private static void load(Preferences prefs, JTextField field, String propName, String defaultValue) {
|
||||
|
|
|
@ -92,15 +92,15 @@ public class Session {
|
|||
return "User name Admin already in use";
|
||||
}
|
||||
if (userName.length() > ConfigSettings.getInstance().getMaxUserNameLength()) {
|
||||
return new StringBuilder("User name may not be longer than ").append(ConfigSettings.getInstance().getMaxUserNameLength()).append(" characters").toString();
|
||||
return "User name may not be longer than " + ConfigSettings.getInstance().getMaxUserNameLength() + " characters";
|
||||
}
|
||||
if (userName.length() < ConfigSettings.getInstance().getMinUserNameLength()) {
|
||||
return new StringBuilder("User name may not be shorter than ").append(ConfigSettings.getInstance().getMinUserNameLength()).append(" characters").toString();
|
||||
return "User name may not be shorter than " + ConfigSettings.getInstance().getMinUserNameLength() + " characters";
|
||||
}
|
||||
Pattern p = Pattern.compile(ConfigSettings.getInstance().getUserNamePattern(), Pattern.CASE_INSENSITIVE);
|
||||
Matcher m = p.matcher(userName);
|
||||
if (m.find()) {
|
||||
return new StringBuilder("User name '").append(userName).append("' includes not allowed characters: use a-z, A-Z and 0-9").toString();
|
||||
return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9";
|
||||
}
|
||||
User user = UserManager.getInstance().createUser(userName, host);
|
||||
boolean reconnect = false;
|
||||
|
@ -118,11 +118,11 @@ public class Session {
|
|||
SessionManager.getInstance().disconnect(user.getSessionId(), DisconnectReason.ConnectingOtherInstance);
|
||||
}
|
||||
} else {
|
||||
return new StringBuilder("User name ").append(userName).append(" already in use (or your IP address changed)").toString();
|
||||
return "User name " + userName + " already in use (or your IP address changed)";
|
||||
}
|
||||
}
|
||||
if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) {
|
||||
return new StringBuilder("Error connecting ").append(userName).toString();
|
||||
return "Error connecting " + userName;
|
||||
}
|
||||
this.userId = user.getId();
|
||||
if (reconnect) { // must be connected to receive the message
|
||||
|
|
Loading…
Reference in a new issue