From c286a1935ec90725fa55edc94e2ed156c22213e5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 3 Nov 2006 19:38:08 +0000 Subject: [PATCH] Monotone-Parent: 2742aed8d5c18d0bc31698e3e361fe9979243fa1 Monotone-Revision: 12e535603dd09ceb52e98c9e06e74080d1a1eaff Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-11-03T19:38:08 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 10 +++ UI/Scheduler/UIxAppointmentEditor.m | 4 +- UI/Scheduler/UIxComponentEditor.m | 95 ++++++++++++++++++----------- UI/Scheduler/UIxTaskEditor.m | 5 +- 4 files changed, 75 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index f66454849..b4c3cf253 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-11-03 Wolfgang Sourdeau + + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor + -loadValuesFromComponent:component]): handles access class + (privacy) and status. + + * UI/Contacts/UIxContactsListViewContainer.m + ([UIxContactsListViewContainer -additionalFolders]): return nil if + [self additionalAddressBooks] returns an empty string. + 2006-11-02 Wolfgang Sourdeau * UI/Scheduler/UIxCalMonthView.m ([UIxCalMonthView diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index a030d3361..8364b5cef 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -230,9 +230,11 @@ [_appointment setLocation: [self location]]; [_appointment setComment: [self comment]]; [_appointment setPriority:[self priority]]; + [_appointment setAccessClass: [self privacy]]; + [_appointment setStatus: [self status]]; + [_appointment setCategories: [[self categories] componentsJoinedByString: @","]]; - [_appointment setAccessClass: [self accessClass]]; [_appointment setTransparency: [self transparency]]; #if 0 diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index fa79337ab..e56edc018 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -53,7 +53,7 @@ { if ((self = [super init])) { - [self setIsPrivate: NO]; + [self setPrivacy: @"PUBLIC"]; [self setCheckForConflicts: NO]; [self setIsCycleEndNever]; componentOwner = @""; @@ -77,7 +77,6 @@ [resources release]; [priority release]; [categories release]; - [accessClass release]; [cycle release]; [cycleEnd release]; [url release]; @@ -87,31 +86,6 @@ /* accessors */ -- (void) setAccessClass: (NSString *) _class -{ - ASSIGN(accessClass, _class); -} - -- (NSString *) accessClass -{ - return accessClass; -} - -- (void) setIsPrivate: (BOOL) _yn -{ - if (_yn) - [self setAccessClass:@"PRIVATE"]; - else - [self setAccessClass:@"PUBLIC"]; - - isPrivate = _yn; -} - -- (BOOL) isPrivate -{ - return isPrivate; -} - - (void) setItem: (id) _item { ASSIGN(item, _item); @@ -127,6 +101,16 @@ return [self labelForKey: [NSString stringWithFormat: @"prio_%@", item]]; } +- (NSString *) itemPrivacyText +{ + return [self labelForKey: [NSString stringWithFormat: @"privacy_%@", item]]; +} + +- (NSString *) itemStatusText +{ + return [self labelForKey: [NSString stringWithFormat: @"status_%@", item]]; +} + - (void) setErrorText: (NSString *) _txt { ASSIGNCOPY(errorText, _txt); @@ -264,6 +248,52 @@ return priority; } +- (NSArray *) privacyClasses +{ + static NSArray *priorities = nil; + + if (!priorities) + { + priorities = [NSArray arrayWithObjects: @"PUBLIC", @"PRIVATE", @"CONFIDENTIAL", nil]; + [priorities retain]; + } + + return priorities; +} + +- (void) setPrivacy: (NSString *) _privacy +{ + ASSIGN(privacy, _privacy); +} + +- (NSString *) privacy +{ + return privacy; +} + +- (NSArray *) statusTypes +{ + static NSArray *priorities = nil; + + if (!priorities) + { + priorities = [NSArray arrayWithObjects: @"", @"TENTATIVE", @"CONFIRMED", @"CANCELLED", nil]; + [priorities retain]; + } + + return priorities; +} + +- (void) setStatus: (NSString *) _status +{ + ASSIGN(status, _status); +} + +- (NSString *) status +{ + return status; +} + - (void) setParticipants: (NSArray *) _parts { ASSIGN(participants, _parts); @@ -568,7 +598,6 @@ /* subclasses */ - (void) loadValuesFromComponent: (iCalRepeatableEntityObject *) component { - NSString *s; iCalRecurrenceRule *rrule; NSTimeZone *uTZ; SOGoObject *co; @@ -590,20 +619,14 @@ location = [[component location] copy]; comment = [[component comment] copy]; url = [[[component url] absoluteString] copy]; + privacy = [[component accessClass] copy]; priority = [[component priority] copy]; + status = [[component status] copy]; categories = [[[component categories] commaSeparatedValues] retain]; organizer = [[component organizer] retain]; participants = [[component participants] retain]; resources = [[component resources] retain]; -// NSLog (@"summary יאט: '%@'", title); - - s = [component accessClass]; - if (!s || [s isEqualToString: @"PUBLIC"]) - [self setIsPrivate:NO]; - else - [self setIsPrivate:YES]; /* we're possibly loosing information here */ - /* cycles */ if ([component isRecurrent]) { diff --git a/UI/Scheduler/UIxTaskEditor.m b/UI/Scheduler/UIxTaskEditor.m index 51f83e3a8..3bcc5a9db 100644 --- a/UI/Scheduler/UIxTaskEditor.m +++ b/UI/Scheduler/UIxTaskEditor.m @@ -207,10 +207,11 @@ [_task setLocation: [self location]]; [_task setComment: [self comment]]; [_task setPriority:[self priority]]; + [_task setAccessClass: [self privacy]]; + [_task setStatus: [self status]]; + [_task setCategories: [[self categories] componentsJoinedByString: @","]]; - [_task setAccessClass:[self accessClass]]; - #if 0 /* Note: bad, bad, bad!