~ubuntu-branches/ubuntu/precise/shotwell/precise-updates

« back to all changes in this revision

Viewing changes to src/config/HybridEngine.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-01-11 15:59:04 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120111155904-q6v4rpavyw50jfwz
Tags: 0.11.91-0ubuntu1
* New upstream version using GTK3 (lp: #871034),
  should fix lp: #800459, #881896, #887357, #888363, #898028
* Refreshed patches for the new version
* debian/control:
  - updated build-dependencies for GTK3
* debian/patches/99git_libraw_api.patch:
  - dropped, the patch is in the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2009-2011 Yorba Foundation
2
 
 *
3
 
 * This software is licensed under the GNU LGPL (version 2.1 or later).
4
 
 * See the COPYING file in this distribution. 
5
 
 */
6
 
 
7
 
// This configuration engine uses GSettings for everything. But it also uses
8
 
// GConf for the desktop wallpaper settings in addition to GSettings. This is to
9
 
// make Ubuntu work as expected.
10
 
public class HybridConfigurationEngine : ConfigurationEngine, GLib.Object {
11
 
    private GConfConfigurationEngine gconf = new GConfConfigurationEngine();
12
 
    private GSettingsConfigurationEngine gsettings = new GSettingsConfigurationEngine();
13
 
    
14
 
    public HybridConfigurationEngine() {
15
 
        gconf.property_changed.connect(on_property_changed);
16
 
        gsettings.property_changed.connect(on_property_changed);
17
 
    }
18
 
    
19
 
    ~HybridConfigurationEngine() {
20
 
        gconf.property_changed.disconnect(on_property_changed);
21
 
        gsettings.property_changed.disconnect(on_property_changed);
22
 
    }
23
 
    
24
 
    public string get_name() {
25
 
        return "Hybrid";
26
 
    }
27
 
 
28
 
    public int get_int_property(ConfigurableProperty p) throws ConfigurationError {
29
 
        return gsettings.get_int_property(p);
30
 
    }
31
 
    
32
 
    public void set_int_property(ConfigurableProperty p, int val) throws ConfigurationError {
33
 
        gsettings.set_int_property(p, val);
34
 
    }
35
 
    
36
 
    public string get_string_property(ConfigurableProperty p) throws ConfigurationError {
37
 
        return gsettings.get_string_property(p);
38
 
    }
39
 
    
40
 
    public void set_string_property(ConfigurableProperty p, string val) throws ConfigurationError {
41
 
        gsettings.set_string_property(p, val);
42
 
        if (p == ConfigurableProperty.DESKTOP_BACKGROUND_FILE ||
43
 
            p == ConfigurableProperty.DESKTOP_BACKGROUND_MODE)
44
 
            gconf.set_string_property(p, val);
45
 
    }
46
 
    
47
 
    public bool get_bool_property(ConfigurableProperty p) throws ConfigurationError {
48
 
        return gsettings.get_bool_property(p);
49
 
    }
50
 
    
51
 
    public void set_bool_property(ConfigurableProperty p, bool val) throws ConfigurationError {
52
 
        gsettings.set_bool_property(p, val);
53
 
    }
54
 
    
55
 
    public double get_double_property(ConfigurableProperty p) throws ConfigurationError {
56
 
        return gsettings.get_double_property(p);
57
 
    }
58
 
    
59
 
    public void set_double_property(ConfigurableProperty p, double val) throws ConfigurationError {
60
 
        gsettings.set_double_property(p, val);
61
 
    }
62
 
    
63
 
    public bool get_plugin_bool(string domain, string id, string key, bool def) {
64
 
        return gsettings.get_plugin_bool(domain, id, key, def);
65
 
    }
66
 
    
67
 
    public void set_plugin_bool(string domain, string id, string key, bool val) {
68
 
        gsettings.set_plugin_bool(domain, id, key, val);
69
 
    }
70
 
    
71
 
    public double get_plugin_double(string domain, string id, string key, double def) {
72
 
        return gsettings.get_plugin_double(domain, id, key, def);
73
 
    }
74
 
    
75
 
    public void set_plugin_double(string domain, string id, string key, double val) {
76
 
        gsettings.set_plugin_double(domain, id, key, val);
77
 
    }
78
 
    
79
 
    public int get_plugin_int(string domain, string id, string key, int def) {
80
 
        return gsettings.get_plugin_int(domain, id, key, def);
81
 
    }
82
 
    
83
 
    public void set_plugin_int(string domain, string id, string key, int val) {
84
 
        gsettings.set_plugin_int(domain, id, key, val);
85
 
    }
86
 
    
87
 
    public string? get_plugin_string(string domain, string id, string key, string? def) {
88
 
        return gsettings.get_plugin_string(domain, id, key, def);
89
 
    }
90
 
    
91
 
    public void set_plugin_string(string domain, string id, string key, string? val) {
92
 
        gsettings.set_plugin_string(domain, id, key, val);
93
 
    }
94
 
    
95
 
    public void unset_plugin_key(string domain, string id, string key) {
96
 
        gsettings.unset_plugin_key(domain, id, key);
97
 
    }
98
 
    
99
 
    public FuzzyPropertyState is_plugin_enabled(string id) {
100
 
        return gsettings.is_plugin_enabled(id);
101
 
    }
102
 
 
103
 
    public void set_plugin_enabled(string id, bool enabled) {
104
 
        gsettings.set_plugin_enabled(id, enabled);
105
 
    }
106
 
    
107
 
    private void on_property_changed(ConfigurableProperty p) {
108
 
        property_changed(p);
109
 
    }
110
 
}
111