[dconf-editor] Move a function.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Move a function.
- Date: Sun, 11 Oct 2015 00:34:36 +0000 (UTC)
commit b3800c262eee2b3f041735dc44ad6cf9038ad2c1
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sun Oct 11 02:23:53 2015 +0200
Move a function.
editor/dconf-model.vala | 5 +----
editor/dconf-window.vala | 15 ++++++++++-----
2 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 4af78f0..991c282 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -57,10 +57,7 @@ public class Key : SettingObject
private SettingsModel model;
public string path;
- public string cool_text_value () // TODO cannot do a property from this because of ownership problem
with variant.print()
- {
- return cool_text_value_from_variant (value, type_string);
- }
+
public static string cool_text_value_from_variant (Variant variant, string type)
{
if (type == "b")
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index d4b1a33..5d95e2a 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -410,6 +410,11 @@ private class KeyListBoxRow : EventBox
return false;
}
+
+ protected static string cool_text_value (Key key) // TODO better
+ {
+ return Key.cool_text_value_from_variant (key.value, key.type_string);
+ }
}
private class KeyListBoxRowEditableNoSchema : KeyListBoxRow
@@ -421,15 +426,15 @@ private class KeyListBoxRowEditableNoSchema : KeyListBoxRow
this.key = _key;
Pango.AttrList attr_list = new Pango.AttrList ();
- attr_list.insert (Pango.attr_weight_new (Pango.Weight.BOLD)); // TODO good?
+ attr_list.insert (Pango.attr_weight_new (Pango.Weight.BOLD));
key_name_label.set_attributes (attr_list);
key_value_label.set_attributes (attr_list);
key_name_label.label = key.name;
- key_value_label.label = key.cool_text_value ();
+ key_value_label.label = cool_text_value (key);
key_info_label.set_markup ("<i>" + _("No Schema Found") + "</i>");
- key.value_changed.connect (() => { key_value_label.label = key.cool_text_value (); if (popover !=
null) popover.destroy (); });
+ key.value_changed.connect (() => { key_value_label.label = cool_text_value (key); if (popover !=
null) popover.destroy (); });
}
protected override bool generate_popover ()
@@ -501,11 +506,11 @@ private class KeyListBoxRowEditable : KeyListBoxRow
private void update ()
{
- attr_list.change (Pango.attr_weight_new (key.is_default ? Pango.Weight.NORMAL : Pango.Weight.BOLD));
// TODO good?
+ attr_list.change (Pango.attr_weight_new (key.is_default ? Pango.Weight.NORMAL : Pango.Weight.BOLD));
key_name_label.set_attributes (attr_list);
// TODO key_info_label.set_attributes (attr_list); ?
- key_value_label.label = key.cool_text_value ();
+ key_value_label.label = cool_text_value (key);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]