~ubuntu-branches/ubuntu/quantal/d-conf/quantal-updates

« back to all changes in this revision

Viewing changes to editor/dconf-editor.vala

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-03-23 14:59:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110323145953-clxdx551vtyy6i8k
Tags: 0.7.3-0ubuntu1
* New upstream release
* debian/patches/integer-no-schema.patch:
* debian/patches/fix_settings_model_get_path.patch:
  - Applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
            key_tree_view.get_selection().select_iter(iter);
81
81
    }
82
82
 
83
 
    private string type_to_description(string type)
 
83
    private string key_to_description(Key key)
84
84
    {
85
 
        switch(type)
 
85
        switch(key.schema.type)
86
86
        {
 
87
        case "y":
 
88
        case "n":
 
89
        case "q":
87
90
        case "i":
88
 
           return "Integer";
 
91
        case "u":
 
92
        case "x":
 
93
        case "t":
 
94
        case "d":
 
95
            Variant min, max;
 
96
            if (key.schema.range != null)
 
97
            {
 
98
                min = key.schema.range.min;
 
99
                max = key.schema.range.max;
 
100
            }
 
101
            else
 
102
            {
 
103
                min = key.get_min();
 
104
                max = key.get_max();
 
105
            }
 
106
            return "Integer [%s..%s]".printf(min.print(false), max.print(false));
89
107
        case "b":
90
 
           return "Boolean";
 
108
            return "Boolean";
91
109
        case "s":
92
 
           return "String";
93
 
        case "enum":
94
 
           return "Enumeration";
 
110
            return "String";
 
111
        case "<enum>":
 
112
            return "Enumeration";
95
113
        default:
96
 
           return type;
 
114
            return key.schema.type;
97
115
        }
98
116
    }
99
117
 
129
147
                    summary = selected_key.schema.summary;
130
148
                if (selected_key.schema.description != null)
131
149
                    description = selected_key.schema.description;
132
 
                type = type_to_description(selected_key.schema.type);
 
150
                type = key_to_description(selected_key);
133
151
                default_value = selected_key.schema.default_value.print(false);
134
152
            }
135
153
            else
139
157
        }
140
158
 
141
159
        schema_label.set_text(schema_name);
142
 
        summary_label.set_text(summary);
 
160
        summary_label.set_text(summary.strip());
143
161
        description_label.set_text(description.strip());
144
162
        type_label.set_text(type);
145
163
        default_label.set_text(default_value);