From 6b00bd0f6208f8ff867c3dc153fd58ffe14c667f Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Tue, 19 Jul 2011 13:05:13 +0000 Subject: [PATCH] Moves ZRTP configurations panel in a "ZRTP Ninja" button thus making them available only for advanced users. --- resources/languages/resources.properties | 9 +++ .../impl/neomedia/NeomediaActivator.java | 2 +- .../impl/neomedia/SecurityConfigForm.java | 79 +++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/net/java/sip/communicator/impl/neomedia/SecurityConfigForm.java diff --git a/resources/languages/resources.properties b/resources/languages/resources.properties index 63c6e19b1..48cd45512 100644 --- a/resources/languages/resources.properties +++ b/resources/languages/resources.properties @@ -1047,6 +1047,7 @@ impl.media.security.SECURITY_OFF=Call encryption support off impl.media.security.SECURITY_ON=Call encryption support on # ZRTP Configuration +impl.media.security.zrtp.CONFIG=ZRTP Configuration impl.media.security.zrtp.TITLE=Call impl.media.security.zrtp.PUB_KEYS=Public keys impl.media.security.zrtp.HASHES=Hashes @@ -1057,6 +1058,14 @@ impl.media.security.zrtp.STANDARD=Standard impl.media.security.zrtp.MANDATORY=Mandatory impl.media.security.zrtp.TRUSTED=Trusted MitM impl.media.security.zrtp.SASSIGNATURE=SAS signature processing +impl.media.security.zrtp.DESCRIPTION={0} will automatically try to secure all \ +your calls and you will both hear and see a notification once a secure \ +connection is established. The following button allows ZRTP experts to fine \ +tune the way {0} behaves during ZRTP negotiation and you don't need to modify \ +any of them in order to have secure calls. You should only change these \ +settings if you are well aware of the way ZRTP and encryption in general work. +impl.media.security.zrtp.ZRTP_NINJA=ZRTP Ninja + # Profiler4J plugin.profiler.PLUGIN_NAME=Profiler4j diff --git a/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java b/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java index 0c9d563fb..94c0280d5 100644 --- a/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java +++ b/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java @@ -201,7 +201,7 @@ public void start(BundleContext bundleContext) bundleContext.registerService( ConfigurationForm.class.getName(), new LazyConfigurationForm( - "net.java.sip.communicator.impl.neomedia.ZrtpConfigurePanel", + "net.java.sip.communicator.impl.neomedia.SecurityConfigForm", getClass().getClassLoader(), "impl.media.security.zrtp.CONF_ICON", "impl.media.security.zrtp.TITLE", diff --git a/src/net/java/sip/communicator/impl/neomedia/SecurityConfigForm.java b/src/net/java/sip/communicator/impl/neomedia/SecurityConfigForm.java new file mode 100644 index 000000000..5be6a9ef9 --- /dev/null +++ b/src/net/java/sip/communicator/impl/neomedia/SecurityConfigForm.java @@ -0,0 +1,79 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. See terms of license at gnu.org. + */ +package net.java.sip.communicator.impl.neomedia; + +import java.awt.*; +import java.awt.event.*; + +import javax.swing.*; + +import net.java.sip.communicator.service.resources.*; +import net.java.sip.communicator.util.swing.*; + +/** + * The SecurityConfigForm allows the user to make all needed call + * security configurations. It now wraps the ZRTP form in order to provide some + * more explanations and make complex configurations available only to advanced + * users. + * + * @author Yana Stamcheva + */ +public class SecurityConfigForm + extends TransparentPanel +{ + /** + * Creates an instance of SecurityConfigForm. + */ + public SecurityConfigForm() + { + super(new BorderLayout()); + + this.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); + + final ResourceManagementService resources + = NeomediaActivator.getResources(); + + JPanel mainPanel = new TransparentPanel(new BorderLayout(0, 10)); + add(mainPanel, BorderLayout.NORTH); + + JTextPane pane = new JTextPane(); + pane.setEditable(false); + pane.setOpaque(false); + pane.setText(resources.getI18NString( + "impl.media.security.zrtp.DESCRIPTION", + new String[]{resources.getSettingsString( + "service.gui.APPLICATION_NAME")})); + + mainPanel.add(pane); + + JButton zrtpButton = new JButton( + resources.getI18NString("impl.media.security.zrtp.ZRTP_NINJA")); + + zrtpButton.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + SIPCommDialog zrtpDialog = new SIPCommDialog() + { + @Override + protected void close(boolean escaped) {} + }; + + zrtpDialog.setTitle( + resources.getI18NString("impl.media.security.zrtp.CONFIG")); + zrtpDialog.getContentPane().add(new ZrtpConfigurePanel()); + + zrtpDialog.setVisible(true); + } + }); + + JPanel buttonPanel = new TransparentPanel( + new FlowLayout(FlowLayout.CENTER)); + buttonPanel.add(zrtpButton); + + mainPanel.add(buttonPanel, BorderLayout.SOUTH); + } +} \ No newline at end of file