Commit 7fe4a306 authored by Lucas Beeler's avatar Lucas Beeler

Improves messages displayed when view collections are empty or when no items...

Improves messages displayed when view collections are empty or when no items in the collection match the search filter. Closes #3213.
parent 9a5d9bb5
......@@ -286,6 +286,14 @@ public abstract class EventsDirectoryPage : CheckerboardPage {
base.update_actions(selected_count, count);
}
protected override string get_view_empty_message() {
return _("No events");
}
protected override string get_filter_no_match_message() {
return _("No events found");
}
public override void on_item_activated(CheckerboardItem item, CheckerboardPage.Activator
activator, CheckerboardPage.KeyboardModifiers modifiers) {
......
......@@ -1329,6 +1329,14 @@ public abstract class CheckerboardPage : Page {
return popup_context_menu(get_context_menu());
}
protected virtual string get_view_empty_message() {
return _("No photos/videos");
}
protected virtual string get_filter_no_match_message() {
return _("No photos/videos found");
}
protected virtual void on_item_activated(CheckerboardItem item, Activator activator,
KeyboardModifiers modifiers) {
}
......@@ -1377,9 +1385,9 @@ public abstract class CheckerboardPage : Page {
private void update_view_filter_message() {
if (get_view().are_items_filtered_out() && get_view().get_count() == 0) {
set_page_message(_("No items visible in your current filter"));
set_page_message(get_filter_no_match_message());
} else if (get_view().get_count() == 0) {
set_page_message(_("There are currently no items on this page"));
set_page_message(get_view_empty_message());
} else {
unset_page_message();
}
......
......@@ -137,7 +137,11 @@ public class TrashPage : CheckerboardPage {
get_command_manager().execute(new TrashUntrashPhotosCommand(
(Gee.Collection<LibraryPhoto>) get_view().get_selected_sources(), false));
}
protected override string get_view_empty_message() {
return _("Trash is empty");
}
public override GLib.Icon? get_icon() {
return new GLib.ThemedIcon(get_view().get_count() == 0 ?
Resources.ICON_TRASH_EMPTY : Resources.ICON_TRASH_FULL);
......
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