diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-11-25 04:11:58 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-11-25 04:11:58 +0100 |
commit | ccff5442184e84d511c2bd25ed3da53e4336a272 (patch) | |
tree | 8402a0ba68852e0aec5841ed4519ccfe88352223 /src/searches/SavedSearchPage.vala | |
parent | a1e1833f48ed618273dab9198b547148a89832a7 (diff) | |
parent | 4a3f1fdfe1eb3743564adcee35d5513224339260 (diff) |
Merge tag 'upstream/0.25.1'
Upstream version 0.25.1
Diffstat (limited to 'src/searches/SavedSearchPage.vala')
-rw-r--r-- | src/searches/SavedSearchPage.vala | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/src/searches/SavedSearchPage.vala b/src/searches/SavedSearchPage.vala index 1693ca3..c57ec7d 100644 --- a/src/searches/SavedSearchPage.vala +++ b/src/searches/SavedSearchPage.vala @@ -31,7 +31,7 @@ public class SavedSearchPage : CollectionPage { foreach (MediaSourceCollection sources in MediaCollectionRegistry.get_instance().get_all()) get_view().monitor_source_collection(sources, new SavedSearchManager(this, search), null); - init_page_context_menu("/SearchContextMenu"); + init_page_context_menu("SearchContextMenu"); } protected override void get_config_photos_sort(out bool sort_order, out int sort_by) { @@ -46,20 +46,17 @@ public class SavedSearchPage : CollectionPage { base.init_collect_ui_filenames(ui_filenames); ui_filenames.add("savedsearch.ui"); } - - protected override Gtk.ActionEntry[] init_collect_action_entries() { - Gtk.ActionEntry[] actions = base.init_collect_action_entries(); - - Gtk.ActionEntry rename_search = { "RenameSearch", null, TRANSLATABLE, null, null, on_rename_search }; - actions += rename_search; - - Gtk.ActionEntry edit_search = { "EditSearch", null, TRANSLATABLE, null, null, on_edit_search }; - actions += edit_search; - - Gtk.ActionEntry delete_search = { "DeleteSearch", null, TRANSLATABLE, null, null, on_delete_search }; - actions += delete_search; - - return actions; + + private const GLib.ActionEntry[] entries = { + { "RenameSearch", on_rename_search }, + { "EditSearch", on_edit_search }, + { "DeleteSearch", on_delete_search } + }; + + protected override void add_actions () { + base.add_actions (); + + AppWindow.get_instance ().add_action_entries (entries, this); } private void on_delete_search() { @@ -77,15 +74,10 @@ public class SavedSearchPage : CollectionPage { } protected override void update_actions(int selected_count, int count) { - set_action_details("RenameSearch", - Resources.RENAME_SEARCH_MENU, - null, true); - set_action_details("EditSearch", - Resources.EDIT_SEARCH_MENU, - null, true); - set_action_details("DeleteSearch", - Resources.DELETE_SEARCH_MENU, - null, true); + set_action_sensitive ("RenameSearch", true); + set_action_sensitive ("EditSearch", true); + set_action_sensitive ("DeleteSearch", true); + base.update_actions(selected_count, count); } } |