aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin
diff options
context:
space:
mode:
authorSebastien Vincent <seb@jitsi.org>2011-08-23 14:04:43 +0000
committerSebastien Vincent <seb@jitsi.org>2011-08-23 14:04:43 +0000
commit6e080f08a2d95ca398ee6ce15dd34f5211b82c58 (patch)
treeffc9a81dee6b1348223f1452808b0f2eb5ea8f09 /src/net/java/sip/communicator/plugin
parentc4183ff560b6895eed58c4113d7dd8a268302b0d (diff)
downloadjitsi-6e080f08a2d95ca398ee6ce15dd34f5211b82c58.zip
jitsi-6e080f08a2d95ca398ee6ce15dd34f5211b82c58.tar.gz
jitsi-6e080f08a2d95ca398ee6ce15dd34f5211b82c58.tar.bz2
Adds the possibility to specify a default telephony domain name for XMPP (used when we want to call a XMPP contact without domain name). Adds also the possibility to specify a domain name to have default GTalk voice capabilities.
Diffstat (limited to 'src/net/java/sip/communicator/plugin')
-rwxr-xr-xsrc/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java25
-rw-r--r--src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java19
-rw-r--r--src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java8
-rw-r--r--src/net/java/sip/communicator/plugin/jabberaccregwizz/TelephonyConfigPanel.java126
4 files changed, 177 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java
index 01636a7..743ff37 100755
--- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java
+++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistration.java
@@ -86,6 +86,11 @@ public class JabberAccountRegistration
private boolean bypassGtalkCaps = false;
/**
+ * Domain name that will bypass GTalk caps.
+ */
+ private String domainBypassCaps = null;
+
+ /**
* The port.
*/
private int port = new Integer(DEFAULT_PORT).intValue();
@@ -249,6 +254,16 @@ public class JabberAccountRegistration
}
/**
+ * Returns telephony domain that bypass GTalk caps.
+ *
+ * @return telephony domain
+ */
+ public String getTelephonyDomainBypassCaps()
+ {
+ return domainBypassCaps;
+ }
+
+ /**
* The address of the server we will use for this account
* @return String
*/
@@ -343,6 +358,16 @@ public class JabberAccountRegistration
}
/**
+ * Sets telephony domain that bypass GTalk caps.
+ *
+ * @param text telephony domain to set
+ */
+ public void setTelephonyDomainBypassCaps(String text)
+ {
+ this.domainBypassCaps = text;
+ }
+
+ /**
* Sets the server
*
* @param serverAddress the IP address or FQDN of the server.
diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java
index 30a5aa5..af5b718 100644
--- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java
+++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java
@@ -29,6 +29,8 @@ public class JabberAccountRegistrationForm
private final IceConfigPanel iceConfigPanel;
+ private final TelephonyConfigPanel telephonyConfigPanel;
+
private boolean isModification;
private final JabberAccountRegistrationWizard wizard;
@@ -56,6 +58,8 @@ public class JabberAccountRegistrationForm
connectionPanel = new ConnectionPanel(this);
iceConfigPanel = new IceConfigPanel();
+
+ telephonyConfigPanel = new TelephonyConfigPanel();
}
/**
@@ -87,6 +91,10 @@ public class JabberAccountRegistrationForm
tabbedPane.addTab(Resources.getString("service.gui.ICE"),
iceConfigPanel);
+ if (telephonyConfigPanel.getParent() != tabbedPane)
+ tabbedPane.addTab(Resources.getString("service.gui.TELEPHONY"),
+ telephonyConfigPanel);
+
if (tabbedPane.getParent() != this)
this.add(tabbedPane, BorderLayout.NORTH);
@@ -308,6 +316,10 @@ public class JabberAccountRegistrationForm
registration.setUseUPNP(iceConfigPanel.isUseUPNP());
+ registration.setTelephonyDomainBypassCaps(
+ telephonyConfigPanel.getTelephonyDomainBypassCaps());
+ registration.setOverridePhoneSufix(
+ telephonyConfigPanel.getTelephonyDomain());
return true;
}
@@ -486,6 +498,13 @@ public class JabberAccountRegistrationForm
accountID.getAccountPropertyBoolean(
ProtocolProviderFactory.IS_SERVER_OVERRIDDEN,
false));
+
+ String telephonyDomain = accountProperties.get("OVERRIDE_PHONE_SUFFIX");
+ telephonyConfigPanel.setTelephonyDomain(telephonyDomain);
+
+ String bypassCapsDomain = accountProperties.get(
+ "TELEPHONY_BYPASS_GTALK_CAPS");
+ telephonyConfigPanel.setTelephonyDomainBypassCaps(bypassCapsDomain);
}
/**
diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java
index d50b77a..d40a345 100644
--- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java
+++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java
@@ -333,9 +333,15 @@ public class JabberAccountRegistrationWizard
registration.getOverridePhoneSuffix());
}
- accountProperties.put("BYPASS_GTALK_PROPERTIES",
+ accountProperties.put("BYPASS_GTALK_CAPABILITIES",
String.valueOf(registration.getBypassGtalkCaps()));
+ if(registration.getTelephonyDomainBypassCaps() != null)
+ {
+ accountProperties.put("TELEPHONY_BYPASS_GTALK_CAPS",
+ registration.getTelephonyDomainBypassCaps());
+ }
+
accountProperties.put(ProtocolProviderFactory.SERVER_ADDRESS,
serverName);
diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/TelephonyConfigPanel.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/TelephonyConfigPanel.java
new file mode 100644
index 0000000..db8b8db
--- /dev/null
+++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/TelephonyConfigPanel.java
@@ -0,0 +1,126 @@
+/*
+ * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.plugin.jabberaccregwizz;
+
+import java.awt.*;
+
+import javax.swing.*;
+
+import net.java.sip.communicator.util.swing.*;
+
+/**
+ * Telephony related configuration panel.
+ *
+ * @author Sebastien Vincent
+ */
+public class TelephonyConfigPanel
+ extends TransparentPanel
+{
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Text field for domain name.
+ */
+ private final JTextField domainField = new TrimTextField();
+
+ /**
+ * Text field for domain name.
+ */
+ private final JTextField domainBypassCapsField = new TrimTextField();
+
+ /**
+ * Main panel.
+ */
+ private final TransparentPanel mainPanel = new TransparentPanel();
+
+ private final JPanel lblPanel
+ = new TransparentPanel(new GridLayout(0, 1, 10, 10));
+
+ private final JPanel valPanel
+ = new TransparentPanel(new GridLayout(0, 1, 10, 10));
+
+ private final JPanel telPanel
+ = new TransparentPanel(new BorderLayout(10, 10));
+
+ /**
+ * Constructor.
+ */
+ public TelephonyConfigPanel()
+ {
+ super(new BorderLayout());
+
+ mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
+
+ JLabel domainLbl = new JLabel(
+ Resources.getString("plugin.jabberaccregwizz.TELEPHONY_DOMAIN"));
+ JLabel gtalkCallLbl = new JLabel(
+ Resources.getString(
+ "plugin.jabberaccregwizz.DOMAIN_BYPASS_CAPS"));
+
+ /*
+ panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
+ panel.add(domainLbl);
+ panel.add(domainField);
+ panel.add(gtalkCallLbl);
+
+ add(panel);
+ */
+ lblPanel.add(domainLbl);
+ lblPanel.add(gtalkCallLbl);
+ valPanel.add(domainField);
+ valPanel.add(domainBypassCapsField);
+ telPanel.add(lblPanel, BorderLayout.WEST);
+ telPanel.add(valPanel, BorderLayout.CENTER);
+
+ mainPanel.add(telPanel);
+
+ add(mainPanel, BorderLayout.NORTH);
+ }
+
+ /**
+ * Returns telephony domain.
+ *
+ * @return telephony domain
+ */
+ public String getTelephonyDomain()
+ {
+ return domainField.getText();
+ }
+
+ /**
+ * Sets telephony domain.
+ *
+ * @param text telephony domain to set
+ */
+ public void setTelephonyDomain(String text)
+ {
+ domainField.setText(text);
+ }
+
+ /**
+ * Returns telephony domain that bypass GTalk caps.
+ *
+ * @return telephony domain
+ */
+ public String getTelephonyDomainBypassCaps()
+ {
+ return domainBypassCapsField.getText();
+ }
+
+ /**
+ * Sets telephony domain that bypass GTalk caps.
+ *
+ * @param text telephony domain to set
+ */
+ public void setTelephonyDomainBypassCaps(String text)
+ {
+ domainBypassCapsField.setText(text);
+ }
+}