aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/sip2sipaccregwizz
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2011-04-27 15:20:11 +0000
committerYana Stamcheva <yana@jitsi.org>2011-04-27 15:20:11 +0000
commit74c93fae64846395f86d9d75ab3a7aa1eaefa7a0 (patch)
tree50052f95542d58aaf18c5199d79294c12327ca82 /src/net/java/sip/communicator/plugin/sip2sipaccregwizz
parent5c731298ec3396d88f0e55803aa86afee6d12d10 (diff)
downloadjitsi-74c93fae64846395f86d9d75ab3a7aa1eaefa7a0.zip
jitsi-74c93fae64846395f86d9d75ab3a7aa1eaefa7a0.tar.gz
jitsi-74c93fae64846395f86d9d75ab3a7aa1eaefa7a0.tar.bz2
Fixes sip2sip and ippi create account forms (fixed problems in error showing and added a password comparison).
Diffstat (limited to 'src/net/java/sip/communicator/plugin/sip2sipaccregwizz')
-rw-r--r--src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java38
1 files changed, 30 insertions, 8 deletions
diff --git a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java
index ab3ae3b..91504a6 100644
--- a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java
+++ b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java
@@ -16,6 +16,8 @@ import javax.swing.text.*;
import org.json.*;
+import net.java.sip.communicator.plugin.ippiaccregwizz.CreateIppiAccountForm;
+import net.java.sip.communicator.plugin.ippiaccregwizz.IppiAccRegWizzActivator;
import net.java.sip.communicator.plugin.sipaccregwizz.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
@@ -183,6 +185,18 @@ public class CreateSip2SipAccountForm
*/
public NewAccount createAccount()
{
+ // Check if the two passwords match.
+ String pass1 = new String( passField.getPassword());
+ String pass2 = new String( retypePassField.getPassword());
+ if (!pass1.equals(pass2))
+ {
+ showErrorMessage(
+ IppiAccRegWizzActivator.getResources().getI18NString(
+ "plugin.sipaccregwizz.NOT_SAME_PASSWORD"));
+
+ return null;
+ }
+
NewAccount newAccount = null;
try
{
@@ -322,14 +336,7 @@ public class CreateSip2SipAccountForm
}
else
{
- String errorMessage
- = jsonObject.getString("error_message");
-
- errorPane.setText(errorMessage);
- add(errorPane, BorderLayout.NORTH);
-
- SwingUtilities.getWindowAncestor(
- CreateSip2SipAccountForm.this).pack();
+ showErrorMessage(jsonObject.getString("error_message"));
}
}
catch (JSONException e1)
@@ -340,4 +347,19 @@ public class CreateSip2SipAccountForm
return newAccount;
}
+
+ /**
+ * Shows the given error message.
+ *
+ * @param text the text of the error
+ */
+ private void showErrorMessage(String text)
+ {
+ errorPane.setText(text);
+
+ if (errorPane.getParent() == null)
+ add(errorPane, BorderLayout.NORTH);
+
+ SwingUtilities.getWindowAncestor(CreateSip2SipAccountForm.this).pack();
+ }
}