Monotone-Parent: bc78b9b254f96e0d0101e04673ec9e39cec14f8c

Monotone-Revision: 985fef86a89f89cae1460daa879141f78ad0b404

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-09-05T14:53:38
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-09-05 14:53:38 +00:00
parent 87b85bb0f7
commit 5eee673bd0
3 changed files with 42 additions and 8 deletions
+8
View File
@@ -1,3 +1,11 @@
2006-09-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/SOGoUI/UIxComponent.m ([UIxComponent -init]): new
"viewTimeZone" ivar destined to hold an instance of the user's
timezone in memory.
([UIxComponent -viewTimeZone]): take the timezone from the user's
prefs.
2006-08-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Templates/SchedulerUI/UIxAppointmentEditor.wox: completely
+1
View File
@@ -37,6 +37,7 @@
@interface UIxComponent : SoComponent
{
NSMutableDictionary *queryParameters;
NSTimeZone *viewTimeZone;
}
- (NSString *)queryParameterForKey:(NSString *)_key;
+33 -8
View File
@@ -26,6 +26,8 @@
#import <NGObjWeb/SoHTTPAuthenticator.h>
#import <NGObjWeb/WOResourceManager.h>
#import <SOGo/SOGoUser.h>
@interface UIxComponent (PrivateAPI)
- (void)_parseQueryString:(NSString *)_s;
- (NSMutableDictionary *)_queryParameters;
@@ -33,7 +35,6 @@
@implementation UIxComponent
static NSTimeZone *MET = nil;
static NSTimeZone *GMT = nil;
static NSMutableArray *dayLabelKeys = nil;
@@ -56,10 +57,9 @@ static BOOL uixDebugEnabled = NO;
uixDebugEnabled = [ud boolForKey:@"SOGoUIxDebugEnabled"];
if (MET == nil) {
MET = [[NSTimeZone timeZoneWithAbbreviation:@"MET"] retain];
if (!GMT)
GMT = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain];
}
if (dayLabelKeys == nil) {
dayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
[dayLabelKeys addObject:@"Sunday"];
@@ -109,8 +109,21 @@ static BOOL uixDebugEnabled = NO;
}
}
- (void)dealloc {
- (id) init
{
if ((self = [super init]))
{
viewTimeZone = nil;
}
return self;
}
- (void) dealloc
{
[self->queryParameters release];
if (viewTimeZone)
[viewTimeZone release];
[super dealloc];
}
@@ -307,9 +320,21 @@ static BOOL uixDebugEnabled = NO;
/* date */
- (NSTimeZone *)viewTimeZone {
// Note: also in the folder, should be based on a cookie?
return MET;
- (NSTimeZone *) viewTimeZone
{
NSUserDefaults *userPrefs;
SOGoUser *currentUser;
if (!viewTimeZone)
{
currentUser = [[self context] activeUser];
userPrefs = [currentUser userDefaults];
viewTimeZone = [NSTimeZone timeZoneWithName:
[userPrefs stringForKey: @"timezonename"]];
[viewTimeZone retain];
}
return viewTimeZone;
}
- (NSTimeZone *)backendTimeZone {