From 3823368fba3cc96510221a9f2ceee00ecba65f08 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 21 Aug 2007 16:01:28 +0000 Subject: [PATCH] Monotone-Parent: c8ffc75afc6375fd954ab207e9dbdef8b4793876 Monotone-Revision: a84c20b7d29bf952df6062daa2f86929f733e1f5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-21T16:01:28 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/Scheduler/UIxComponentEditor.h | 1 + UI/Scheduler/UIxComponentEditor.m | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/ChangeLog b/ChangeLog index 18b3531ef..13206cb89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-08-21 Wolfgang Sourdeau + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor + -takeValuesFromRequest:_rqinContext:_ctx]): save the category + selected in the dialog. + ([UIxComponentEditor -setComponent:newComponent]): retrieve the + first category, if ever, of the calendar entity. + * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame -composeAction]): restored method since it is needed by the address book. diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 71c511a6e..8eec9b4d4 100644 --- a/UI/Scheduler/UIxComponentEditor.h +++ b/UI/Scheduler/UIxComponentEditor.h @@ -51,6 +51,7 @@ NSString *priority; NSString *privacy; NSString *status; + NSString *category; NSArray *categories; NSDictionary *cycle; NSString *cycleEnd; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index cec6bbd1a..eecd800ff 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -121,6 +121,19 @@ [emails release]; } +- (void) _loadCategories +{ + NSString *compCategories, *simpleCategory; + + compCategories = [component categories]; + if ([compCategories length] > 0) + { + simpleCategory = [[compCategories componentsSeparatedByString: @","] + objectAtIndex: 0]; + ASSIGN (category, [simpleCategory uppercaseString]); + } +} + /* warning: we use this method which will be triggered by the template system when the page is instantiated, but we should find another and cleaner way of doing this... for example, when the clientObject is set */ @@ -145,6 +158,7 @@ ASSIGN (status, [component status]); ASSIGN (categories, [[component categories] commaSeparatedValues]); ASSIGN (organizer, [component organizer]); + [self _loadCategories]; [self _loadAttendees]; } // /* cycles */ @@ -300,6 +314,16 @@ return categories; } +- (void) setCategory: (NSArray *) newCategory +{ + ASSIGN (category, newCategory); +} + +- (NSString *) category +{ + return category; +} + - (NSString *) itemCategoryText { return [self labelForKey: @@ -822,6 +846,7 @@ [component setComment: comment]; [component setUrl: url]; [component setAccessClass: privacy]; + [component setCategories: [category capitalizedString]]; [self _handleAttendeesEdition]; [self _handleOrganizer]; clientObject = [self clientObject];