Commit c2edafc1 authored by Eric Gregory's avatar Eric Gregory

#3319 view event for photo disappeared

parent 12afc04c
......@@ -786,6 +786,12 @@ public abstract class AppWindow : PageWindow {
action.is_important = important;
}
public void set_common_action_visible(string name, bool visible) {
Gtk.Action? action = get_common_action(name);
if (action != null)
action.visible = visible;
}
protected override void switched_pages(Page? old_page, Page? new_page) {
update_common_action_availability(old_page, new_page);
......
......@@ -504,15 +504,15 @@ public class EventPage : CollectionPage {
}
protected override void init_actions(int selected_count, int count) {
// hide this command in CollectionPage, as it does not apply here
set_action_visible("CommonJumpToEvent", false);
base.init_actions(selected_count, count);
}
protected override void update_actions(int selected_count, int count) {
set_action_sensitive("MakePrimary", selected_count == 1);
// hide this command in CollectionPage, as it does not apply here
set_action_visible("CommonJumpToEvent", false);
base.update_actions(selected_count, count);
}
......
......@@ -687,6 +687,7 @@ public class LibraryWindow : AppWindow {
}
set_common_action_sensitive("CommonEmptyTrash", can_empty_trash());
set_common_action_visible("CommonJumpToEvent", true);
set_common_action_sensitive("CommonJumpToEvent", can_jump_to_event());
set_common_action_sensitive("CommonFullscreen", can_fullscreen);
......@@ -714,7 +715,6 @@ public class LibraryWindow : AppWindow {
private bool can_jump_to_event() {
ViewCollection view = get_current_page().get_view();
if (view.get_selected_count() == 1) {
DataSource selected_source = view.get_selected_source_at(0);
if (selected_source is Event)
......
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