[seahorse/wip/nielsdg/adaptive: 2/2] Remove the "show combined" option



commit bf849ebb46ab3817074e2e1fa9a62fa3d127b1d7
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Wed Jan 29 07:47:06 2020 +0100

    Remove the "show combined" option
    
    It needs special casing everywhere -even more as we go for an adaptive
    UI with its changing layout- so just get rid of it. It barely has any
    uses, and if really really need be, we can still get it back.

 src/key-manager.vala        | 14 +-------------
 src/seahorse-key-manager.ui |  6 ------
 src/sidebar.vala            | 28 +---------------------------
 3 files changed, 2 insertions(+), 46 deletions(-)
---
diff --git a/src/key-manager.vala b/src/key-manager.vala
index 95e6fb5a..2a4a72ba 100644
--- a/src/key-manager.vala
+++ b/src/key-manager.vala
@@ -64,11 +64,10 @@ public class Seahorse.KeyManager : Catalog {
 
     private const GLib.ActionEntry[] action_entries = {
          { "new-item",           on_new_item                                                     },
-         { "show-search",        on_show_search,                                                      },
+         { "show-search",        on_show_search,                                                 },
          { "filter-items",       on_filter_items,              "s",                      "'any'" },
          { "focus-place",        on_focus_place,               "s",           "'secret-service'" },
          { "import-file",        on_import_file                                                  },
-         { "combine-keyrings",   on_toggle_action,  null,  "false",  on_combine_keyrings_toggled },
          { "paste",              on_paste,                                                       },
     };
 
@@ -223,17 +222,6 @@ public class Seahorse.KeyManager : Catalog {
         action.change_state(!action.state.get_boolean());
     }
 
-    private void on_combine_keyrings_toggled(SimpleAction action, GLib.Variant? new_state) {
-        bool combined = new_state.get_boolean();
-        action.set_state(combined);
-
-        this.sidebar.combined = combined;
-
-        /* Don't show the sidebar if everyhing is combined */
-        this.sidebar_area.visible = !combined;
-        this.settings.set_boolean("sidebar-visible", !combined);
-    }
-
     [GtkCallback]
     private void on_filter_changed(Gtk.Editable entry) {
         this.item_list.filter_text = this.filter_entry.text;
diff --git a/src/seahorse-key-manager.ui b/src/seahorse-key-manager.ui
index d201e253..b9ceadbb 100644
--- a/src/seahorse-key-manager.ui
+++ b/src/seahorse-key-manager.ui
@@ -50,12 +50,6 @@
         <attribute name="target">any</attribute>
       </item>
     </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Combine all keyrings</attribute>
-        <attribute name="action">win.combine-keyrings</attribute>
-      </item>
-    </section>
   </menu>
 
   <object class="GtkPopover" id="new_item_menu_popover">
diff --git a/src/sidebar.vala b/src/sidebar.vala
index fc53e502..91e4e478 100644
--- a/src/sidebar.vala
+++ b/src/sidebar.vala
@@ -28,20 +28,6 @@ public class Seahorse.Sidebar : Gtk.ListBox {
      */
     public Gcr.UnionCollection objects { get; private set; default = new Gcr.UnionCollection(); }
 
-    /**
-     * Collection shows all objects combined
-     */
-    public bool combined {
-        get { return this._combined; }
-        set {
-            if (this._combined != value) {
-                this._combined = value;
-                on_row_selected (get_selected_row());
-            }
-        }
-    }
-    private bool _combined;
-
     /**
      * Emitted when the state of the current collection changed.
      * For example: when going from locked to unlocked and vice versa.
@@ -201,24 +187,12 @@ public class Seahorse.Sidebar : Gtk.ListBox {
     }
 
     private void on_row_selected(Gtk.ListBoxRow? row) {
-        debug("Updating objects (combined: %s)", this.combined.to_string());
+        debug("Updating objects");
 
         // First clear the list
         foreach (var place in this.objects.elements())
             this.objects.remove(place);
 
-        // Combined overrides and shows all objects
-        if (this.combined) {
-            foreach (Backend backend in this.backends) {
-                foreach (var obj in backend.get_objects()) {
-                    var place = (Place) obj;
-                    if (!this.objects.have(place))
-                        this.objects.add(place);
-                }
-            }
-            return;
-        }
-
         // Only selected ones should be in this.objects
         var selected = row as SidebarItem;
         if (selected == null)


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