[dconf-editor] Quit RegistryInfo when ghosting.



commit a2f2f6f173e043fb28bdca7d5afef0b0d9d0c711
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Jul 29 02:03:27 2016 +0200

    Quit RegistryInfo when ghosting.

 editor/registry-info.vala |    9 ++++++++-
 editor/registry-view.vala |    2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/editor/registry-info.vala b/editor/registry-info.vala
index 79181f8..c24ce0a 100644
--- a/editor/registry-info.vala
+++ b/editor/registry-info.vala
@@ -93,7 +93,12 @@ class RegistryInfo : Grid
         if (!dict.lookup ("type-code",    "s", out tmp_string)) assert_not_reached ();
 
         Label label = new Label (get_current_value_text (has_schema && ((GSettingsKey) key).is_default, 
key));
-        ulong key_value_changed_handler = key.value_changed.connect (() => { label.set_text 
(get_current_value_text (has_schema && ((GSettingsKey) key).is_default, key)); });
+        ulong key_value_changed_handler = key.value_changed.connect (() => {
+                if (!has_schema && ((DConfKey) key).is_ghost)
+                    ((RegistryView) get_parent ().get_parent ()).show_browse_view (false);
+                else
+                    label.set_text (get_current_value_text (has_schema && ((GSettingsKey) key).is_default, 
key));
+            });
         label.halign = Align.START;
         label.valign = Align.START;
         label.xalign = 0;
@@ -178,6 +183,8 @@ class RegistryInfo : Grid
 
         ulong child_activated_handler = key_editor_child.child_activated.connect (() => { 
revealer.apply_delayed_settings (); });  // TODO "only" used for string-based and spin widgets
         revealer_reload_2_handler = revealer.reload.connect (() => {
+                if (key is DConfKey && ((DConfKey) key).is_ghost)
+                    return;
                 SignalHandler.block (key_editor_child, value_has_changed_handler);
                 key_editor_child.reload (key.value);
                 if (tmp_string == "<flags>")
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index ae5a8f0..1eee781 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -85,7 +85,7 @@ class RegistryView : Grid
     * * Stack switching
     \*/
 
-    private void show_browse_view (bool transition = true)
+    public void show_browse_view (bool transition = true)
     {
         enable_transition (transition);
         stack.set_visible_child_name ("browse-view");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]