Show the error message from the server on an account creation attempt

cusax-fix
Ingo Bauersachs 12 years ago
parent 6a70e19f41
commit d31b9ee581

@ -997,7 +997,7 @@ plugin.jabberaccregwizz.RESOURCE=Resource
plugin.jabberaccregwizz.AUTORESOURCE=Auto generate resource
plugin.jabberaccregwizz.PRIORITY=Priority
plugin.jabberaccregwizz.XMPP_ERROR=XMPP Error
plugin.jabberaccregwizz.UNKNOWN_XMPP_ERROR=Unknown XMPP error. Verify that the server name is correct.
plugin.jabberaccregwizz.UNKNOWN_XMPP_ERROR=Unknown XMPP error ({0}). Verify that the server name is correct.
plugin.jabberaccregwizz.NOT_SAME_PASSWORD=Your passwords did not match.
plugin.jabberaccregwizz.OVERRIDE_SERVER_DEFAULT_OPTIONS=Override server default options
plugin.jabberaccregwizz.ADVANCED_OPTIONS=Advanced options

@ -168,6 +168,7 @@ private boolean createJabberAccount(String server, int port, String username,
}
catch (XMPPException exc)
{
logger.error(exc);
if (exc.getXMPPError().getCode() == 409)
{
showErrorMessage(Resources.getString(
@ -179,9 +180,12 @@ private boolean createJabberAccount(String server, int port, String username,
}
else
{
showErrorMessage(Resources.getString(
"plugin.jabberaccregwizz.UNKNOWN_XMPP_ERROR"));
showErrorMessage(Resources.getResources().getI18NString(
"plugin.jabberaccregwizz.UNKNOWN_XMPP_ERROR",
new String[]{exc.getMessage()}
));
}
return false;
}
}
@ -274,7 +278,9 @@ private void showErrorMessage(String text)
if (errorPane.getParent() == null)
userIDPassPanel.add(errorPane, BorderLayout.NORTH);
SwingUtilities.getWindowAncestor(this).pack();
Window ancestor = SwingUtilities.getWindowAncestor(this);
if (ancestor != null)
ancestor.pack();
}
/**

Loading…
Cancel
Save