Commit 19c49b0a authored by Jim Nelson's avatar Jim Nelson

#3211: Brought back View -> Filter Photos, which is now available whenever the...

#3211: Brought back View -> Filter Photos, which is now available whenever the search bar is available.  #3225: Adjusted the search filter tooltips.  Reworked search filter to split out the Gtk.Actions (which are then shared among all pages).
parent 8011fa15
......@@ -692,10 +692,16 @@ public abstract class AppWindow : PageWindow {
sys_show_uri(window.get_screen(), url);
}
public virtual void add_common_actions(Page page, Gtk.ActionGroup action_group) {
public virtual void add_common_actions(Gtk.ActionGroup action_group) {
action_group.add_actions(create_actions(), this);
}
public virtual void add_common_action_groups(Gtk.UIManager ui) {
}
public virtual void replace_common_placeholders(Gtk.UIManager ui) {
}
public void go_fullscreen(Page page) {
// if already fullscreen, use that
if (fullscreen_window != null) {
......
......@@ -218,8 +218,9 @@ public class LibraryWindow : AppWindow {
// monitor cursor changes to select proper page in notebook
sidebar.cursor_changed.connect(on_sidebar_cursor_changed);
// set search bar's visibility to default state
// set search bar's visibility to default state and add its accelerators to the window
search_toolbar.visible = is_search_toolbar_visible;
add_accel_group(search_toolbar.ui.get_accel_group());
create_layout(library_page);
......@@ -379,6 +380,12 @@ public class LibraryWindow : AppWindow {
find.tooltip = _("Find photos and videos by search criteria");
actions += find;
// add the common action for the FilterPhotos submenu (the submenu contains items from
// SearchFilterActions)
Gtk.ActionEntry filter_photos = { "CommonFilterPhotos", null, TRANSLATABLE, null, null, null };
filter_photos.label = Resources.FILTER_PHOTOS_MENU;
actions += filter_photos;
return actions;
}
......@@ -508,17 +515,27 @@ public class LibraryWindow : AppWindow {
return false;
}
public override void add_common_actions(Page page, Gtk.ActionGroup action_group) {
base.add_common_actions(page, action_group);
public override void add_common_actions(Gtk.ActionGroup action_group) {
base.add_common_actions(action_group);
action_group.add_actions(create_actions(), this);
action_group.add_toggle_actions(create_toggle_actions(), this);
action_group.add_radio_actions(create_order_actions(),
SORT_EVENTS_ORDER_ASCENDING, on_events_sort_changed);
}
public override void add_common_action_groups(Gtk.UIManager ui) {
base.add_common_action_groups(ui);
ui.insert_action_group(SearchFilterActions.get_instance().get_action_group(), 0);
}
public override void replace_common_placeholders(Gtk.UIManager ui) {
base.replace_common_placeholders(ui);
// Adds one menu entry per alien database driver
AlienDb.AlienDatabaseHandler.get_instance().add_menu_entries(
page.ui, "/MenuBar/FileMenu/CommonImportFromAlienDbPlaceholder"
ui, "/MenuBar/FileMenu/CommonImportFromAlienDbPlaceholder"
);
}
......
......@@ -545,12 +545,14 @@ public abstract class Page : Gtk.ScrolledWindow, SidebarPage {
common_action_group = new Gtk.ActionGroup("CommonActionGroup");
// Add common actions to the Page's common ActionGroup
AppWindow.get_instance().add_common_actions(this, common_action_group);
AppWindow.get_instance().add_common_actions(common_action_group);
// Add both ActionGroups to the UIManager
ui.insert_action_group(action_group, 0);
ui.insert_action_group(common_action_group, 0);
AppWindow.get_instance().add_common_action_groups(ui);
// Collect injected UI elements and add them to the UI manager
InjectionGroup[] injection_groups = init_collect_injection_groups();
foreach (InjectionGroup group in injection_groups) {
......@@ -560,6 +562,8 @@ public abstract class Page : Gtk.ScrolledWindow, SidebarPage {
}
}
AppWindow.get_instance().replace_common_placeholders(ui);
ui.ensure_update();
}
......
This diff is collapsed.
......@@ -30,6 +30,17 @@
<separator />
<menuitem name="ViewTitle" action="ViewTitle" />
<separator />
<menu name="FilterPhotos" 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" />
</menu>
<separator />
<menu name="SortEvents" action="CommonSortEvents">
<menuitem name="SortEventsAscending" action="CommonSortEventsAscending" />
<menuitem name="SortEventsDescending" action="CommonSortEventsDescending" />
......
......@@ -39,6 +39,17 @@
<menuitem name="ViewTags" action="ViewTags" />
<menuitem name="ViewRatings" action="ViewRatings" />
<separator />
<menu name="FilterPhotos" 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" />
</menu>
<separator />
<menu name="SortPhotos" action="SortPhotos">
<menuitem name="SortByTitle" action="SortByTitle" />
<menuitem name="SortByExposureDate" action="SortByExposureDate" />
......
......@@ -28,6 +28,17 @@
<menuitem name="DisplayExtendedProperties" action="CommonDisplayExtendedProperties" />
<menuitem name="DisplaySearchbar" action="CommonDisplaySearchbar" />
<separator />
<menu name="FilterPhotos" 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" />
</menu>
<separator />
<menu name="SortEvents" action="CommonSortEvents">
<menuitem name="SortEventsAscending" action="CommonSortEventsAscending" />
<menuitem name="SortEventsDescending" action="CommonSortEventsDescending" />
......
<ui>
<popup name="FilterPopupMenu">
<menuitem name="DisplayFiveOrHigher" action="DisplayFiveOrHigher" />
<menuitem name="DisplayFourOrHigher" action="DisplayFourOrHigher" />
<menuitem name="DisplayThreeOrHigher" action="DisplayThreeOrHigher" />
<menuitem name="DisplayTwoOrHigher" action="DisplayTwoOrHigher" />
<menuitem name="DisplayOneOrHigher" action="DisplayOneOrHigher" />
<menuitem name="DisplayUnratedOrHigher" action="DisplayUnratedOrHigher" />
<menuitem name="DisplayRejectedOrHigher" action="DisplayRejectedOrHigher" />
<menuitem name="DisplayRejectedOnly" action="DisplayRejectedOnly" />
<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>
......@@ -30,6 +30,17 @@
<menuitem name="DisplayExtendedProperties" action="CommonDisplayExtendedProperties" />
<menuitem name="DisplaySearchbar" action="CommonDisplaySearchbar" />
<separator />
<menu name="FilterPhotos" 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" />
</menu>
<separator />
<menu name="SortEvents" action="CommonSortEvents">
<menuitem name="SortEventsAscending" action="CommonSortEventsAscending" />
<menuitem name="SortEventsDescending" action="CommonSortEventsDescending" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment