From 7437a70163cdb4144d969c63e1bc0fc9dc97cb22 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Fri, 10 Nov 2006 17:38:43 +0000 Subject: [PATCH] save "show/hide offline" property --- .../communicator/impl/gui/main/MainFrame.java | 21 ++++++++++++++++--- .../gui/main/contactlist/ContactList.java | 20 +++++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java index 02c3daee2..bf73c15eb 100755 --- a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java @@ -629,6 +629,13 @@ public void windowClosing(WindowEvent e) { configService.setProperty( "net.java.sip.communicator.impl.ui.showCallPanel", new Boolean(callManager.isShown())); + + + configService.setProperty( + "net.java.sip.communicator.impl.ui.showOffline", + new Boolean(getContactListPanel() + .getContactList().isShowOffline())); + } catch (PropertyVetoException e1) { logger.error("The proposed property change " @@ -653,15 +660,23 @@ public void loadConfigurationSettings() { ConfigurationService configService = GuiActivator.getConfigurationService(); - String isShown = configService.getString( + String isCallPanelShown = configService.getString( "net.java.sip.communicator.impl.ui.showCallPanel"); - if(isShown != null && isShown != "") { - callManager.setShown(new Boolean(isShown).booleanValue()); + String isShowOffline = configService.getString( + "net.java.sip.communicator.impl.ui.showOffline"); + + if(isCallPanelShown != null && isCallPanelShown != "") { + callManager.setShown(new Boolean(isCallPanelShown).booleanValue()); } else { callManager.setShown(true); } + + if(isShowOffline != null && isShowOffline != "") { + getContactListPanel().getContactList() + .setShowOffline(new Boolean(isShowOffline).booleanValue()); + } } /** diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java index 81412dd80..fa179b53b 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java @@ -964,5 +964,23 @@ public GroupRightButtonMenu getGroupRightButtonMenu() { return groupRightButtonMenu; } - + + /** + * Returns TRUE if the list shows offline contacts, FALSE otherwise. + * @return TRUE if the list shows offline contacts, FALSE otherwise + */ + public boolean isShowOffline() + { + return listModel.showOffline(); + } + + /** + * Sets the showOffline property. + * @param isShowOffline TRUE to show all offline users, FALSE to hide + * offline users. + */ + public void setShowOffline(boolean isShowOffline) + { + listModel.setShowOffline(isShowOffline); + } }