2
* Copyright (C) 2012 Canonical, Ltd.
4
* This library is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License
6
* version 3.0 as published by the Free Software Foundation.
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License version 3.0 for more details.
13
* You should have received a copy of the GNU Lesser General Public
14
* License along with this library. If not, see
15
* <http://www.gnu.org/licenses/>.
17
* Authored by Didier Roche <didrocks@ubuntu.com>
26
* A singleton class that caches different gsettings settings.
29
public class PreferencesManager : GLib.Object
31
private static PreferencesManager singleton = null;
33
private Settings gp_settings;
34
private const string REMOTE_CONTENT_KEY = "remote-content-search";
36
public enum RemoteContent
42
private PreferencesManager ()
49
gp_settings = new Settings ("com.canonical.Unity.Lenses");
50
gp_settings.bind (REMOTE_CONTENT_KEY, this, "remote_content_search", SettingsBindFlags.GET);
53
public RemoteContent remote_content_search { get; set; default = RemoteContent.ALL; }
56
* Get a ref to the singleton PreferencesManager
58
public static PreferencesManager get_default ()
60
if (PreferencesManager.singleton == null)
61
PreferencesManager.singleton = new PreferencesManager();
63
return PreferencesManager.singleton;
66
} /* class PreferencesManager */