[shotwell/wip/dedeprecate: 21/38] wip: SearchFilter no UIManager



commit 01f3153e7a50d5eb51d8eb5892bb77b9c4691b5e
Author: Jens Georg <mail jensge org>
Date:   Fri Oct 21 21:18:28 2016 +0200

    wip: SearchFilter no UIManager
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/SearchFilter.vala                |  272 +++++++++++++---------------------
 src/library/LibraryWindow.vala       |    2 +-
 src/org.gnome.Shotwell.gresource.xml |    1 +
 ui/search_bar.ui                     |   67 +++++++--
 4 files changed, 157 insertions(+), 185 deletions(-)
---
diff --git a/src/SearchFilter.vala b/src/SearchFilter.vala
index 5fcf76f..d4766d6 100644
--- a/src/SearchFilter.vala
+++ b/src/SearchFilter.vala
@@ -331,33 +331,33 @@ public class TextAction {
 
 
 public class SearchFilterActions {
-    public unowned Gtk.ToggleAction? flagged {
+    public unowned GLib.SimpleAction? flagged {
         get {
-            return get_action("CommonDisplayFlagged") as Gtk.ToggleAction;
+            return get_action ("display.flagged");
         }
     }
     
-    public unowned Gtk.ToggleAction? photos {
+    public unowned GLib.SimpleAction? photos {
         get {
-            return get_action("CommonDisplayPhotos") as Gtk.ToggleAction;
+            return get_action ("display.photos");
         }
     }
     
-    public unowned Gtk.ToggleAction? videos {
+    public unowned GLib.SimpleAction? videos {
         get {
-            return get_action("CommonDisplayVideos") as Gtk.ToggleAction;
+            return get_action ("display.videos");
         }
     }
     
-    public unowned Gtk.ToggleAction? raw {
+    public unowned GLib.SimpleAction? raw {
         get {
-            return get_action("CommonDisplayRaw") as Gtk.ToggleAction;
+            return get_action ("display.raw");
         }
     }
     
-    public unowned Gtk.RadioAction? rating {
+    public unowned GLib.SimpleAction? rating {
         get {
-            return get_action("CommonDisplayUnratedOrHigher") as Gtk.RadioAction;
+            return get_action ("display.rating");
         }
     }
     
@@ -368,7 +368,8 @@ public class SearchFilterActions {
         }
     }
     
-    private Gtk.ActionGroup action_group = new Gtk.ActionGroup("SearchFilterActionGroup");
+    private GLib.SimpleActionGroup action_group = new GLib.SimpleActionGroup ();
+
     private SearchFilterCriteria criteria = SearchFilterCriteria.ALL;
     private TextAction? _text = null;
     private bool has_flagged = true;
@@ -388,6 +389,7 @@ public class SearchFilterActions {
     public signal void rating_changed(RatingFilter filter);
     
     public signal void text_changed(string? text);
+
     
     /**
      * fired when the kinds of media present in the current view change (e.g., a video becomes
@@ -410,7 +412,7 @@ public class SearchFilterActions {
         text.text_changed.connect(on_text_changed);
     }
     
-    public Gtk.ActionGroup get_action_group() {
+    public GLib.ActionGroup get_action_group() {
         return action_group;
     }
     
@@ -418,22 +420,25 @@ public class SearchFilterActions {
         return criteria;
     }
     
-    public unowned Gtk.Action? get_action(string name) {
-        return action_group.get_action(name);
+    public unowned GLib.SimpleAction? get_action(string name) {
+        return action_group.lookup_action(name) as GLib.SimpleAction;
     }
     
-    public void set_action_sensitive(string name, bool sensitive) {
-        Gtk.Action? action = get_action(name);
-        if (action != null)
-            action.sensitive = sensitive;
+    public void set_action_sensitive (string name, bool sensitive) {
+        var action = get_action(name);
+        if (action != null) {
+            action.set_enabled (sensitive);
+        }
     }
     
     public void reset() {
-        flagged.active = false;
-        photos.active = false;
-        raw.active = false;
-        videos.active = false;
-        rating.current_value = RatingFilter.UNRATED_OR_HIGHER;
+        rating.set_enabled (false);
+        photos.set_enabled (false);
+        raw.set_enabled (false);
+        videos.set_enabled (false);
+        Variant v = "'%d'".printf (RatingFilter.UNRATED_OR_HIGHER);
+        rating.set_state (v);
+
         text.set_text(null);
     }
     
@@ -506,27 +511,9 @@ public class SearchFilterActions {
     }
     
     private void update_sensitivities() {
-        flagged.set_stock_id(((SearchFilterCriteria.FLAG & criteria) != 0 && has_flagged) ?
-            Resources.ICON_FILTER_FLAGGED : Resources.ICON_FILTER_FLAGGED_DISABLED);
-        
-        bool allow_media = (SearchFilterCriteria.MEDIA & criteria) != 0;
-        videos.set_stock_id((allow_media && has_videos) ?
-             Resources.ICON_FILTER_VIDEOS :  Resources.ICON_FILTER_VIDEOS_DISABLED);
-        photos.set_stock_id((allow_media && has_photos) ?
-             Resources.ICON_FILTER_PHOTOS :  Resources.ICON_FILTER_PHOTOS_DISABLED);
-        raw.set_stock_id((allow_media && has_raw) ?
-             Resources.ICON_FILTER_RAW :  Resources.ICON_FILTER_RAW_DISABLED);
-        
         bool allow_ratings = (SearchFilterCriteria.RATING & criteria) != 0;
-        set_action_sensitive("CommonDisplayRejectedOnly", allow_ratings & can_filter_by_stars);
-        set_action_sensitive("CommonDisplayRejectedOrHigher", allow_ratings & can_filter_by_stars);
-        set_action_sensitive("CommonDisplayUnratedOrHigher", allow_ratings & can_filter_by_stars);
-        set_action_sensitive("CommonDisplayOneOrHigher", allow_ratings & can_filter_by_stars);
-        set_action_sensitive("CommonDisplayTwoOrHigher", allow_ratings & can_filter_by_stars);
-        set_action_sensitive("CommonDisplayThreeOrHigher", allow_ratings & can_filter_by_stars);
-        set_action_sensitive("CommonDisplayFourOrHigher", allow_ratings & can_filter_by_stars);
-        set_action_sensitive("CommonDisplayFiveOrHigher", allow_ratings & can_filter_by_stars);
-        
+        set_action_sensitive("filterbar.display.rating", allow_ratings & can_filter_by_stars);
+
         // Ticket #3343 - Don't disable the text field, even
         // when no searchable items are available.
         text.set_sensitive(true);
@@ -537,111 +524,60 @@ public class SearchFilterActions {
     private void on_text_changed(TextAction action, string? text) {
         text_changed(text);
     }
+
+    private const GLib.ActionEntry[] entries = {
+        { "display.rating", on_action_radio, "s", "'2'", on_rating_changed },
+        { "display.flagged", on_action_toggle, null, "false", on_flagged_toggled },
+        { "display.photos", on_action_toggle, null, "false", on_photos_toggled },
+        { "display.videos", on_action_toggle, null, "false", on_videos_toggled },
+        { "display.raw", on_action_toggle, null, "false", on_raw_toggled }
+    };
+
+    private void on_action_radio (GLib.SimpleAction action,
+                                  GLib.Variant?     parameter) {
+        action.change_state (parameter);
+    }
+
+    private void on_action_toggle (GLib.SimpleAction action,
+                                   GLib.Variant?     parameter) {
+        var state = (bool) action.get_state ();
+        action.change_state (!state);
+    }
     
     private void register() {
         _text = new TextAction();
-        
-        Gtk.RadioActionEntry[] view_filter_actions = new Gtk.RadioActionEntry[0];
-        
-        Gtk.RadioActionEntry rejected_only = { "CommonDisplayRejectedOnly", null, TRANSLATABLE,
-            "<Ctrl>8", TRANSLATABLE, RatingFilter.REJECTED_ONLY };
-        rejected_only.label = Resources.DISPLAY_REJECTED_ONLY_MENU;
-        rejected_only.tooltip = Resources.DISPLAY_REJECTED_ONLY_TOOLTIP;
-        view_filter_actions += rejected_only;
-        
-        Gtk.RadioActionEntry rejected_or_higher = { "CommonDisplayRejectedOrHigher", null, TRANSLATABLE,
-            "<Ctrl>9", TRANSLATABLE, RatingFilter.REJECTED_OR_HIGHER };
-        rejected_or_higher.label = Resources.DISPLAY_REJECTED_OR_HIGHER_MENU;
-        rejected_or_higher.tooltip = GLib.dpgettext2 (null, "Tooltip",
-                Resources.DISPLAY_REJECTED_OR_HIGHER_TOOLTIP);
-        view_filter_actions += rejected_or_higher;
-        
-        Gtk.RadioActionEntry unrated_or_higher = { "CommonDisplayUnratedOrHigher", null, TRANSLATABLE, 
-            "<Ctrl>0", TRANSLATABLE, RatingFilter.UNRATED_OR_HIGHER };
-        unrated_or_higher.label = Resources.DISPLAY_UNRATED_OR_HIGHER_MENU;
-        unrated_or_higher.tooltip = Resources.DISPLAY_UNRATED_OR_HIGHER_TOOLTIP;
-        view_filter_actions += unrated_or_higher;
-        
-        Gtk.RadioActionEntry one_or_higher = { "CommonDisplayOneOrHigher", null, TRANSLATABLE,
-            "<Ctrl>1", TRANSLATABLE, RatingFilter.ONE_OR_HIGHER };
-        one_or_higher.label = Resources.DISPLAY_ONE_OR_HIGHER_MENU;
-        one_or_higher.tooltip = Resources.DISPLAY_ONE_OR_HIGHER_TOOLTIP;
-        view_filter_actions += one_or_higher;
-        
-        Gtk.RadioActionEntry two_or_higher = { "CommonDisplayTwoOrHigher", null, TRANSLATABLE,
-            "<Ctrl>2", TRANSLATABLE, RatingFilter.TWO_OR_HIGHER };
-        two_or_higher.label = Resources.DISPLAY_TWO_OR_HIGHER_MENU;
-        two_or_higher.tooltip = Resources.DISPLAY_TWO_OR_HIGHER_TOOLTIP;
-        view_filter_actions += two_or_higher;
-        
-        Gtk.RadioActionEntry three_or_higher = { "CommonDisplayThreeOrHigher", null, TRANSLATABLE,
-            "<Ctrl>3", TRANSLATABLE, RatingFilter.THREE_OR_HIGHER };
-        three_or_higher.label = Resources.DISPLAY_THREE_OR_HIGHER_MENU;
-        three_or_higher.tooltip = Resources.DISPLAY_THREE_OR_HIGHER_TOOLTIP;
-        view_filter_actions += three_or_higher;
-        
-        Gtk.RadioActionEntry four_or_higher = { "CommonDisplayFourOrHigher", null, TRANSLATABLE,
-            "<Ctrl>4", TRANSLATABLE, RatingFilter.FOUR_OR_HIGHER };
-        four_or_higher.label = Resources.DISPLAY_FOUR_OR_HIGHER_MENU;
-        four_or_higher.tooltip = Resources.DISPLAY_FOUR_OR_HIGHER_TOOLTIP;
-        view_filter_actions += four_or_higher;
-        
-        Gtk.RadioActionEntry five_or_higher = { "CommonDisplayFiveOrHigher", null, TRANSLATABLE,
-            "<Ctrl>5", TRANSLATABLE, RatingFilter.FIVE_OR_HIGHER };
-        five_or_higher.label = Resources.DISPLAY_FIVE_OR_HIGHER_MENU;
-        five_or_higher.tooltip = Resources.DISPLAY_FIVE_OR_HIGHER_TOOLTIP;
-        view_filter_actions += five_or_higher;
-        
-        action_group.add_radio_actions(view_filter_actions, RatingFilter.UNRATED_OR_HIGHER,
-            on_rating_changed);
-        
-        Gtk.ToggleActionEntry[] toggle_actions = new Gtk.ToggleActionEntry[0];
-        
-        Gtk.ToggleActionEntry flagged_action = { "CommonDisplayFlagged", Resources.ICON_FILTER_FLAGGED,
-            TRANSLATABLE, null, TRANSLATABLE, on_flagged_toggled, false };
-        flagged_action.label = _("Flagged");
-        flagged_action.tooltip = _("Flagged");
-        toggle_actions += flagged_action;
-        
-        Gtk.ToggleActionEntry photos_action = { "CommonDisplayPhotos", Resources.ICON_FILTER_PHOTOS,
-            TRANSLATABLE, null, TRANSLATABLE, on_photos_toggled, false };
-        photos_action.label = _("Photos");
-        photos_action.tooltip = _("Photos");
-        toggle_actions += photos_action;
-        
-        Gtk.ToggleActionEntry videos_action = { "CommonDisplayVideos", Resources.ICON_FILTER_VIDEOS,
-            TRANSLATABLE, null, TRANSLATABLE, on_videos_toggled, false };
-        videos_action.label = _("Videos");
-        videos_action.tooltip = _("Videos");
-        toggle_actions += videos_action;
-        
-        Gtk.ToggleActionEntry raw_action = { "CommonDisplayRaw", Resources.ICON_FILTER_RAW, TRANSLATABLE,
-            null, TRANSLATABLE, on_raw_toggled, false };
-        raw_action.label = _("RAW Photos");
-        raw_action.tooltip = _("RAW photos");
-        toggle_actions += raw_action;
-        
-        action_group.add_toggle_actions(toggle_actions, this);
+        this.action_group.add_action_entries (entries, this);
     }
-    
-    private void on_rating_changed(Gtk.Action action, Gtk.Action current) {
-        rating_changed((RatingFilter) ((Gtk.RadioAction) current).get_current_value());
+
+    private void on_rating_changed (GLib.SimpleAction action,
+                                    GLib.Variant      value) {
+        action.set_state (value);
+        var filter = (RatingFilter) int.parse (value.get_string ());
+        rating_changed(filter);
     }
     
-    private void on_flagged_toggled(Gtk.Action action) {
-        flagged_toggled(((Gtk.ToggleAction) action).active);
+    private void on_flagged_toggled (GLib.SimpleAction action,
+                                     GLib.Variant      value) {
+        action.set_state (value);
+        flagged_toggled (value.get_boolean ());
     }
     
-    private void on_photos_toggled(Gtk.Action action) {
-        photos_toggled(((Gtk.ToggleAction) action).active);
+    private void on_photos_toggled (GLib.SimpleAction action,
+                                    GLib.Variant      value) {
+        action.set_state (value);
+        photos_toggled (value.get_boolean ());
     }
     
-    private void on_videos_toggled(Gtk.Action action) {
-        videos_toggled(((Gtk.ToggleAction) action).active);
+    private void on_videos_toggled (GLib.SimpleAction action,
+                                    GLib.Variant      value) {
+        action.set_state (value);
+        videos_toggled (value.get_boolean ());
     }
     
-    private void on_raw_toggled(Gtk.Action action) {
-        raw_toggled(((Gtk.ToggleAction) action).active);
+    private void on_raw_toggled (GLib.SimpleAction action,
+                                 GLib.Variant      value) {
+        action.set_state (value);
+        raw_toggled (value.get_boolean ());
     }
     
     public bool get_has_photos() {
@@ -689,14 +625,11 @@ public class SearchFilterToolbar : Gtk.Revealer {
     
     private class ToggleActionToolButton : Gtk.ToolItem {
         private Gtk.ToggleButton button;
-        private Gtk.ToggleAction action;
 
-        public ToggleActionToolButton(Gtk.ToggleAction action) {
-            this.action = action;
+        public ToggleActionToolButton(string action) {
             button = new Gtk.ToggleButton();
             button.set_can_focus(false);
-            button.set_active(action.active);
-            button.clicked.connect(on_button_activate);
+            button.set_action_name (action);
             button.set_has_tooltip(true);
             button.set_relief(Gtk.ReliefStyle.NONE);
             button.set_margin_start(2);
@@ -704,14 +637,6 @@ public class SearchFilterToolbar : Gtk.Revealer {
             this.add(button);
         }
         
-        ~ToggleActionToolButton() {
-            button.clicked.disconnect(on_button_activate);
-        }
-        
-        private void on_button_activate() {
-            action.activate();
-        }
-        
         public void set_icon_name(string icon_name) {
             Gtk.Image? image = null;
             button.set_always_show_image(true);
@@ -818,7 +743,7 @@ public class SearchFilterToolbar : Gtk.Revealer {
         
         public RatingFilterButton() {
             button = new Gtk.Button();
-            button.set_image(get_filter_icon(RatingFilter.UNRATED_OR_HIGHER));
+            button.set_image (get_filter_icon(RatingFilter.UNRATED_OR_HIGHER));
             button.set_can_focus(false);
             button.set_relief(Gtk.ReliefStyle.NONE);
             button.set_margin_start(2);
@@ -1112,7 +1037,7 @@ public class SearchFilterToolbar : Gtk.Revealer {
         }
     }
     
-    public Gtk.UIManager ui = new Gtk.UIManager();
+    public Gtk.Builder builder = new Gtk.Builder ();
     
     private SearchFilterActions actions;
     private SavedSearch saved_search = null;
@@ -1133,22 +1058,20 @@ public class SearchFilterToolbar : Gtk.Revealer {
     public SearchFilterToolbar(SearchFilterActions actions) {
         this.actions = actions;
         toolbar = new Gtk.Toolbar();
+        toolbar.insert_action_group ("filterbar", actions.get_action_group ());
         actions.media_context_changed.connect(on_media_context_changed);
         search_box = new SearchBox(actions.text);
         
         toolbar.set_name("search-filter-toolbar");
         toolbar.set_icon_size(Gtk.IconSize.SMALL_TOOLBAR);
         
-        File ui_file = Resources.get_ui("search_bar.ui");
         try {
-            ui.add_ui_from_file(ui_file.get_path());
+            this.builder.add_from_resource ("/org/gnome/Shotwell/search_bar.ui");
         } catch (Error err) {
-            AppWindow.panic(_("Error loading UI file %s: %s").printf(
-                ui_file.get_path(), err.message));
+            AppWindow.panic(_("Error loading search bar UI: %s").printf(
+                err.message));
         }
         
-        ui.insert_action_group(actions.get_action_group(), 0);
-        
         // Ticket #3260 - Add a 'close' context menu to
         // the searchbar.
         // Prepare the close menu for use, but don't
@@ -1163,14 +1086,15 @@ public class SearchFilterToolbar : Gtk.Revealer {
         label_type = new LabelToolItem(_("Type"), 10, 5);
         toolbar.insert(label_type, -1);
         
-        toolbtn_photos = new ToggleActionToolButton(actions.photos);
-        
toolbtn_photos.set_tooltip_text(actions.get_action_group().get_action("CommonDisplayPhotos").tooltip);
+        toolbtn_photos = new ToggleActionToolButton("filterbar.display.photos");
+        toolbtn_photos.set_tooltip_text (_("Photos"));
         
-        toolbtn_videos = new ToggleActionToolButton(actions.videos);
-        
toolbtn_videos.set_tooltip_text(actions.get_action_group().get_action("CommonDisplayVideos").tooltip);
+        toolbtn_videos = new
+            ToggleActionToolButton("filterbar.display.videos");
+        toolbtn_videos.set_tooltip_text(_("Videos"));
         
-        toolbtn_raw = new ToggleActionToolButton(actions.raw);
-        toolbtn_raw.set_tooltip_text(actions.get_action_group().get_action("CommonDisplayRaw").tooltip);
+        toolbtn_raw = new ToggleActionToolButton("filterbar.display.raw");
+        toolbtn_raw.set_tooltip_text(_("RAW Photos"));
         
         toolbar.insert(toolbtn_photos, -1);
         toolbar.insert(toolbtn_videos, -1);
@@ -1182,9 +1106,9 @@ public class SearchFilterToolbar : Gtk.Revealer {
         
         // Flagged button
         
-        toolbtn_flag = new ToggleActionToolButton(actions.flagged);
+        toolbtn_flag = new ToggleActionToolButton("filterbar.display.flagged");
         toolbtn_flag.set_label(_("Flagged"));
-        toolbtn_flag.set_tooltip_text(actions.get_action_group().get_action("CommonDisplayFlagged").tooltip);
+        toolbtn_flag.set_tooltip_text(_("Flagged"));
         
         toolbar.insert(toolbtn_flag, -1);
         
@@ -1193,7 +1117,9 @@ public class SearchFilterToolbar : Gtk.Revealer {
         toolbar.insert(sepr_flagged_rating, -1);
         
         // Rating button
-        rating_button.filter_popup = (Gtk.Menu) ui.get_widget("/FilterPopupMenu");
+        var model = this.builder.get_object ("popup-menu") as GLib.MenuModel;
+        rating_button.filter_popup = new Gtk.Menu.from_model (model);
+        rating_button.filter_popup.attach_to_widget (rating_button, null);
         rating_button.set_label(_("Rating"));
         rating_button.set_expand(false);
         rating_button.clicked.connect(on_filter_button_clicked);
@@ -1365,12 +1291,14 @@ public class SearchFilterToolbar : Gtk.Revealer {
         assert(null != search_filter);
         
         search_filter.set_search_filter(actions.text.value);
-        search_filter.flagged = actions.flagged.active;
-        search_filter.show_media_video = actions.videos.active;
-        search_filter.show_media_photos = actions.photos.active;
-        search_filter.show_media_raw = actions.raw.active;
-        
-        RatingFilter filter = (RatingFilter) actions.rating.current_value;
+        search_filter.flagged = actions.flagged.get_state ().get_boolean ();
+        search_filter.show_media_video = actions.videos.get_state
+            ().get_boolean ();
+        search_filter.show_media_photos = actions.photos.get_state
+            ().get_boolean ();
+        search_filter.show_media_raw = actions.raw.get_state ().get_boolean ();
+
+        var filter = (RatingFilter) int.parse (actions.rating.get_state ().get_string ());
         search_filter.set_rating_filter(filter);
         rating_button.set_filter_icon(filter);
 
diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala
index b464f11..5232432 100644
--- a/src/library/LibraryWindow.vala
+++ b/src/library/LibraryWindow.vala
@@ -436,7 +436,7 @@ public class LibraryWindow : AppWindow {
         }
         
         groups += common_action_group;
-        groups += search_actions.get_action_group();
+        //groups += search_actions.get_action_group();
         
         return groups;
     }
diff --git a/src/org.gnome.Shotwell.gresource.xml b/src/org.gnome.Shotwell.gresource.xml
index 817e93f..abf7eb2 100644
--- a/src/org.gnome.Shotwell.gresource.xml
+++ b/src/org.gnome.Shotwell.gresource.xml
@@ -5,5 +5,6 @@
       <file>search_sidebar_context.ui</file>
       <file>tag_sidebar_context.ui</file>
       <file>sidebar_default_context.ui</file>
+      <file>search_bar.ui</file>
   </gresource>
 </gresources>
diff --git a/ui/search_bar.ui b/ui/search_bar.ui
index 957c8b3..5f899c8 100644
--- a/ui/search_bar.ui
+++ b/ui/search_bar.ui
@@ -1,12 +1,55 @@
-<ui>
-    <popup name="FilterPopupMenu" action="CommonFilterPhotos">
-        <menuitem name="DisplayFiveOrHigher" action="CommonDisplayFiveOrHigher" />
-        <menuitem name="DisplayFourOrHigher" action="CommonDisplayFourOrHigher" />
-        <menuitem name="DisplayThreeOrHigher" action="CommonDisplayThreeOrHigher" />
-        <menuitem name="DisplayTwoOrHigher" action="CommonDisplayTwoOrHigher" />
-        <menuitem name="DisplayOneOrHigher" action="CommonDisplayOneOrHigher" />
-        <menuitem name="DisplayUnratedOrHigher" action="CommonDisplayUnratedOrHigher" />
-        <menuitem name="DisplayRejectedOrHigher" action="CommonDisplayRejectedOrHigher" />
-        <menuitem name="DisplayRejectedOnly" action="CommonDisplayRejectedOnly" />
-    </popup>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="shotwell">
+  <menu id='popup-menu'>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">Rejected _Only</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">8</attribute>
+        <attribute name="accel">&lt;Primary&gt;8</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">All + _Rejected</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">1</attribute>
+        <attribute name="accel">&lt;Primary&gt;9</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_All Photos</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">2</attribute>
+        <attribute name="accel">&lt;Primary&gt;0</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="no">★</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">3</attribute>
+        <attribute name="accel">&lt;Primary&gt;1</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="no">★★</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">4</attribute>
+        <attribute name="accel">&lt;Primary&gt;2</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="no">★★★</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">5</attribute>
+        <attribute name="accel">&lt;Primary&gt;3</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="no">★★★★</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">6</attribute>
+        <attribute name="accel">&lt;Primary&gt;4</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="no">★★★★★</attribute>
+        <attribute name="action">filterbar.display.rating</attribute>
+        <attribute name="target">7</attribute>
+        <attribute name="accel">&lt;Primary&gt;5</attribute>
+      </item>
+    </section>
+  </menu>
+</interface>


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