~indicator-multiload/indicator-multiload/trunk

« back to all changes in this revision

Viewing changes to src/advpreferences.vala

  • Committer: Michael Hofmann
  • Date: 2013-03-04 07:24:42 UTC
  • Revision ID: mh21@mh21.de-20130304072442-3akm19mft6oc22e2
Revert to color scheme default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    public ColorMapper colormapper { get; construct; }
40
40
 
41
41
    public signal void itemhelp_show();
 
42
    public signal void colorscheme_restore();
42
43
 
43
44
    public AdvancedPreferences(ColorMapper colormapper) {
44
45
        Object(colormapper: colormapper);
93
94
    }
94
95
 
95
96
    private void revert() {
96
 
        // TODO: reset color to scheme
97
97
        var graphids = this.settingscache.generalsettings().get_strv("graphs");
98
98
        foreach (var graphid in graphids) {
99
99
            var graphsettings = this.settingscache.graphsettings(graphid);
101
101
                graphsettings.reset(key);
102
102
            foreach (var traceid in graphsettings.get_strv("traces")) {
103
103
                var tracesettings = this.settingscache.tracesettings(graphid, traceid);
104
 
                foreach (var key in tracesettings.list_keys())
105
 
                    tracesettings.reset(key);
 
104
                foreach (var key in tracesettings.list_keys()) {
 
105
                    if (key != "color")
 
106
                        tracesettings.reset(key);
 
107
                }
106
108
            }
107
109
        }
 
110
        this.colorscheme_restore();
108
111
    }
109
112
 
110
113
    [CCode (instance_pos = -1)]