From 6c51e6e1325fc3a4356617e5e1af34883bae1ce3 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 6 Jan 2010 19:43:23 +0000 Subject: [PATCH] Monotone-Parent: 94cd3c2d69b764a47aa3032dde40735f50a696c9 Monotone-Revision: e37818ac299ffd1845d90c7047747a1432c95bcf Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-01-06T19:43:23 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/Scheduler/UIxCalMainView.h | 1 + UI/Scheduler/UIxCalMainView.m | 21 +++++++++++++++------ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3953718d9..afe1a3c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-01-06 Wolfgang Sourdeau + * UI/Scheduler/UIxCalMainView.m (-_setupContext): only invoked once + per instance. + (-checkDefaultModulePreference): synchronize the user defaults + after the login module was modified. + * UI/Scheduler/UIxDatePicker.m (-takeValuesFromRequest:inContext:): we set the new date to the user's timezone and recompute the proper offset compare to the diff --git a/UI/Scheduler/UIxCalMainView.h b/UI/Scheduler/UIxCalMainView.h index 4128a7ce2..c1e033b4d 100644 --- a/UI/Scheduler/UIxCalMainView.h +++ b/UI/Scheduler/UIxCalMainView.h @@ -35,6 +35,7 @@ NSNumber *yearMenuItem; SOGoUserSettings *us; NSMutableDictionary *moduleSettings; + BOOL contextIsSetup; } - (NSArray *) monthMenuItems; diff --git a/UI/Scheduler/UIxCalMainView.m b/UI/Scheduler/UIxCalMainView.m index 9ccb05a53..05e247a45 100644 --- a/UI/Scheduler/UIxCalMainView.m +++ b/UI/Scheduler/UIxCalMainView.m @@ -49,7 +49,10 @@ ud = [[context activeUser] userDefaults]; if ([ud rememberLastModule]) - [ud setLoginModule: @"Calendar"]; + { + [ud setLoginModule: @"Calendar"]; + [ud synchronize]; + } } - (void) _setupContext @@ -58,6 +61,7 @@ NSString *module; SOGoAppointmentFolders *clientObject; + contextIsSetup = YES; [self checkDefaultModulePreference]; activeUser = [context activeUser]; @@ -135,7 +139,8 @@ { NSString *vertical; - [self _setupContext]; + if (!contextIsSetup) + [self _setupContext]; vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; return ((vertical && [vertical intValue] > 0) ? (id)[vertical stringByAppendingFormat: @"px"] : nil); @@ -145,7 +150,8 @@ { NSString *horizontal; - [self _setupContext]; + if (!contextIsSetup) + [self _setupContext]; horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; return ((horizontal && [horizontal intValue] > 0) ? (id)[horizontal stringByAppendingFormat: @"px"] : nil); @@ -155,7 +161,8 @@ { NSString *height; - [self _setupContext]; + if (!contextIsSetup) + [self _setupContext]; height = [moduleSettings objectForKey: @"DragHandleVertical"]; return ((height && [height intValue] > 0) ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil); @@ -166,7 +173,8 @@ WORequest *request; NSString *dragHandle; - [self _setupContext]; + if (!contextIsSetup) + [self _setupContext]; request = [context request]; if ((dragHandle = [request formValueForKey: @"vertical"]) != nil) @@ -205,7 +213,8 @@ { NSString *view; - [self _setupContext]; + if (!contextIsSetup) + [self _setupContext]; view = [moduleSettings objectForKey: @"View"]; return (view ? view : @"weekview");