From 17aa35440e4e6c5a7c457c98f8c3d0e2e555688c Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 16 Oct 2006 18:45:23 +0000 Subject: [PATCH] Monotone-Parent: aa33c6954faa657b2d62640f492737b1dba8bd00 Monotone-Revision: ed1f9d054bf58150b30e9e4dbbffa4b09113c4e6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-16T18:45:23 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Contacts/UIxContactSelector.h | 7 +++++++ UI/Contacts/UIxContactSelector.m | 17 +++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/ChangeLog b/ChangeLog index d1d7b0612..cee02b72b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-16 Wolfgang Sourdeau + * UI/Contacts/UIxContactSelector.m ([UIxContactSelector + -setColors:colors]): new method to associate a color table with + each user in the list. + * SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -fetchFields:_fieldsfromFolder:_folderfrom:_startDateto:_endDatecomponent:_component]): associate each returned record with the owner of the table they are retrieved from. diff --git a/UI/Contacts/UIxContactSelector.h b/UI/Contacts/UIxContactSelector.h index 38fa4191d..81b20751b 100644 --- a/UI/Contacts/UIxContactSelector.h +++ b/UI/Contacts/UIxContactSelector.h @@ -22,6 +22,11 @@ #ifndef UIXCONTACTSELECTOR_H #define UIXCONTACTSELECTOR_H +@class NSArray; +@class NSDictionary; +@class NSString; +@class iCalPerson; + @interface UIxContactSelector : UIxComponent { NSString *title; @@ -35,6 +40,8 @@ BOOL hasCheckBoxes; NSString *checkBoxOnChange; + + NSDictionary *userColors; } - (void) setHasCheckBoxes: (BOOL) aBool; diff --git a/UI/Contacts/UIxContactSelector.m b/UI/Contacts/UIxContactSelector.m index 2073f6489..0cd7b96d6 100644 --- a/UI/Contacts/UIxContactSelector.m +++ b/UI/Contacts/UIxContactSelector.m @@ -38,6 +38,7 @@ [self setWindowId:@"UIxContacts"]; [self setCallback:@"undefined"]; checkedBoxes = nil; + userColors = nil; } return self; } @@ -231,4 +232,20 @@ return checkBoxOnChange; } +- (void) setColors: (NSDictionary *) colors +{ + userColors = colors; +} + +- (BOOL) hasColors +{ + return (userColors != nil); +} + +- (NSString *) currentContactStyle +{ + return [NSString stringWithFormat: @"background-color: %@;", + [userColors objectForKey: [currentContact cn]]]; +} + @end /* UIxContactSelector */