[dconf-editor] Create in-window BookmarksList manually.



commit 83f3c0791a7459c2a6f3212ee9d5f887fc86923f
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Dec 13 15:54:31 2018 +0100

    Create in-window BookmarksList manually.

 editor/about-list.vala         |  4 +++-
 editor/bookmarks-list.vala     |  8 ++++++++
 editor/browser-view.ui         | 11 -----------
 editor/browser-view.vala       | 30 ++++++++++++++++++++++--------
 editor/modifications-list.vala |  3 ++-
 5 files changed, 35 insertions(+), 21 deletions(-)
---
diff --git a/editor/about-list.vala b/editor/about-list.vala
index 7164d82..86dbda2 100644
--- a/editor/about-list.vala
+++ b/editor/about-list.vala
@@ -35,7 +35,9 @@ private class AboutList : OverlayedList
 
     internal AboutList (bool needs_shadows, bool big_placeholder)
     {
-        Object (needs_shadows: needs_shadows, big_placeholder: big_placeholder, edit_mode_action_prefix: 
"about");
+        Object (needs_shadows           : needs_shadows,
+                big_placeholder         : big_placeholder,
+                edit_mode_action_prefix : "about");
     }
 
     internal override void reset ()
diff --git a/editor/bookmarks-list.vala b/editor/bookmarks-list.vala
index 37cc215..5d5450d 100644
--- a/editor/bookmarks-list.vala
+++ b/editor/bookmarks-list.vala
@@ -35,6 +35,14 @@ private class BookmarksList : OverlayedList
         second_mode_name = _("Edit");
     }
 
+    internal BookmarksList (bool needs_shadows, bool big_placeholder, string edit_mode_action_prefix, string 
schema_path)
+    {
+        Object (needs_shadows           : needs_shadows,
+                big_placeholder         : big_placeholder,
+                edit_mode_action_prefix : edit_mode_action_prefix,
+                schema_path             : schema_path);
+    }
+
     internal override void reset ()
     {
     }
diff --git a/editor/browser-view.ui b/editor/browser-view.ui
index 899d923..f5f96a8 100644
--- a/editor/browser-view.ui
+++ b/editor/browser-view.ui
@@ -20,16 +20,5 @@
         </child>
       </object>
     </child>
-    <child>
-      <object class="BookmarksList" id="bookmarks_list">
-        <property name="visible">True</property>
-        <property name="needs-shadows">False</property>
-        <property name="big-placeholder">True</property>
-        <property name="edit-mode-action-prefix">bmk</property>
-        <property name="schema-path">/ca/desrt/dconf-editor/</property>
-        <signal name="selection-changed" handler="on_bookmarks_selection_changed"/>
-        <signal name="update_bookmarks_icons" handler="on_update_bookmarks_icons"/>
-      </object>
-    </child>
   </template>
 </interface>
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index 0226c53..3445d3e 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -53,8 +53,9 @@ private class BrowserView : Stack, AdaptativeWidget
 {
     [CCode (notify = false)] internal uint16 last_context_id { get; private set; default = 
ModelUtils.undefined_context_id; }
 
-    [GtkChild] private BrowserInfoBar info_bar;
-    [GtkChild] private BrowserStack current_child;
+    [GtkChild] private BrowserInfoBar   info_bar;
+    [GtkChild] private BrowserStack     current_child;
+    [GtkChild] private Grid             current_child_grid;
 
     private SortingOptions sorting_options;
     private GLib.ListStore? key_model = null;
@@ -97,6 +98,8 @@ private class BrowserView : Stack, AdaptativeWidget
     {
         install_action_entries ();
 
+        create_bookmarks_list ();
+
         info_bar.add_label ("soft-reload-folder", _("Sort preferences have changed. Do you want to refresh 
the view?"),
                                                   _("Refresh"), "bro.refresh-folder");
         info_bar.add_label ("hard-reload-folder", _("This folder content has changed. Do you want to reload 
the view?"),
@@ -218,7 +221,8 @@ private class BrowserView : Stack, AdaptativeWidget
 
     private void create_about_list ()
     {
-        about_list = new AboutList (false, true);
+        about_list = new AboutList (/* needs shadows   */ false,
+                                    /* big placeholder */ true);
         about_list.set_window_size (window_size);
         about_list.show ();
         add (about_list);
@@ -259,7 +263,8 @@ private class BrowserView : Stack, AdaptativeWidget
 
     private void create_modifications_list ()
     {
-        modifications_list = new ModificationsList (false, true);
+        modifications_list = new ModificationsList (/* needs shadows   */ false,
+                                                    /* big placeholder */ true);
         modifications_list.set_window_size (window_size);
         // modifications_list.selection_changed.connect (() => ...);
         modifications_list.show ();
@@ -312,8 +317,19 @@ private class BrowserView : Stack, AdaptativeWidget
     [CCode (notify = false)] internal bool in_window_bookmarks           { internal get; private set; 
default = false; }
     [CCode (notify = false)] internal bool in_window_bookmarks_edit_mode { internal get; private set; 
default = false; }
 
-    [GtkChild] private BookmarksList bookmarks_list;
-    [GtkChild] private Grid          current_child_grid;
+    private BookmarksList bookmarks_list;
+
+    private void create_bookmarks_list ()
+    {
+        bookmarks_list = new BookmarksList (/* needs shadows            */ false,
+                                            /* big placeholder          */ true,
+                                            /* edit-mode action prefix  */ "bmk",
+                                            /* schema path              */ "/ca/desrt/dconf-editor/");
+        bookmarks_list.selection_changed.connect (on_bookmarks_selection_changed);
+        bookmarks_list.update_bookmarks_icons.connect (on_update_bookmarks_icons);
+        bookmarks_list.show ();
+        add (bookmarks_list);
+    }
 
     private string [] old_bookmarks = new string [0];
 
@@ -395,7 +411,6 @@ private class BrowserView : Stack, AdaptativeWidget
         bookmarks_list.move_bottom ();
     }
 
-    [GtkCallback]
     private void on_bookmarks_selection_changed ()
     {
         if (!in_window_bookmarks)
@@ -406,7 +421,6 @@ private class BrowserView : Stack, AdaptativeWidget
     internal signal void bookmarks_selection_changed ();
 
     internal signal void update_bookmarks_icons (Variant bookmarks_variant);
-    [GtkCallback]
     private void on_update_bookmarks_icons (Variant bookmarks_variant)
     {
         update_bookmarks_icons (bookmarks_variant);
diff --git a/editor/modifications-list.vala b/editor/modifications-list.vala
index 2ddb354..2bb0413 100644
--- a/editor/modifications-list.vala
+++ b/editor/modifications-list.vala
@@ -35,7 +35,8 @@ private class ModificationsList : OverlayedList
 
     internal ModificationsList (bool needs_shadows, bool big_placeholder)
     {
-        Object (needs_shadows: needs_shadows, big_placeholder: big_placeholder);
+        Object (needs_shadows   : needs_shadows,
+                big_placeholder : big_placeholder);
     }
 
     internal override void reset ()


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