diff options
Diffstat (limited to 'src')
4 files changed, 38 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java index af3c775..9c4dd06 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java +++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java @@ -1042,6 +1042,26 @@ public class MetaContactGroupImpl } /** + * Determines whether or not this meta group contains only groups that are + * being stored by a server. + * + * @return true if the meta group is persistent and false otherwise. + */ + public boolean isPersistent() + { + Iterator<ContactGroup> contactGroupsIter = getContactGroups(); + + while (contactGroupsIter.hasNext()) + { + ContactGroup contactGroup = contactGroupsIter.next(); + if (contactGroup.isPersistent()) + return true; + } + + return false; + } + + /** * Determines the index in <code>#data</code> of a specific key. * * @param key diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java index 930dcc4..104b599 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java @@ -307,9 +307,14 @@ public class AddContactDialog Iterator<MetaContactGroup> groupList = GuiActivator.getContactListService().getRoot().getSubgroups(); - while(groupList.hasNext()) + while (groupList.hasNext()) { - groupCombo.addItem(groupList.next()); + MetaContactGroup group = groupList.next(); + + if (!group.isPersistent()) + continue; + + groupCombo.addItem(group); } final String newGroupString = GuiActivator.getResources() 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 f7ba4c7..9faed57 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 @@ -340,6 +340,9 @@ public class MetaContactRightButtonMenu { MetaContactGroup group = groups.next(); + if (!group.isPersistent()) + continue; + JMenuItem menuItem = new JMenuItem(group.getGroupName()); menuItem.setName(moveToPrefix + group.getMetaUID()); diff --git a/src/net/java/sip/communicator/service/contactlist/MetaContactGroup.java b/src/net/java/sip/communicator/service/contactlist/MetaContactGroup.java index 32b7325..2f2296c 100644 --- a/src/net/java/sip/communicator/service/contactlist/MetaContactGroup.java +++ b/src/net/java/sip/communicator/service/contactlist/MetaContactGroup.java @@ -327,4 +327,12 @@ public interface MetaContactGroup * <code>key</code> */ public void setData(Object key, Object value); + + /** + * Determines whether or not this meta group contains only groups that are + * being stored by a server. + * + * @return true if the meta group is persistent and false otherwise. + */ + public boolean isPersistent(); } |