[dconf-editor] Move delayed changes logic into new class
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Move delayed changes logic into new class
- Date: Tue, 5 Dec 2017 10:57:19 +0000 (UTC)
commit 1e40e6308bb2e16c157230793d7147958071ee5f
Author: Davi da Silva Böger <dsboger gmail com>
Date: Mon Dec 4 02:21:42 2017 -0200
Move delayed changes logic into new class
editor/browser-view.ui | 3 -
editor/browser-view.vala | 24 +++--
editor/meson.build | 1 +
editor/modifications-handler.vala | 187 +++++++++++++++++++++++++++++++++
editor/modifications-revealer.vala | 202 ++++++------------------------------
editor/registry-info.vala | 32 +++---
editor/registry-search.vala | 10 +-
editor/registry-view.vala | 10 +-
8 files changed, 264 insertions(+), 205 deletions(-)
---
diff --git a/editor/browser-view.ui b/editor/browser-view.ui
index b8a45d8..38619a6 100644
--- a/editor/browser-view.ui
+++ b/editor/browser-view.ui
@@ -47,7 +47,6 @@
<child>
<object class="RegistryView" id="browse_view">
<property name="visible">True</property>
- <property name="revealer">revealer</property>
<signal name="request_path" handler="request_path_test"/>
</object>
<packing>
@@ -57,7 +56,6 @@
<child>
<object class="RegistryInfo" id="properties_view">
<property name="visible">True</property>
- <property name="revealer">revealer</property>
</object>
<packing>
<property name="name">properties-view</property>
@@ -66,7 +64,6 @@
<child>
<object class="RegistrySearch" id="search_results_view">
<property name="visible">True</property>
- <property name="revealer">revealer</property>
<signal name="request_path" handler="request_path_test"/>
</object>
<packing>
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index 50192fd..8f21af8 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -53,6 +53,8 @@ class BrowserView : Grid, PathElement
[GtkChild] private ModificationsRevealer revealer;
+ private ModificationsHandler modifications_handler;
+
private DConfWindow? _window = null;
private DConfWindow window {
get {
@@ -64,10 +66,16 @@ class BrowserView : Grid, PathElement
construct
{
- ulong revealer_reload_handler = revealer.reload.connect (invalidate_popovers);
+ modifications_handler = new ModificationsHandler ();
+ revealer.modifications_handler = modifications_handler;
+ browse_view.modifications_handler = modifications_handler;
+ properties_view.modifications_handler = modifications_handler;
+ search_results_view.modifications_handler = modifications_handler;
+
+ ulong modifications_handler_reload_handler = modifications_handler.reload.connect
(invalidate_popovers);
ulong behaviour_changed_handler = settings.changed ["behaviour"].connect (invalidate_popovers);
- settings.bind ("behaviour", revealer, "behaviour",
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
+ settings.bind ("behaviour", modifications_handler, "behaviour",
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
settings.bind ("behaviour", browse_view, "behaviour",
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
sorting_options = new SortingOptions ();
@@ -82,7 +90,7 @@ class BrowserView : Grid, PathElement
destroy.connect (() => {
settings.disconnect (behaviour_changed_handler);
- revealer.disconnect (revealer_reload_handler);
+ modifications_handler.disconnect (modifications_handler_reload_handler);
base.destroy ();
});
}
@@ -173,7 +181,7 @@ class BrowserView : Grid, PathElement
private void update_current_path (string path)
{
- revealer.path_changed ();
+ modifications_handler.path_changed ();
current_path = path;
window.update_path_elements ();
invalidate_popovers ();
@@ -181,7 +189,7 @@ class BrowserView : Grid, PathElement
public bool get_current_delay_mode ()
{
- return revealer.get_current_delay_mode ();
+ return modifications_handler.get_current_delay_mode ();
}
public string? get_copy_text ()
@@ -311,16 +319,16 @@ class BrowserView : Grid, PathElement
if (setting_object is DConfKey)
{
if (!((DConfKey) setting_object).is_ghost)
- revealer.add_delayed_setting ((Key) setting_object, null);
+ modifications_handler.add_delayed_setting ((Key) setting_object, null);
}
else if (!((GSettingsKey) setting_object).is_default)
- revealer.add_delayed_setting ((Key) setting_object, null);
+ modifications_handler.add_delayed_setting ((Key) setting_object, null);
}
}
public void enter_delay_mode ()
{
- revealer.enter_delay_mode ();
+ modifications_handler.enter_delay_mode ();
invalidate_popovers ();
}
diff --git a/editor/meson.build b/editor/meson.build
index 1f5c55e..11d2707 100644
--- a/editor/meson.build
+++ b/editor/meson.build
@@ -57,6 +57,7 @@ sources = files(
'dconf-view.vala',
'dconf-window.vala',
'key-list-box-row.vala',
+ 'modifications-handler.vala',
'modifications-revealer.vala',
'pathbar.vala',
'registry-info.vala',
diff --git a/editor/modifications-handler.vala b/editor/modifications-handler.vala
new file mode 100644
index 0000000..a289259
--- /dev/null
+++ b/editor/modifications-handler.vala
@@ -0,0 +1,187 @@
+/*
+ This file is part of Dconf Editor
+
+ Dconf Editor is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Dconf Editor is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Dconf Editor. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+public enum ModificationsMode {
+ NONE,
+ TEMPORARY,
+ DELAYED
+}
+
+class ModificationsHandler : Object
+{
+ public ModificationsMode mode { get; set; default=ModificationsMode.NONE; }
+
+ private DConf.Client dconf_client = new DConf.Client ();
+
+ private HashTable<string, DConfKey> dconf_keys_awaiting_hashtable = new HashTable<string,
DConfKey> (str_hash, str_equal);
+ private HashTable<string, GSettingsKey> gsettings_keys_awaiting_hashtable = new HashTable<string,
GSettingsKey> (str_hash, str_equal);
+ public uint dconf_changes_count { get { return dconf_keys_awaiting_hashtable.length; } }
+ public uint gsettings_changes_count { get { return gsettings_keys_awaiting_hashtable.length; } }
+
+ public signal void reload ();
+ public signal void delayed_changes_changed ();
+
+ public Behaviour behaviour { get; set; }
+
+ /*\
+ * * Public calls
+ \*/
+
+ public bool get_current_delay_mode ()
+ {
+ return mode == ModificationsMode.DELAYED || behaviour == Behaviour.ALWAYS_DELAY;
+ }
+
+ public bool should_delay_apply (string type_string)
+ {
+ if (get_current_delay_mode () || behaviour == Behaviour.ALWAYS_CONFIRM_IMPLICIT || behaviour ==
Behaviour.ALWAYS_CONFIRM_EXPLICIT)
+ return true;
+ if (behaviour == Behaviour.UNSAFE)
+ return false;
+ if (behaviour == Behaviour.SAFE)
+ return type_string != "b" && type_string != "mb" && type_string != "<enum>" && type_string !=
"<flags>";
+ assert_not_reached ();
+ }
+
+ public void enter_delay_mode ()
+ {
+ mode = ModificationsMode.DELAYED;
+
+ delayed_changes_changed ();
+ }
+
+ public void add_delayed_setting (Key key, Variant? new_value)
+ {
+ key.planned_change = true;
+ key.planned_value = new_value;
+
+ if (key is GSettingsKey)
+ gsettings_keys_awaiting_hashtable.insert (key.descriptor, (GSettingsKey) key);
+ else
+ dconf_keys_awaiting_hashtable.insert (key.descriptor, (DConfKey) key);
+
+ mode = get_current_delay_mode () ? ModificationsMode.DELAYED : ModificationsMode.TEMPORARY;
+
+ delayed_changes_changed ();
+ }
+
+ public void dismiss_change (Key key)
+ {
+ if (mode == ModificationsMode.NONE)
+ mode = behaviour == Behaviour.ALWAYS_DELAY ? ModificationsMode.DELAYED :
ModificationsMode.TEMPORARY;
+
+ key.planned_change = false;
+ key.planned_value = null;
+
+ if (key is GSettingsKey)
+ gsettings_keys_awaiting_hashtable.remove (key.descriptor);
+ else
+ dconf_keys_awaiting_hashtable.remove (key.descriptor);
+
+ delayed_changes_changed ();
+ }
+
+ public void path_changed ()
+ {
+ if (mode != ModificationsMode.TEMPORARY)
+ return;
+ if (behaviour == Behaviour.ALWAYS_CONFIRM_IMPLICIT || behaviour == Behaviour.SAFE)
+ apply_delayed_settings ();
+ else if (behaviour == Behaviour.ALWAYS_CONFIRM_EXPLICIT)
+ dismiss_delayed_settings ();
+ else
+ assert_not_reached ();
+ }
+
+ public void apply_delayed_settings ()
+ {
+ mode = ModificationsMode.NONE;
+
+ /* GSettings stuff */
+
+ HashTable<string, GLib.Settings> delayed_settings_hashtable = new HashTable<string, GLib.Settings>
(str_hash, str_equal);
+ gsettings_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
+ string settings_descriptor = descriptor [0:descriptor.last_index_of_char (' ')]; // strip
the key name
+ GLib.Settings? settings = delayed_settings_hashtable.lookup (settings_descriptor);
+ if (settings == null)
+ {
+ settings = key.settings;
+ ((!) settings).delay ();
+ delayed_settings_hashtable.insert (settings_descriptor, (!) settings);
+ }
+
+ if (key.planned_value == null)
+ ((!) settings).reset (key.name);
+ else
+ ((!) settings).set_value (key.name, (!) key.planned_value);
+ key.planned_change = false;
+
+ return true;
+ });
+
+ delayed_settings_hashtable.foreach_remove ((key_descriptor, schema_settings) => {
schema_settings.apply (); return true; });
+
+ /* DConf stuff */
+
+ DConf.Changeset dconf_changeset = new DConf.Changeset ();
+ dconf_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
+ dconf_changeset.set (key.full_name, key.planned_value);
+
+ if (key.planned_value == null)
+ key.is_ghost = true;
+ key.planned_change = false;
+
+ return true;
+ });
+
+ try {
+ dconf_client.change_sync (dconf_changeset);
+ } catch (Error error) {
+ warning (error.message);
+ }
+
+ /* reload the hamburger menu */
+
+ delayed_changes_changed ();
+ reload ();
+ }
+
+ public void dismiss_delayed_settings ()
+ {
+ mode = ModificationsMode.NONE;
+
+ /* GSettings stuff */
+
+ gsettings_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
+ key.planned_change = false;
+ return true;
+ });
+
+ /* DConf stuff */
+
+ dconf_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
+ key.planned_change = false;
+ return true;
+ });
+
+ /* reload notably key_editor_child */
+
+ delayed_changes_changed ();
+ reload ();
+ }
+
+}
diff --git a/editor/modifications-revealer.vala b/editor/modifications-revealer.vala
index 6b1a731..08956ab 100644
--- a/editor/modifications-revealer.vala
+++ b/editor/modifications-revealer.vala
@@ -20,26 +20,30 @@ using Gtk;
[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/modifications-revealer.ui")]
class ModificationsRevealer : Revealer
{
- private enum Mode {
- NONE,
- TEMPORARY,
- DELAYED
+ private ModificationsHandler _modifications_handler;
+ public ModificationsHandler modifications_handler
+ {
+ private get { return _modifications_handler; }
+ set
+ {
+ _modifications_handler = value;
+ _modifications_handler.delayed_changes_changed.connect (() => {
+ update ();
+ });
+ _modifications_handler.reload.connect (() => {
+ reload ();
+ });
+ }
}
- private Mode mode = Mode.NONE;
[GtkChild] private Label label;
[GtkChild] private ModelButton apply_button;
private ThemedIcon apply_button_icon = new ThemedIcon.from_names ({"object-select-symbolic"});
- private DConf.Client dconf_client = new DConf.Client ();
-
- private HashTable<string, DConfKey> dconf_keys_awaiting_hashtable = new HashTable<string,
DConfKey> (str_hash, str_equal);
- private HashTable<string, GSettingsKey> gsettings_keys_awaiting_hashtable = new HashTable<string,
GSettingsKey> (str_hash, str_equal);
-
public signal void reload ();
- public Behaviour behaviour { private get; set; }
+ public Behaviour behaviour { set { modifications_handler.behaviour = value; } }
/*\
* * Window management callbacks
@@ -63,166 +67,24 @@ class ModificationsRevealer : Revealer
}
}
- /*\
- * * Public calls
- \*/
-
- public bool get_current_delay_mode ()
- {
- return mode == Mode.DELAYED || behaviour == Behaviour.ALWAYS_DELAY;
- }
-
- public bool should_delay_apply (string type_string)
- {
- if (get_current_delay_mode () || behaviour == Behaviour.ALWAYS_CONFIRM_IMPLICIT || behaviour ==
Behaviour.ALWAYS_CONFIRM_EXPLICIT)
- return true;
- if (behaviour == Behaviour.UNSAFE)
- return false;
- if (behaviour == Behaviour.SAFE)
- return type_string != "b" && type_string != "mb" && type_string != "<enum>" && type_string !=
"<flags>";
- assert_not_reached ();
- }
-
- public void enter_delay_mode ()
- {
- mode = Mode.DELAYED;
- apply_button.sensitive = dconf_keys_awaiting_hashtable.length +
gsettings_keys_awaiting_hashtable.length != 0;
- update ();
- }
-
- public void add_delayed_setting (Key key, Variant? new_value)
- {
- key.planned_change = true;
- key.planned_value = new_value;
-
- if (key is GSettingsKey)
- gsettings_keys_awaiting_hashtable.insert (key.descriptor, (GSettingsKey) key);
- else
- dconf_keys_awaiting_hashtable.insert (key.descriptor, (DConfKey) key);
-
- mode = get_current_delay_mode () ? Mode.DELAYED : Mode.TEMPORARY;
-
- apply_button.sensitive = true;
- update ();
- }
-
- public void dismiss_change (Key key)
+ [GtkCallback]
+ private void apply_delayed_settings ()
{
- if (mode == Mode.NONE)
- mode = behaviour == Behaviour.ALWAYS_DELAY ? Mode.DELAYED : Mode.TEMPORARY;
-
- key.planned_change = false;
- key.planned_value = null;
-
- if (key is GSettingsKey)
- gsettings_keys_awaiting_hashtable.remove (key.descriptor);
- else
- dconf_keys_awaiting_hashtable.remove (key.descriptor);
-
- apply_button.sensitive = (mode != Mode.TEMPORARY) && (dconf_keys_awaiting_hashtable.length +
gsettings_keys_awaiting_hashtable.length != 0);
- update ();
+ modifications_handler.apply_delayed_settings ();
}
- public void path_changed ()
+ [GtkCallback]
+ private void dismiss_delayed_settings ()
{
- if (mode != Mode.TEMPORARY)
- return;
- if (behaviour == Behaviour.ALWAYS_CONFIRM_IMPLICIT || behaviour == Behaviour.SAFE)
- apply_delayed_settings ();
- else if (behaviour == Behaviour.ALWAYS_CONFIRM_EXPLICIT)
- dismiss_delayed_settings ();
- else
- assert_not_reached ();
+ modifications_handler.dismiss_delayed_settings ();
}
public void warn_if_no_planned_changes ()
{
- if (dconf_keys_awaiting_hashtable.length == 0 && gsettings_keys_awaiting_hashtable.length == 0)
+ if (modifications_handler.dconf_changes_count == 0 && modifications_handler.gsettings_changes_count
== 0)
label.set_text (_("Nothing to reset."));
}
- /*\
- * * Buttons callbacks
- \*/
-
- [GtkCallback]
- public void apply_delayed_settings ()
- {
- mode = Mode.NONE;
- update ();
-
- /* GSettings stuff */
-
- HashTable<string, GLib.Settings> delayed_settings_hashtable = new HashTable<string, GLib.Settings>
(str_hash, str_equal);
- gsettings_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
- string settings_descriptor = descriptor [0:descriptor.last_index_of_char (' ')]; // strip
the key name
- GLib.Settings? settings = delayed_settings_hashtable.lookup (settings_descriptor);
- if (settings == null)
- {
- settings = key.settings;
- ((!) settings).delay ();
- delayed_settings_hashtable.insert (settings_descriptor, (!) settings);
- }
-
- if (key.planned_value == null)
- ((!) settings).reset (key.name);
- else
- ((!) settings).set_value (key.name, (!) key.planned_value);
- key.planned_change = false;
-
- return true;
- });
-
- delayed_settings_hashtable.foreach_remove ((key_descriptor, schema_settings) => {
schema_settings.apply (); return true; });
-
- /* DConf stuff */
-
- DConf.Changeset dconf_changeset = new DConf.Changeset ();
- dconf_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
- dconf_changeset.set (key.full_name, key.planned_value);
-
- if (key.planned_value == null)
- key.is_ghost = true;
- key.planned_change = false;
-
- return true;
- });
-
- try {
- dconf_client.change_sync (dconf_changeset);
- } catch (Error error) {
- warning (error.message);
- }
-
- /* reload the hamburger menu */
-
- reload ();
- }
-
- [GtkCallback]
- private void dismiss_delayed_settings ()
- {
- mode = Mode.NONE;
- update ();
-
- /* GSettings stuff */
-
- gsettings_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
- key.planned_change = false;
- return true;
- });
-
- /* DConf stuff */
-
- dconf_keys_awaiting_hashtable.foreach_remove ((descriptor, key) => {
- key.planned_change = false;
- return true;
- });
-
- /* reload notably key_editor_child */
-
- reload ();
- }
/*\
* * Utilities
@@ -230,21 +92,22 @@ class ModificationsRevealer : Revealer
private void update ()
{
- if (mode == Mode.NONE)
+ if (modifications_handler.mode == ModificationsMode.NONE)
{
set_reveal_child (false);
label.set_text ("");
+ return;
}
- else if (mode == Mode.TEMPORARY)
+ uint total_changes_count = modifications_handler.dconf_changes_count +
modifications_handler.gsettings_changes_count;
+ if (modifications_handler.mode == ModificationsMode.TEMPORARY)
{
- uint length = dconf_keys_awaiting_hashtable.length + gsettings_keys_awaiting_hashtable.length;
- if (length == 0)
+ if (total_changes_count == 0)
label.set_text (_("The value is invalid."));
- else if (length != 1)
+ else if (total_changes_count != 1)
assert_not_reached ();
- else if (behaviour == Behaviour.ALWAYS_CONFIRM_EXPLICIT)
+ else if (modifications_handler.behaviour == Behaviour.ALWAYS_CONFIRM_EXPLICIT)
label.set_text (_("The change will be dismissed if you quit this view without applying."));
- else if (behaviour == Behaviour.ALWAYS_CONFIRM_IMPLICIT || behaviour == Behaviour.SAFE)
+ else if (modifications_handler.behaviour == Behaviour.ALWAYS_CONFIRM_IMPLICIT ||
modifications_handler.behaviour == Behaviour.SAFE)
label.set_text (_("The change will be applied on such request or if you quit this view."));
else
assert_not_reached ();
@@ -252,7 +115,10 @@ class ModificationsRevealer : Revealer
}
else // if (mode == Mode.DELAYED)
{
- label.set_text (get_text (dconf_keys_awaiting_hashtable.length,
gsettings_keys_awaiting_hashtable.length));
+ if (total_changes_count == 0)
+ label.set_text (_("Nothing to reset."));
+ apply_button.sensitive = total_changes_count > 0;
+ label.set_text (get_text (modifications_handler.dconf_changes_count,
modifications_handler.gsettings_changes_count));
set_reveal_child (true);
}
}
diff --git a/editor/registry-info.vala b/editor/registry-info.vala
index 932ce6e..babb4ba 100644
--- a/editor/registry-info.vala
+++ b/editor/registry-info.vala
@@ -28,7 +28,7 @@ class RegistryInfo : Grid, BrowsableView
[GtkChild] private ListBox properties_list_box;
[GtkChild] private Button erase_button;
- public ModificationsRevealer revealer { get; set; }
+ public ModificationsHandler modifications_handler { get; set; }
/*\
* * Cleaning
@@ -41,16 +41,16 @@ class RegistryInfo : Grid, BrowsableView
public void clean ()
{
disconnect_handler (erase_button, ref erase_button_handler);
- disconnect_handler (revealer, ref revealer_reload_1_handler);
- disconnect_handler (revealer, ref revealer_reload_2_handler);
+ disconnect_handler (modifications_handler, ref revealer_reload_1_handler);
+ disconnect_handler (modifications_handler, ref revealer_reload_2_handler);
properties_list_box.@foreach ((widget) => widget.destroy ());
}
- private void disconnect_handler (Widget widget, ref ulong handler)
+ private void disconnect_handler (Object object, ref ulong handler)
{
if (handler == 0) // erase_button_handler & revealer_reload_1_handler depend of the key's type
return;
- widget.disconnect (handler);
+ object.disconnect (handler);
handler = 0;
}
@@ -125,12 +125,12 @@ class RegistryInfo : Grid, BrowsableView
one_choice_warning_revealer.set_reveal_child (is_key_editor_child_single);
ulong value_has_changed_handler = key_editor_child.value_has_changed.connect ((is_valid) => {
- if (revealer.should_delay_apply (tmp_string))
+ if (modifications_handler.should_delay_apply (tmp_string))
{
if (is_valid)
- revealer.add_delayed_setting (key, key_editor_child.get_variant ());
+ modifications_handler.add_delayed_setting (key, key_editor_child.get_variant ());
else
- revealer.dismiss_change (key);
+ modifications_handler.dismiss_change (key);
}
else
key.value = key_editor_child.get_variant ();
@@ -150,14 +150,14 @@ class RegistryInfo : Grid, BrowsableView
GSettingsKey gkey = (GSettingsKey) key;
custom_value_switch.set_active (key.planned_change ? key.planned_value == null :
gkey.is_default);
ulong switch_active_handler = custom_value_switch.notify ["active"].connect (() => {
- if (revealer.should_delay_apply (tmp_string))
+ if (modifications_handler.should_delay_apply (tmp_string))
{
if (custom_value_switch.get_active ())
- revealer.add_delayed_setting (key, null);
+ modifications_handler.add_delayed_setting (key, null);
else
{
Variant tmp_variant = key.planned_change && (key.planned_value != null) ? (!)
key.planned_value : key.value;
- revealer.add_delayed_setting (key, tmp_variant);
+ modifications_handler.add_delayed_setting (key, tmp_variant);
key_editor_child.reload (tmp_variant);
}
}
@@ -176,7 +176,7 @@ class RegistryInfo : Grid, BrowsableView
key.value = key.value; // TODO that hurts...
}
});
- revealer_reload_1_handler = revealer.reload.connect (() => {
+ revealer_reload_1_handler = modifications_handler.reload.connect (() => {
SignalHandler.block (custom_value_switch, switch_active_handler);
custom_value_switch.set_active (gkey.is_default);
SignalHandler.unblock (custom_value_switch, switch_active_handler);
@@ -186,13 +186,13 @@ class RegistryInfo : Grid, BrowsableView
else
{
erase_button_handler = erase_button.clicked.connect (() => {
- revealer.enter_delay_mode ();
- revealer.add_delayed_setting (key, null);
+ modifications_handler.enter_delay_mode ();
+ modifications_handler.add_delayed_setting (key, null);
});
}
- 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 (() => {
+ ulong child_activated_handler = key_editor_child.child_activated.connect (() =>
modifications_handler.apply_delayed_settings ()); // TODO "only" used for string-based and spin widgets
+ revealer_reload_2_handler = modifications_handler.reload.connect (() => {
if (key is DConfKey && ((DConfKey) key).is_ghost)
return;
SignalHandler.block (key_editor_child, value_has_changed_handler);
diff --git a/editor/registry-search.vala b/editor/registry-search.vala
index ddbd944..b0c0fff 100644
--- a/editor/registry-search.vala
+++ b/editor/registry-search.vala
@@ -42,7 +42,7 @@ class RegistrySearch : Grid, PathElement, BrowsableView
}
}
- public ModificationsRevealer revealer { private get; set; }
+ public ModificationsHandler modifications_handler { private get; set; }
private BrowserView? _browser_view = null;
private BrowserView browser_view {
@@ -162,7 +162,7 @@ class RegistrySearch : Grid, PathElement, BrowsableView
on_delete_call_handler = row.on_delete_call.connect (() => set_key_value (key, null));
ulong set_key_value_handler = key_row.set_key_value.connect ((variant) => { set_key_value (key,
variant); });
- ulong change_dismissed_handler = key_row.change_dismissed.connect (() => revealer.dismiss_change
(key));
+ ulong change_dismissed_handler = key_row.change_dismissed.connect (() =>
modifications_handler.dismiss_change (key));
row.destroy.connect (() => {
key_row.disconnect (set_key_value_handler);
@@ -289,7 +289,7 @@ class RegistrySearch : Grid, PathElement, BrowsableView
}*/
/*\
- * * Revealer stuff
+ * * Modifications stuff
\*/
public bool get_current_delay_mode ()
@@ -300,7 +300,7 @@ class RegistrySearch : Grid, PathElement, BrowsableView
private void set_key_value (Key key, Variant? new_value)
{
if (get_current_delay_mode ())
- revealer.add_delayed_setting (key, new_value);
+ modifications_handler.add_delayed_setting (key, new_value);
else if (new_value != null)
key.value = (!) new_value;
else if (key is GSettingsKey)
@@ -308,7 +308,7 @@ class RegistrySearch : Grid, PathElement, BrowsableView
else if (behaviour != Behaviour.UNSAFE)
{
browser_view.enter_delay_mode ();
- revealer.add_delayed_setting (key, null);
+ modifications_handler.add_delayed_setting (key, null);
}
else
((DConfKey) key).erase ();
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index fc117ac..43de027 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -45,7 +45,7 @@ class RegistryView : Grid, PathElement, BrowsableView
}
}
- public ModificationsRevealer revealer { private get; set; }
+ public ModificationsHandler modifications_handler { private get; set; }
private BrowserView? _browser_view = null;
private BrowserView browser_view {
@@ -155,7 +155,7 @@ class RegistryView : Grid, PathElement, BrowsableView
on_delete_call_handler = row.on_delete_call.connect (() => set_key_value (key, null));
ulong set_key_value_handler = key_row.set_key_value.connect ((variant) => { set_key_value (key,
variant); });
- ulong change_dismissed_handler = key_row.change_dismissed.connect (() => revealer.dismiss_change
(key));
+ ulong change_dismissed_handler = key_row.change_dismissed.connect (() =>
modifications_handler.dismiss_change (key));
row.destroy.connect (() => {
key_row.disconnect (set_key_value_handler);
@@ -270,7 +270,7 @@ class RegistryView : Grid, PathElement, BrowsableView
}
/*\
- * * Revealer stuff
+ * * Modifications stuff
\*/
public bool get_current_delay_mode ()
@@ -281,7 +281,7 @@ class RegistryView : Grid, PathElement, BrowsableView
private void set_key_value (Key key, Variant? new_value)
{
if (get_current_delay_mode ())
- revealer.add_delayed_setting (key, new_value);
+ modifications_handler.add_delayed_setting (key, new_value);
else if (new_value != null)
key.value = (!) new_value;
else if (key is GSettingsKey)
@@ -289,7 +289,7 @@ class RegistryView : Grid, PathElement, BrowsableView
else if (behaviour != Behaviour.UNSAFE)
{
browser_view.enter_delay_mode ();
- revealer.add_delayed_setting (key, null);
+ modifications_handler.add_delayed_setting (key, null);
}
else
((DConfKey) key).erase ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]