diff options
author | Damian Minkov <damencho@jitsi.org> | 2015-02-05 12:50:19 +0200 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2015-02-05 12:58:02 +0200 |
commit | 63eab0514f031963b668486467119c72ba5e58bd (patch) | |
tree | 906a42ee16f778b8b8a08cc380d298cae849e5cd /src/net/java/sip/communicator/plugin/connectioninfo | |
parent | e9672a5bca826a796d20adb6afa38f58f84b04f6 (diff) | |
download | jitsi-63eab0514f031963b668486467119c72ba5e58bd.zip jitsi-63eab0514f031963b668486467119c72ba5e58bd.tar.gz jitsi-63eab0514f031963b668486467119c72ba5e58bd.tar.bz2 |
Adds properties to disable account and connect info menu entries.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/connectioninfo')
-rw-r--r-- | src/net/java/sip/communicator/plugin/connectioninfo/ConnectionInfoActivator.java | 95 | ||||
-rw-r--r-- | src/net/java/sip/communicator/plugin/connectioninfo/connectioninfo.manifest.mf | 1 |
2 files changed, 61 insertions, 35 deletions
diff --git a/src/net/java/sip/communicator/plugin/connectioninfo/ConnectionInfoActivator.java b/src/net/java/sip/communicator/plugin/connectioninfo/ConnectionInfoActivator.java index 5126419..6251d5e 100644 --- a/src/net/java/sip/communicator/plugin/connectioninfo/ConnectionInfoActivator.java +++ b/src/net/java/sip/communicator/plugin/connectioninfo/ConnectionInfoActivator.java @@ -12,6 +12,7 @@ import net.java.sip.communicator.service.globaldisplaydetails.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.util.*; +import org.jitsi.service.configuration.*; import org.jitsi.service.resources.*; import org.osgi.framework.*; @@ -35,6 +36,20 @@ public class ConnectionInfoActivator static ResourceManagementService R; + /** + * Property to disable connect info in tools menu. + */ + private static final String CONNECT_INFO_TOOLS_MENU_DISABLED_PROP = + "net.java.sip.communicator.plugin.connectioninfo" + + ".CONNECT_INFO_TOOLS_MENU_DISABLED_PROP"; + + /** + * Property to disable connect info in account config. + */ + private static final String CONNECT_INFO_ACC_CONFIG_DISABLED_PROP = + "net.java.sip.communicator.plugin.connectioninfo" + + ".CONNECT_INFO_ACC_CONFIG_DISABLED_PROP"; + private static GlobalDisplayDetailsService globalDisplayDetailsService; public void start(BundleContext bc) throws Exception @@ -43,43 +58,53 @@ public class ConnectionInfoActivator R = ServiceUtils.getService(bc, ResourceManagementService.class); - Hashtable<String, String> containerFilter - = new Hashtable<String, String>(); - containerFilter.put( - Container.CONTAINER_ID, - Container.CONTAINER_TOOLS_MENU.getID()); - - bundleContext.registerService( - PluginComponentFactory.class.getName(), - new PluginComponentFactory(Container.CONTAINER_TOOLS_MENU) - { - @Override - protected PluginComponent getPluginInstance() + ConfigurationService config + = ServiceUtils.getService(bc, ConfigurationService.class); + + if(!config.getBoolean(CONNECT_INFO_TOOLS_MENU_DISABLED_PROP, false)) + { + Hashtable<String, String> containerFilter + = new Hashtable<String, String>(); + containerFilter.put( + Container.CONTAINER_ID, + Container.CONTAINER_TOOLS_MENU.getID()); + + bundleContext.registerService( + PluginComponentFactory.class.getName(), + new PluginComponentFactory(Container.CONTAINER_TOOLS_MENU) { - return new ConnectionInfoMenuItemComponent( - getContainer(), this); - } - }, - containerFilter); - - containerFilter = new Hashtable<String, String>(); - containerFilter.put( - Container.CONTAINER_ID, - Container.CONTAINER_ACCOUNT_RIGHT_BUTTON_MENU.getID()); - - bundleContext.registerService( - PluginComponentFactory.class.getName(), - new PluginComponentFactory( - Container.CONTAINER_ACCOUNT_RIGHT_BUTTON_MENU) - { - @Override - protected PluginComponent getPluginInstance() + @Override + protected PluginComponent getPluginInstance() + { + return new ConnectionInfoMenuItemComponent( + getContainer(), this); + } + }, + containerFilter); + } + + if(!config.getBoolean(CONNECT_INFO_ACC_CONFIG_DISABLED_PROP, false)) + { + Hashtable<String, String> containerFilter + = new Hashtable<String, String>(); + containerFilter.put( + Container.CONTAINER_ID, + Container.CONTAINER_ACCOUNT_RIGHT_BUTTON_MENU.getID()); + + bundleContext.registerService( + PluginComponentFactory.class.getName(), + new PluginComponentFactory( + Container.CONTAINER_ACCOUNT_RIGHT_BUTTON_MENU) { - return new ConnectionInfoMenuItemComponent( - getContainer(), this); - } - }, - containerFilter); + @Override + protected PluginComponent getPluginInstance() + { + return new ConnectionInfoMenuItemComponent( + getContainer(), this); + } + }, + containerFilter); + } } public void stop(BundleContext bc) throws Exception {} diff --git a/src/net/java/sip/communicator/plugin/connectioninfo/connectioninfo.manifest.mf b/src/net/java/sip/communicator/plugin/connectioninfo/connectioninfo.manifest.mf index 793a9e8..4685265 100644 --- a/src/net/java/sip/communicator/plugin/connectioninfo/connectioninfo.manifest.mf +++ b/src/net/java/sip/communicator/plugin/connectioninfo/connectioninfo.manifest.mf @@ -9,6 +9,7 @@ Import-Package: org.osgi.framework, net.java.sip.communicator.service.globaldisplaydetails, net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.protocol.event, + org.jitsi.service.configuration, org.jitsi.service.resources, org.jitsi.util, net.java.sip.communicator.service.resources, |