diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java index fa6f92ab5..4efe7b25b 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java @@ -867,7 +867,8 @@ private void initButtonsPanel(UIContact uiContact) && AccountUtils.getOpSetRegisteredProviders( OperationSetDesktopSharingServer.class, null, - null).size() > 0)) + null).size() > 0) + || hasVideoPhone) { x += addButton(desktopSharingButton, ++gridX, x, false); } diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java index d9f7e786c..2fad03615 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java @@ -67,12 +67,20 @@ public GroupRightButtonMenu(MainFrame mainFrame, MetaContactGroup group) this.mainFrame = mainFrame; if (!ConfigurationUtils.isAddContactDisabled()) + { this.add(addContactItem); + this.addSeparator(); + } - this.addSeparator(); + if (!ConfigurationUtils.isGroupRenameDisabled()) + { + this.add(renameGroupItem); + } - this.add(renameGroupItem); - this.add(removeGroupItem); + if (!ConfigurationUtils.isGroupRemoveDisabled()) + { + this.add(removeGroupItem); + } this.addContactItem.setMnemonic(GuiActivator.getResources() .getI18nMnemonic("service.gui.ADD_CONTACT")); diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java index dcb3f3f03..4647dc8c8 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java @@ -528,7 +528,8 @@ else if(d instanceof VideoDetail) OperationSetDesktopSharingServer.class) != null && hasContactCapabilities(contact, OperationSetDesktopSharingServer.class) - || routingForDesktopEnabled) + || routingForDesktopEnabled + || hasVideoDetail) { multiContactFullShareMenu.add( createMenuItem( contactAddress, @@ -659,21 +660,27 @@ else if(d instanceof VideoDetail) addSeparator(); - add(moveToMenu); - add(moveSubcontactMenu); + if (!ConfigurationUtils.isContactMoveDisabled()) + { + add(moveToMenu); + add(moveSubcontactMenu); - addSeparator(); + addSeparator(); + } if (!ConfigurationUtils.isAddContactDisabled()) + { add(addContactItem); + addSeparator(); + } - addSeparator(); - + separator = false; if (!ConfigurationUtils.isRemoveContactDisabled()) { if (metaContact.getContactCount() > 1) { add(removeContactMenu); + separator = true; } else { @@ -689,12 +696,20 @@ else if(d instanceof VideoDetail) deleteIcon); add(removeContactItem); + separator = true; } } - add(renameContactItem); + if (!ConfigurationUtils.isContactRenameDisabled()) + { + add(renameContactItem); + separator = true; + } - addSeparator(); + if(separator) + { + addSeparator(); + } add(viewHistoryItem); @@ -760,7 +775,8 @@ else if (authRequestItemCount == 1 if (metaContact.getDefaultContact( OperationSetDesktopSharingServer.class) == null - && !routingForDesktopEnabled) + && !routingForDesktopEnabled + && !hasVideoDetail) { fullShareMenuItem.setEnabled(false); regionShareMenuItem.setEnabled(false); diff --git a/src/net/java/sip/communicator/util/ConfigurationUtils.java b/src/net/java/sip/communicator/util/ConfigurationUtils.java index 07e968d13..e2e8ccf10 100644 --- a/src/net/java/sip/communicator/util/ConfigurationUtils.java +++ b/src/net/java/sip/communicator/util/ConfigurationUtils.java @@ -176,6 +176,27 @@ public class ConfigurationUtils */ private static boolean isRemoveContactDisabled; + /** + * Indicates if the move contact functionality is disabled. + */ + private static boolean isContactMoveDisabled; + + /** + * Indicates if the rename contact functionality is disabled. + */ + private static boolean isContactRenameDisabled; + + /** + * Indicates if the remove group functionality is disabled. + */ + private static boolean isGroupRemoveDisabled; + + /** + * Indicates if the rename group functionality is disabled. + */ + private static boolean isGroupRenameDisabled; + + /** * Indicates if the pre set status messages are enabled. */ @@ -639,6 +660,33 @@ public static void loadGuiConfigurations() "CONTACT_REMOVE_DISABLED", false); + // Load the "CONTACT_MOVE_DISABLED" property. + isContactMoveDisabled + = configService.getBoolean( + "net.java.sip.communicator.impl.gui.main.contactlist." + + "CONTACT_MOVE_DISABLED", + false); + + // Load the "CONTACT_RENAME_DISABLED" property. + isContactRenameDisabled + = configService.getBoolean( + "net.java.sip.communicator.impl.gui.main.contactlist." + + "CONTACT_RENAME_DISABLED", + false); + // Load the "GROUP_REMOVE_DISABLED" property. + isGroupRemoveDisabled + = configService.getBoolean( + "net.java.sip.communicator.impl.gui.main.contactlist." + + "GROUP_REMOVE_DISABLED", + false); + + // Load the "GROUP_RENAME_DISABLED" property. + isGroupRenameDisabled + = configService.getBoolean( + "net.java.sip.communicator.impl.gui.main.contactlist." + + "GROUP_RENAME_DISABLED", + false); + // Load the "PRESET_STATUS_MESSAGES" property. isPresetStatusMessagesEnabled = configService.getBoolean( @@ -1157,6 +1205,48 @@ public static boolean isRemoveContactDisabled() return isRemoveContactDisabled; } + /** + * Returns true if the "CONTACT_MOVE_DISABLED" property is + * true, otherwise - returns false. + * @return true if the "CONTACT_MOVE_DISABLED" property is + * true, otherwise - returns false. + */ + public static boolean isContactMoveDisabled() + { + return isContactMoveDisabled; + } + /** + * Returns true if the "CONTACT_RENAME_DISABLED" property is + * true, otherwise - returns false. + * @return true if the "CONTACT_RENAME_DISABLED" property is + * true, otherwise - returns false. + */ + public static boolean isContactRenameDisabled() + { + return isContactRenameDisabled; + } + + /** + * Returns true if the "GROUP_REMOVE_DISABLED" property is + * true, otherwise - returns false. + * @return true if the "GROUP_REMOVE_DISABLED" property is + * true, otherwise - returns false. + */ + public static boolean isGroupRemoveDisabled() + { + return isGroupRemoveDisabled; + } + /** + * Returns true if the "GROUP_RENAME_DISABLED" property is + * true, otherwise - returns false. + * @return true if the "GROUP_RENAME_DISABLED" property is + * true, otherwise - returns false. + */ + public static boolean isGroupRenameDisabled() + { + return isGroupRenameDisabled; + } + /** * Returns true if the "PRESET_STATUS_MESSAGES" property is * true, otherwise - returns false.