From 6104713520d64ecdddfa2a3c8e822a272aa4011c Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Fri, 23 Nov 2012 16:06:36 +0000 Subject: [PATCH] Adds property to disable video bridge menu and functionality. Patch contributed by Tom Denham. --- .../impl/gui/main/menus/ToolsMenu.java | 8 ++++++++ .../ProtocolProviderServiceJabberImpl.java | 18 ++++++++++++++---- .../plugin/update/UpdateActivator.java | 6 +++--- .../protocol/OperationSetVideoBridge.java | 7 +++++++ 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java b/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java index 83f48aa77..598d2f973 100644 --- a/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java @@ -422,6 +422,14 @@ private List getVideoBridgeProviders() */ private void initVideoBridgeMenu() { + // If video bridge is enabled in the config then add the menu item + if (GuiActivator.getConfigurationService() + .getBoolean(OperationSetVideoBridge + .IS_VIDEO_BRIDGE_DISABLED, false)) + { + return; + } + if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(new Runnable() diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index 6ac39f0d2..d7b09d71d 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1728,9 +1728,19 @@ protected void initialize(String screenname, OperationSetBasicAutoAnswer.class, new OperationSetAutoAnswerJabberImpl(this)); - addSupportedOperationSet( - OperationSetVideoBridge.class, - new OperationSetVideoBridgeImpl(this)); + // Only init video bridge if enabled + boolean isVideoBridgeDisabled + = JabberActivator.getConfigurationService() + .getBoolean(OperationSetVideoBridge. + IS_VIDEO_BRIDGE_DISABLED, false); + + if (!isVideoBridgeDisabled) + { + // init video bridge + addSupportedOperationSet( + OperationSetVideoBridge.class, + new OperationSetVideoBridgeImpl(this)); + } // init DTMF OperationSetDTMFJabberImpl operationSetDTMFSip @@ -1800,7 +1810,7 @@ protected void initialize(String screenname, addSupportedOperationSet(OperationSetMessageCorrection.class, basicInstantMessaging); - OperationSetChangePassword opsetChangePassword + OperationSetChangePassword opsetChangePassword = new OperationSetChangePasswordJabberImpl(this); addSupportedOperationSet(OperationSetChangePassword.class, opsetChangePassword); diff --git a/src/net/java/sip/communicator/plugin/update/UpdateActivator.java b/src/net/java/sip/communicator/plugin/update/UpdateActivator.java index 6c717d6a2..42bf17f2c 100644 --- a/src/net/java/sip/communicator/plugin/update/UpdateActivator.java +++ b/src/net/java/sip/communicator/plugin/update/UpdateActivator.java @@ -177,6 +177,8 @@ public void start(BundleContext bundleContext) throws Exception UpdateActivator.bundleContext = bundleContext; + ConfigurationService cfg = getConfiguration(); + if (OSUtils.IS_WINDOWS) { updateService = new Update(); @@ -186,8 +188,6 @@ public void start(BundleContext bundleContext) throws Exception updateService, null); - ConfigurationService cfg = getConfiguration(); - // Register the "Check for Updates" menu item if // the "Check for Updates" property isn't disabled. if(!cfg.getBoolean(CHECK_FOR_UPDATES_MENU_DISABLED_PROP, false)) @@ -218,7 +218,7 @@ public void start(BundleContext bundleContext) throws Exception if (logger.isDebugEnabled()) logger.debug("Update checker [REGISTERED]"); - if (configuration.getBoolean(CHECK_FOR_UPDATES_DAILY_ENABLED_PROP, + if (cfg.getBoolean(CHECK_FOR_UPDATES_DAILY_ENABLED_PROP, false)) { logger.info("Scheduled update checking enabled"); diff --git a/src/net/java/sip/communicator/service/protocol/OperationSetVideoBridge.java b/src/net/java/sip/communicator/service/protocol/OperationSetVideoBridge.java index caafb1bcf..4ca5e4d29 100644 --- a/src/net/java/sip/communicator/service/protocol/OperationSetVideoBridge.java +++ b/src/net/java/sip/communicator/service/protocol/OperationSetVideoBridge.java @@ -15,6 +15,13 @@ public interface OperationSetVideoBridge extends OperationSet { + /** + * The name of the property under which the user may specify if + * video bridge should be disabled. + */ + public static final String IS_VIDEO_BRIDGE_DISABLED + = "net.java.sip.communicator.service.protocol.VIDEO_BRIDGE_DISABLED"; + /** * Creates a conference call with the specified callees as call peers via a * video bridge provided by the parent Jabber provider.