diff options
author | Yana Stamcheva <yana@jitsi.org> | 2011-12-28 16:14:38 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2011-12-28 16:14:38 +0000 |
commit | 969ddcc27051af25fcde70d7f24a71cd342c6961 (patch) | |
tree | 58ceb1da683bd9bc3074cdaffc602430d5380497 | |
parent | 8e688ab5cba90d5f824ad371210dd250242fb885 (diff) | |
download | jitsi-969ddcc27051af25fcde70d7f24a71cd342c6961.zip jitsi-969ddcc27051af25fcde70d7f24a71cd342c6961.tar.gz jitsi-969ddcc27051af25fcde70d7f24a71cd342c6961.tar.bz2 |
Removes non persistent groups from "Add contact" window and "Move to group" menu.
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(); } |