From 69ddfaae62dfa6ba7c2ea8ad1fdaa2c54bb06391 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 1 Nov 2006 20:38:57 +0000 Subject: [PATCH] Monotone-Parent: f157da7ef6dd1cbbd794a190a33ba4d9f47aff68 Monotone-Revision: d718bf9c6341fc32a67a496c0427cbfe18d0cfae Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-11-01T20:38:57 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++ UI/Contacts/UIxContactsListViewContainer.h | 8 ++++++ UI/Contacts/UIxContactsListViewContainer.m | 31 ++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/ChangeLog b/ChangeLog index 83066144b..32a2aad0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-11-01 Wolfgang Sourdeau + * UI/Contacts/UIxContactsListViewContainer.m ([UIxContactsListViewContainer -additionalAddressBooks]) + ([UIxContactsListViewContainer -additionalFolders]) + ([UIxContactsListViewContainer -setCurrentAdditionalFolder:newCurrentAdditionalFolder]) + ([UIxContactsListViewContainer -currentAdditionalFolder]): new + methods to handle the external addressbooks a user has subscribed + too, by retriving them from his preferences. + * UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView -updateAdditionalAddressBooksAction]): new method that updates the user settings with the list of addressbook he has subscribed to. diff --git a/UI/Contacts/UIxContactsListViewContainer.h b/UI/Contacts/UIxContactsListViewContainer.h index 71bb1df27..7bed4f897 100644 --- a/UI/Contacts/UIxContactsListViewContainer.h +++ b/UI/Contacts/UIxContactsListViewContainer.h @@ -26,12 +26,14 @@ #import @class NSArray; +@class NSString; @class SOGoContactFolder; @interface UIxContactsListViewContainer : UIxComponent { NSString *foldersPrefix; NSString *selectorComponentClass; + NSString *currentAdditionalFolder; id currentFolder; } @@ -45,6 +47,12 @@ - (NSString *) currentContactFolderId; - (NSString *) currentContactFolderName; +- (NSString *) additionalAddressBooks; +- (NSArray *) additionalFolders; + +- (void) setCurrentAdditionalFolder: (NSString *) newCurrentAdditionalFolder; +- (NSString *) currentAdditionalFolder; + @end #endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */ diff --git a/UI/Contacts/UIxContactsListViewContainer.m b/UI/Contacts/UIxContactsListViewContainer.m index 018e1c630..71c96ef0d 100644 --- a/UI/Contacts/UIxContactsListViewContainer.m +++ b/UI/Contacts/UIxContactsListViewContainer.m @@ -24,7 +24,9 @@ #import #import +#import +#import #import #import "UIxContactsListViewContainer.h" @@ -132,9 +134,38 @@ return [[self currentContactFolderId] isEqualToString: [self contactFolderId]]; } +- (NSString *) additionalAddressBooks +{ + NSUserDefaults *ud; + + ud = [[context activeUser] userDefaults]; + + return [ud objectForKey: @"additionaladdressbooks"]; +} + +- (NSArray *) additionalFolders +{ + return [[self additionalAddressBooks] componentsSeparatedByString: @","]; +} + +- (void) setCurrentAdditionalFolder: (NSString *) newCurrentAdditionalFolder +{ + currentAdditionalFolder = newCurrentAdditionalFolder; +} + +- (NSString *) currentAdditionalFolder +{ + return currentAdditionalFolder; +} + - (BOOL) hasContactSelectionButtons { return (selectorComponentClass != nil); } +- (BOOL) isPopup +{ + return [[self queryParameterForKey: @"popup"] boolValue]; +} + @end