From fc44681f937245fb30c4bfb90d0035b2a4b183cb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 27 Oct 2006 14:59:42 +0000 Subject: [PATCH] Monotone-Parent: cec3c34e883271cb83717c6213c1046000d1505c Monotone-Revision: 6d56419b7d5597b9d628c55862bb252fa456951b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-27T14:59:42 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 ++++ UI/SOGoUI/SOGoAptFormatter.m | 97 +++++++++++++++++++++--------------- 2 files changed, 65 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef48b8720..ee5067074 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-10-27 Wolfgang Sourdeau + + * UI/SOGoUI/SOGoAptFormatter.m: enlarge the text size limit from + 12 to 50 before displaying "...". + ([SOGoAptFormatter -fullDetailsForApt::]): display location only + if its length > 0, whether location itself is nil or not... + ([SOGoAptFormatter -tooltipForApt::_refDate]): display information + of which the length > 0. + 2006-10-26 Wolfgang Sourdeau * UI/WebServerResources/UIxAppointmentEditor.js: correctly handles diff --git a/UI/SOGoUI/SOGoAptFormatter.m b/UI/SOGoUI/SOGoAptFormatter.m index 593ba15d2..ed01905af 100644 --- a/UI/SOGoUI/SOGoAptFormatter.m +++ b/UI/SOGoUI/SOGoAptFormatter.m @@ -221,8 +221,8 @@ NSString *title; title = [self titleForApt:_apt :_refDate]; - if ([title length] > 12) - title = [[title substringToIndex:11] stringByAppendingString:@"..."]; + if ([title length] > 50) + title = [[title substringToIndex: 49] stringByAppendingString:@"..."]; return title; } @@ -243,26 +243,33 @@ return aptDescr; } -- (NSString *)fullDetailsForApt:(id)_apt :(NSCalendarDate *)_refDate { +- (NSString *) fullDetailsForApt: (id)_apt + : (NSCalendarDate *)_refDate +{ NSMutableString *aptDescr; - NSString *s; - - aptDescr = [NSMutableString stringWithCapacity:60]; - [self appendTimeInfoFromApt:_apt - usingReferenceDate:_refDate - toBuffer:aptDescr]; - if ((s = [_apt valueForKey:@"location"]) != nil) { - if([s length] > 12) - s = [[s substringToIndex:11] stringByAppendingString:@"..."]; - [aptDescr appendFormat:@" (%@)", s]; - } - if ((s = [self shortTitleForApt:_apt :_refDate]) != nil) + NSString *s; + + aptDescr = [NSMutableString stringWithCapacity: 60]; + [self appendTimeInfoFromApt: _apt + usingReferenceDate: _refDate + toBuffer: aptDescr]; + s = [_apt valueForKey: @"location"]; + if ([s length] > 0) + { + if ([s length] > 50) + s = [[s substringToIndex: 49] stringByAppendingString: @"..."]; + [aptDescr appendFormat:@" (%@)", s]; + } + s = [self shortTitleForApt: _apt : _refDate]; + if ([s length] > 0) [aptDescr appendFormat:@"
%@", s]; return aptDescr; } -- (NSString *)detailsForPrivateApt:(id)_apt :(NSCalendarDate *)_refDate { +- (NSString *) detailsForPrivateApt: (id) _apt + : (NSCalendarDate *) _refDate +{ NSMutableString *aptDescr; NSString *s; @@ -275,53 +282,61 @@ return aptDescr; } -- (NSString *)titleOnlyForPrivateApt:(id)_apt :(NSCalendarDate *)_refDate { +- (NSString *) titleOnlyForPrivateApt: (id)_apt + : (NSCalendarDate *) _refDate +{ NSString *s; s = [self privateTitle]; - if(!s) - return @""; + if (!s) + s = @""; + return s; } -- (NSString *)tooltipForApt:(id)_apt :(NSCalendarDate *)_refDate { +- (NSString *) tooltipForApt: (id)_apt + : (NSCalendarDate *) _refDate +{ NSMutableString *aptDescr; - NSString *s; + NSString *s; - aptDescr = [NSMutableString stringWithCapacity:60]; + aptDescr = [NSMutableString stringWithCapacity: 60]; [aptDescr appendString: @"Date: "]; - [self appendTimeInfoFromApt:_apt - usingReferenceDate:_refDate - toBuffer:aptDescr]; - if ((s = [self titleForApt:_apt :_refDate]) != nil) - [aptDescr appendFormat: @"\n%@%@", - @"Title: ", - s]; - if ((s = [_apt valueForKey:@"location"]) != nil) - [aptDescr appendFormat:@"\n%@%@", - @"Location: ", - s]; - if ((s = [_apt valueForKey:@"description"]) != nil) + [self appendTimeInfoFromApt: _apt + usingReferenceDate: _refDate + toBuffer: aptDescr]; + s = [self titleForApt: _apt : _refDate]; + if ([s length] > 0) + [aptDescr appendFormat: @"\nTitle: %@", s]; + s = [_apt valueForKey: @"location"]; + if ([s length] > 0) + [aptDescr appendFormat: @"\nLocation: %@", s]; + s = [_apt valueForKey: @"description"]; + if ([s length] > 0) [aptDescr appendFormat:@"\n%@", s]; return aptDescr; } -- (NSString *)tooltipForPrivateApt:(id)_apt :(NSCalendarDate *)_refDate { +- (NSString *) tooltipForPrivateApt: (id) _apt + : (NSCalendarDate *) _refDate +{ NSMutableString *aptDescr; - NSString *s; + NSString *s; - aptDescr = [NSMutableString stringWithCapacity:25]; - [self appendTimeInfoFromApt:_apt - usingReferenceDate:_refDate - toBuffer:aptDescr]; + aptDescr = [NSMutableString stringWithCapacity: 25]; + [self appendTimeInfoFromApt: _apt + usingReferenceDate: _refDate + toBuffer: aptDescr]; if ((s = [self privateTitle]) != nil) [aptDescr appendFormat:@"\n%@", s]; return aptDescr; } -- (NSString *)suppressApt:(id)_apt :(NSCalendarDate *)_refDate { +- (NSString *) suppressApt: (id) _apt + : (NSCalendarDate *) _refDate +{ return @""; }