Preferences saving support

This commit is contained in:
Ludovic Marcotte
2015-06-12 11:27:17 -04:00
committed by Francis Lachapelle
parent 2edfd1863b
commit 96d2a4cea8
6 changed files with 34 additions and 24 deletions
+18 -9
View File
@@ -58,14 +58,6 @@
#import "UIxPreferences.h"
#warning this class is not finished
/* remaining:
default event length
default snooze length
refresh calendar every X minutes
workweek = from -> to
identities */
static NSArray *reminderItems = nil;
static NSArray *reminderValues = nil;
@@ -1889,7 +1881,24 @@ static NSArray *reminderValues = nil;
- (id <WOActionResults>) saveAction
{
//return [self responseWithStatus: 200 andJSONRepresentation: data];
SOGoUser *user;
id o, v;
o = [[[context request] contentAsString] objectFromJSONString];
user = [[self context] activeUser];
if ((v = [o objectForKey: @"defaults"]))
{
[[[user userDefaults] source] setValues: v];
[[user userDefaults] synchronize];
}
if ((v = [o objectForKey: @"settings"]))
{
[[[user userSettings] source] setValues: v];
[[user userSettings] synchronize];
}
return [self responseWithStatus: 200];
}