From 4d870f47225d4873e4dccfe375a88b305209ae05 Mon Sep 17 00:00:00 2001 From: znek Date: Mon, 18 Jul 2005 15:15:32 +0000 Subject: [PATCH] SOGoAptFormatter -> -titlePlaceholder, used by UIxCalView now git-svn-id: http://svn.opengroupware.org/SOGo/trunk@797 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/SOGoUI/ChangeLog | 5 ++++ SOGo/UI/SOGoUI/SOGoAptFormatter.h | 4 +++ SOGo/UI/SOGoUI/SOGoAptFormatter.m | 29 ++++++++++++++----- SOGo/UI/SOGoUI/Version | 2 +- SOGo/UI/Scheduler/ChangeLog | 6 ++++ .../English.lproj/Localizable.strings | 1 + SOGo/UI/Scheduler/UIxCalView.m | 6 +++- SOGo/UI/Scheduler/Version | 3 +- 8 files changed, 45 insertions(+), 11 deletions(-) diff --git a/SOGo/UI/SOGoUI/ChangeLog b/SOGo/UI/SOGoUI/ChangeLog index 7882308f..4246f938 100644 --- a/SOGo/UI/SOGoUI/ChangeLog +++ b/SOGo/UI/SOGoUI/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 Marcus Mueller + + * SOGoAptFormatter.[hm]: added -titlePlaceholder API for properly + formatting appointments without titles (v0.9.30) + 2005-07-13 Marcus Mueller * WOContext+UIx.[hm]: new category to WOContext, currently provides diff --git a/SOGo/UI/SOGoUI/SOGoAptFormatter.h b/SOGo/UI/SOGoUI/SOGoAptFormatter.h index c8106834..70834d1e 100644 --- a/SOGo/UI/SOGoUI/SOGoAptFormatter.h +++ b/SOGo/UI/SOGoUI/SOGoAptFormatter.h @@ -33,6 +33,7 @@ NSTimeZone *tz; SEL formatAction; NSString *privateTitle; + NSString *titlePlaceholder; BOOL omitsEndDate; } @@ -53,6 +54,9 @@ - (void)setPrivateTitle:(NSString *)_privateTitle; - (NSString *)privateTitle; +- (void)setTitlePlaceholder:(NSString *)_titlePlaceholder; +- (NSString *)titlePlaceholder; + - (NSString *)stringForObjectValue:(id)_obj referenceDate:(NSCalendarDate *)_refDate; diff --git a/SOGo/UI/SOGoUI/SOGoAptFormatter.m b/SOGo/UI/SOGoUI/SOGoAptFormatter.m index 99f938c5..6f0d91d1 100644 --- a/SOGo/UI/SOGoUI/SOGoAptFormatter.m +++ b/SOGo/UI/SOGoUI/SOGoAptFormatter.m @@ -52,8 +52,9 @@ } - (void)dealloc { - [self->tz release]; - [self->privateTitle release]; + [self->tz release]; + [self->privateTitle release]; + [self->titlePlaceholder release]; [super dealloc]; } @@ -102,6 +103,13 @@ return self->privateTitle; } +- (void)setTitlePlaceholder:(NSString *)_titlePlaceholder { + ASSIGN(self->titlePlaceholder, _titlePlaceholder); +} +- (NSString *)titlePlaceholder { + return self->titlePlaceholder; +} + - (void)setOmitsEndDate { self->omitsEndDate = YES; } @@ -201,7 +209,12 @@ } - (NSString *)titleForApt:(id)_apt :(NSCalendarDate *)_refDate { - return [_apt valueForKey:@"title"]; + NSString *title; + + title = [_apt valueForKey:@"title"]; + if (![title isNotEmpty]) + title = [self titlePlaceholder]; + return title; } - (NSString *)shortTitleForApt:(id)_apt :(NSCalendarDate *)_refDate { @@ -225,8 +238,8 @@ if ((s = [_apt valueForKey:@"location"]) != nil) { [aptDescr appendFormat:@"; (%@)", s]; } - if ((s = [_apt valueForKey:@"title"]) != nil) - [aptDescr appendFormat:@"; %@", [self titleForApt:_apt :_refDate]]; + if ((s = [self titleForApt:_apt :_refDate]) != nil) + [aptDescr appendFormat:@"; %@", s]; return aptDescr; } @@ -243,8 +256,8 @@ s = [[s substringToIndex:11] stringByAppendingString:@"..."]; [aptDescr appendFormat:@" (%@)", s]; } - if ((s = [_apt valueForKey:@"title"]) != nil) - [aptDescr appendFormat:@"
%@", [self shortTitleForApt:_apt :_refDate]]; + if ((s = [self shortTitleForApt:_apt :_refDate]) != nil) + [aptDescr appendFormat:@"
%@", s]; return aptDescr; } @@ -279,7 +292,7 @@ [self appendTimeInfoFromApt:_apt usingReferenceDate:_refDate toBuffer:aptDescr]; - if ((s = [_apt valueForKey:@"title"]) != nil) + if ((s = [self titleForApt:_apt :_refDate]) != nil) [aptDescr appendFormat:@"\n%@", s]; if ((s = [_apt valueForKey:@"location"]) != nil) [aptDescr appendFormat:@"\n%@", s]; diff --git a/SOGo/UI/SOGoUI/Version b/SOGo/UI/SOGoUI/Version index 99566d65..afe52839 100644 --- a/SOGo/UI/SOGoUI/Version +++ b/SOGo/UI/SOGoUI/Version @@ -1,5 +1,5 @@ # version file -SUBMINOR_VERSION:=29 +SUBMINOR_VERSION:=30 # v0.9.18 requires NGExtensions v4.5.136 diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 01a03c4f..d75e98ae 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,9 @@ +2005-07-18 Marcus Mueller + + * UIxCalView.m: provide label "empty title" as -titlePlaceholder for + appointment formatters to enable display of appointments whose + title has not been set (v0.9.136) + 2005-07-15 Helge Hess * UIxCalScheduleOverview.m, UIxAppointmentView.m, diff --git a/SOGo/UI/Scheduler/English.lproj/Localizable.strings b/SOGo/UI/Scheduler/English.lproj/Localizable.strings index 0cae556a..e3725154 100644 --- a/SOGo/UI/Scheduler/English.lproj/Localizable.strings +++ b/SOGo/UI/Scheduler/English.lproj/Localizable.strings @@ -140,6 +140,7 @@ "Public" = "Public"; "Private" = "Private"; /* text used in overviews and tooltips */ +"empty title" = "Empty title"; "private appointment" = "Private appointment"; /* Appointments (participation state) */ diff --git a/SOGo/UI/Scheduler/UIxCalView.m b/SOGo/UI/Scheduler/UIxCalView.m index 4537a0d5..17c5487b 100644 --- a/SOGo/UI/Scheduler/UIxCalView.m +++ b/SOGo/UI/Scheduler/UIxCalView.m @@ -67,7 +67,11 @@ static BOOL shouldDisplayWeekend = NO; [self->aptTooltipFormatter setTooltip]; [self->privateAptFormatter setPrivateDetails]; [self->privateAptTooltipFormatter setPrivateTooltip]; - + + title = [self labelForKey:@"empty title"]; + [self->aptFormatter setTitlePlaceholder:title]; + [self->aptTooltipFormatter setTitlePlaceholder:title]; + title = [self labelForKey:@"private appointment"]; [self->privateAptFormatter setPrivateTitle:title]; [self->privateAptTooltipFormatter setPrivateTitle:title]; diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 23169dd8..3a0c1d4f 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,7 +1,8 @@ # Version file -SUBMINOR_VERSION:=135 +SUBMINOR_VERSION:=136 +# v0.9.136 requires SOGoUI v0.9.30 # v0.9.123 requires Appointments v0.9.35 # v0.9.123 requires SOGoUI v0.9.24 # v0.9.115 requires NGiCal v4.5.44 -- 2.39.5