From da0d3dfb5a5a48b117ac5b28f435db0821ed3eaa Mon Sep 17 00:00:00 2001 From: C Robert Date: Fri, 31 Jul 2009 17:52:49 +0000 Subject: [PATCH] Mantis 3572 SOGoMailPollingIntervals Monotone-Parent: 42164e46f40378824b21554163c98f9ca67ade4b Monotone-Revision: 445116f4d4dc0f02dc0569b5b726887999b51c7f Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-07-31T17:52:49 Monotone-Branch: ca.inverse.sogo --- UI/PreferencesUI/UIxPreferences.m | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index 2d882b55e..a6e2f1d93 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -475,10 +475,38 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; - (NSArray *) messageCheckList { - return [NSArray arrayWithObjects: @"manually", @"every_minute", + NSArray *defaultList; + NSMutableArray *rc; + NSString *tmp; + int i, count; + + defaultList = [NSMutableArray arrayWithArray: + [[NSUserDefaults standardUserDefaults] + arrayForKey: @"SOGoMailPollingIntervals"]]; + if ([defaultList count] > 0) + { + NSLog (@"defaultsValue: %@", defaultList); + rc = [NSMutableArray arrayWithObjects: @"manually", nil]; + count = [defaultList count]; + for (i = 0; i < count; i++) + { + int value = [[defaultList objectAtIndex: i] intValue]; + if (value == 1) + tmp = @"every_minute"; + else if (value == 60) + tmp = @"once_per_hour"; + else + tmp = [NSString stringWithFormat: @"every_%d_minutes", value]; + [rc addObject: tmp]; + } + } + else + rc = [NSArray arrayWithObjects: @"manually", @"every_minute", @"every_2_minutes", @"every_5_minutes", @"every_10_minutes", @"every_20_minutes", @"every_30_minutes", @"once_per_hour", nil]; + + return rc; } - (NSString *) itemMessageCheckText