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