UI/Scheduler/Toolbars/SOGoAppointmentFolders.toolbar

Monotone-Parent: c4c95e670daa9c22e838239469a51f3d23b84ab0
Monotone-Revision: 92e93f3527a76deed69fa61275517490d57f9a4f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-14T22:01:02
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-14 22:01:02 +00:00
parent beac7e7aea
commit e2340b4c9f
67 changed files with 1130 additions and 992 deletions
+3 -62
View File
@@ -41,20 +41,12 @@
{
if ((self = [super init]))
{
foldersPrefix = nil;
selectorComponentClass = nil;
additionalFolders = nil;
}
return self;
}
- (void) dealloc
{
[additionalFolders release];
[super dealloc];
}
- (void) setSelectorComponentClass: (NSString *) aComponentClass
{
selectorComponentClass = aComponentClass;
@@ -86,30 +78,6 @@
currentFolder = folder;
}
- (NSString *) foldersPrefix
{
NSMutableArray *folders;
SOGoObject *currentObject;
if (!foldersPrefix)
{
folders = [NSMutableArray new];
[folders autorelease];
currentObject = [[self clientObject] container];
while (![currentObject isKindOfClass: [SOGoContactFolders class]])
{
[folders insertObject: [currentObject nameInContainer] atIndex: 0];
currentObject = [currentObject container];
}
foldersPrefix = [folders componentsJoinedByString: @"/"];
[foldersPrefix retain];
}
return foldersPrefix;
}
- (NSArray *) contactFolders
{
SOGoContactFolders *folderContainer;
@@ -121,8 +89,7 @@
- (NSString *) currentContactFolderId
{
return [NSString stringWithFormat: @"%@/%@",
[self foldersPrefix],
return [NSString stringWithFormat: @"/%@",
[currentFolder nameInContainer]];
}
@@ -131,35 +98,9 @@
return [currentFolder displayName];
}
- (NSArray *) additionalFolders
- (NSString *) currentContactFolderOwner
{
NSUserDefaults *ud;
if (!additionalFolders)
{
ud = [[context activeUser] userSettings];
additionalFolders
= [[ud objectForKey: @"Contacts"] objectForKey: @"SubscribedFolders"];
[additionalFolders retain];
}
return [additionalFolders allKeys];
}
- (void) setCurrentAdditionalFolder: (NSString *) newCurrentAdditionalFolder
{
currentAdditionalFolder = newCurrentAdditionalFolder;
}
- (NSString *) currentAdditionalFolder
{
return currentAdditionalFolder;
}
- (NSString *) currentAdditionalFolderName
{
return [[additionalFolders objectForKey: currentAdditionalFolder]
objectForKey: @"displayName"];
return [currentFolder ownerInContext: context];
}
- (BOOL) hasContactSelectionButtons