mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 11:55:24 +00:00
Monotone-Parent: a43f16c8cf580c2fed97407d3923b03048908bdd
Monotone-Revision: 3fb431fb255053cb2a899f221fd04e412a67a33a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-03-29T18:17:47 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
2007-03-29 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Contacts/UIxContactsListViewContainer.m
|
||||
([UIxContactsListViewContainer -additionalFolders]): take the list
|
||||
of subscribed folders from the new property list used for the user
|
||||
settings. The value of its key is SubscribedFolders for the
|
||||
dictionary entry named "Contacts".
|
||||
|
||||
* UI/Contacts/UIxContactsListView.m ([UIxContactsListView
|
||||
-canAccessContentAction]): new method to override the one from
|
||||
UIxFoldersActions by taking into account the fact that, this time,
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
NSString *foldersPrefix;
|
||||
NSString *selectorComponentClass;
|
||||
NSString *currentAdditionalFolder;
|
||||
NSDictionary *additionalFolders;
|
||||
id currentFolder;
|
||||
}
|
||||
|
||||
@@ -43,15 +44,14 @@
|
||||
|
||||
- (NSArray *) contactFolders;
|
||||
|
||||
- (NSString *) contactFolderId;
|
||||
- (NSString *) currentContactFolderId;
|
||||
- (NSString *) currentContactFolderName;
|
||||
|
||||
- (NSString *) additionalAddressBooks;
|
||||
- (NSArray *) additionalFolders;
|
||||
|
||||
- (void) setCurrentAdditionalFolder: (NSString *) newCurrentAdditionalFolder;
|
||||
- (NSString *) currentAdditionalFolder;
|
||||
- (NSString *) currentAdditionalFolderName;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -21,11 +21,13 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#import <NGObjWeb/SoObjects.h>
|
||||
#import <NGExtensions/NSObject+Values.h>
|
||||
|
||||
#import <SoObjects/SOGo/AgenorUserManager.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/Contacts/SOGoContactFolder.h>
|
||||
|
||||
@@ -41,11 +43,18 @@
|
||||
{
|
||||
foldersPrefix = nil;
|
||||
selectorComponentClass = nil;
|
||||
additionalFolders = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[additionalFolders release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) setSelectorComponentClass: (NSString *) aComponentClass
|
||||
{
|
||||
selectorComponentClass = aComponentClass;
|
||||
@@ -101,13 +110,6 @@
|
||||
return foldersPrefix;
|
||||
}
|
||||
|
||||
- (NSString *) contactFolderId
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@/%@",
|
||||
[self foldersPrefix],
|
||||
[[self clientObject] nameInContainer]];
|
||||
}
|
||||
|
||||
- (NSArray *) contactFolders
|
||||
{
|
||||
SOGoContactFolders *folderContainer;
|
||||
@@ -129,32 +131,23 @@
|
||||
return [self labelForKey: [currentFolder displayName]];
|
||||
}
|
||||
|
||||
- (BOOL) isFolderCurrent
|
||||
{
|
||||
return [[self currentContactFolderId] isEqualToString: [self contactFolderId]];
|
||||
}
|
||||
|
||||
- (NSString *) additionalAddressBooks
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
return [ud objectForKey: @"additionaladdressbooks"];
|
||||
}
|
||||
|
||||
- (NSArray *) additionalFolders
|
||||
{
|
||||
NSString *folders;
|
||||
NSArray *folderNames;
|
||||
AgenorUserManager *um;
|
||||
NSUserDefaults *ud;
|
||||
NSString *login;
|
||||
|
||||
folders = [self additionalAddressBooks];
|
||||
if ([folders length] > 0)
|
||||
folderNames = [folders componentsSeparatedByString: @","];
|
||||
else
|
||||
folderNames = nil;
|
||||
if (!additionalFolders)
|
||||
{
|
||||
um = [AgenorUserManager sharedUserManager];
|
||||
login = [[context activeUser] login];
|
||||
ud = [um getUserSettingsForUID: login];
|
||||
additionalFolders
|
||||
= [[ud objectForKey: @"Contacts"] objectForKey: @"SubscribedFolders"];
|
||||
[additionalFolders retain];
|
||||
}
|
||||
|
||||
return folderNames;
|
||||
return [additionalFolders allKeys];
|
||||
}
|
||||
|
||||
- (void) setCurrentAdditionalFolder: (NSString *) newCurrentAdditionalFolder
|
||||
@@ -167,6 +160,12 @@
|
||||
return currentAdditionalFolder;
|
||||
}
|
||||
|
||||
- (NSString *) currentAdditionalFolderName
|
||||
{
|
||||
return [[additionalFolders objectForKey: currentAdditionalFolder]
|
||||
objectForKey: @"displayName"];
|
||||
}
|
||||
|
||||
- (BOOL) hasContactSelectionButtons
|
||||
{
|
||||
return (selectorComponentClass != nil);
|
||||
|
||||
Reference in New Issue
Block a user