[dconf-editor] Fix behaviour behaviour.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Fix behaviour behaviour.
- Date: Thu, 11 Jan 2018 03:59:31 +0000 (UTC)
commit bd2e76598208834d9c5eedf09fbf513cc75f61c2
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Jan 11 04:57:12 2018 +0100
Fix behaviour behaviour.
editor/browser-view.vala | 17 ++++++++---------
editor/dconf-window.vala | 3 ++-
editor/modifications-revealer.vala | 2 --
editor/registry-search.vala | 2 --
editor/registry-view.vala | 2 --
5 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index a409f1d..4201466 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -28,8 +28,6 @@ public enum Behaviour {
[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/browser-view.ui")]
class BrowserView : Grid
{
- private GLib.Settings settings = new GLib.Settings ("ca.desrt.dconf-editor.Settings");
-
[GtkChild] private BrowserInfoBar info_bar;
[GtkChild] private Stack stack;
@@ -58,8 +56,6 @@ class BrowserView : Grid
browse_view.modifications_handler = value;
properties_view.modifications_handler = value;
search_results_view.modifications_handler = value;
-
- settings.bind ("behaviour", modifications_handler, "behaviour",
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
}
}
@@ -70,11 +66,6 @@ class BrowserView : Grid
info_bar.add_label ("hard-reload", _("This content has changed. Do you want to reload the view?"),
_("Reload"), "ui.reload");
- settings.bind ("behaviour", browse_view, "behaviour",
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
-
- settings.bind ("sort-case-sensitive", sorting_options, "case-sensitive", GLib.SettingsBindFlags.GET);
- settings.bind ("sort-folders", sorting_options, "sort-folders", GLib.SettingsBindFlags.GET);
-
sorting_options.notify.connect (() => {
if (!current_view_is_browse_view ())
return;
@@ -313,9 +304,17 @@ public enum MergeType {
public class SortingOptions : Object
{
+ private GLib.Settings settings = new GLib.Settings ("ca.desrt.dconf-editor.Settings");
+
public bool case_sensitive { get; set; default = false; }
public MergeType sort_folders { get; set; default = MergeType.MIXED; }
+ construct
+ {
+ settings.bind ("sort-case-sensitive", this, "case-sensitive", GLib.SettingsBindFlags.GET);
+ settings.bind ("sort-folders", this, "sort-folders", GLib.SettingsBindFlags.GET);
+ }
+
public SettingComparator get_comparator ()
{
if (sort_folders == MergeType.FIRST)
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 3244da1..fd0d045 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -89,7 +89,8 @@ class DConfWindow : ApplicationWindow
pathbar.set_path (current_path); // update "ghost" status
});
- behaviour_changed_handler = settings.changed ["behaviour"].connect (invalidate_popovers);
+ behaviour_changed_handler = settings.changed ["behaviour"].connect_after (invalidate_popovers);
+ settings.bind ("behaviour", modifications_handler, "behaviour",
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
if (!disable_warning && settings.get_boolean ("show-warning"))
show.connect (show_initial_warning);
diff --git a/editor/modifications-revealer.vala b/editor/modifications-revealer.vala
index 89548a6..b902297 100644
--- a/editor/modifications-revealer.vala
+++ b/editor/modifications-revealer.vala
@@ -38,8 +38,6 @@ class ModificationsRevealer : Revealer
private ThemedIcon apply_button_icon = new ThemedIcon.from_names ({"object-select-symbolic"});
- public Behaviour behaviour { set { modifications_handler.behaviour = value; } }
-
/*\
* * Window management callbacks
\*/
diff --git a/editor/registry-search.vala b/editor/registry-search.vala
index 115417e..1eb3fac 100644
--- a/editor/registry-search.vala
+++ b/editor/registry-search.vala
@@ -22,8 +22,6 @@ class RegistrySearch : Grid, BrowsableView
{
private string current_path;
- public Behaviour behaviour { private get; set; }
-
[GtkChild] private ScrolledWindow scrolled;
[GtkChild] private ListBox key_list_box;
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index ad0c982..b5a54b1 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -20,8 +20,6 @@ using Gtk;
[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/registry-view.ui")]
class RegistryView : Grid, BrowsableView
{
- public Behaviour behaviour { private get; set; }
-
[GtkChild] private BrowserInfoBar info_bar;
[GtkChild] private ScrolledWindow scrolled;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]