diff --git a/ChangeLog b/ChangeLog index ce65914ed..3b1ab3bf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,12 @@ 2009-11-28 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserSettings.m: new class module designed to + be the counterpart to SOGoUserDefaults.m. + * UI/PreferencesUI/UIxPreferences.m (-): "hours" is now a static variable, rather than an ivar. - * UI/MainUI/SOGoRootPage.m (+initialized): the supportedLanguages + * UI/MainUI/SOGoRootPage.m (+initialize): the supportedLanguages are not available from the SOGoSystemDefaults (SOGoDefaults.plist). diff --git a/SoObjects/SOGo/SOGoUserSettings.h b/SoObjects/SOGo/SOGoUserSettings.h new file mode 100644 index 000000000..2778c58bd --- /dev/null +++ b/SoObjects/SOGo/SOGoUserSettings.h @@ -0,0 +1,36 @@ +/* SOGoUserSettings.h - this file is part of SOGo + * + * Copyright (C) 2009 Inverse inc. + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef SOGOUSERSETTINGS_H +#define SOGOUSERSETTINGS_H + +@class NSString; + +#import "SOGoDefaultsSource.h" + +@interface SOGoUserSettings : SOGoDefaultsSource + ++ (SOGoUserSettings *) settingsForUser: (NSString *) userId; + +@end + +#endif /* SOGOUSERSETTINGS_H */ diff --git a/SoObjects/SOGo/SOGoUserSettings.m b/SoObjects/SOGo/SOGoUserSettings.m new file mode 100644 index 000000000..af1bc5a51 --- /dev/null +++ b/SoObjects/SOGo/SOGoUserSettings.m @@ -0,0 +1,57 @@ +/* SOGoUserSettings.m - this file is part of SOGo + * + * Copyright (C) 2009 Inverse inc. + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import "SOGoUserProfile.h" + +#import "SOGoUserSettings.h" + +static Class SOGoUserProfileKlass = Nil; + +@implementation SOGoUserSettings + ++ (NSString *) userProfileClassName +{ + return @"SOGoSQLUserProfile"; +} + ++ (void) initialize +{ + if (!SOGoUserProfileKlass) + SOGoUserProfileKlass = NSClassFromString ([self userProfileClassName]); +} + ++ (SOGoUserSettings *) settingsForUser: (NSString *) userId +{ + SOGoUserProfile *up; + SOGoUserSettings *ud; + + up = [SOGoUserProfileKlass userProfileWithType: SOGoUserProfileTypeSettings + forUID: userId]; + [up fetchProfile]; + ud = [self defaultsSourceWithSource: up andParentSource: nil]; + + return ud; +} + +@end