aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/settings.vala
blob: aac839172cbdee4d49a742b0279697fb8873df42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace Dino {

public class Settings {

    private GLib.Settings gsettings;

    public bool send_typing {
        get { return gsettings.get_boolean("send-typing"); }
        set { gsettings.set_boolean("send-typing", value); }
    }

    public bool send_marker {
        get { return gsettings.get_boolean("send-marker"); }
        set { gsettings.set_boolean("send-marker", value); }
    }

    public bool notifications {
        get { return gsettings.get_boolean("notifications"); }
        set { gsettings.set_boolean("notifications", value); }
    }

    public bool convert_utf8_smileys {
        get { return gsettings.get_boolean("convert-utf8-smileys"); }
        set { gsettings.set_boolean("convert-utf8-smileys", value); }
    }

    public Settings(GLib.Settings gsettings) {
        this.gsettings = gsettings;
    }

    public static Settings instance() {
        SettingsSchemaSource sss = SettingsSchemaSource.get_default();
        SettingsSchema? schema = sss.lookup("org.dino-im", true);
        return new Settings(new GLib.Settings.full(schema, null, null));
    }
}

}