Commit 707feb71 authored by Clinton Rogers's avatar Clinton Rogers

This fixes #3321 by altering the way we set the initial value of the radio...

This fixes #3321 by altering the way we set the initial value of the radio action group, as well as making sure that the events directory page gets constructed with the proper sort setting (by making it read from the config).
parent 32f59a90
......@@ -183,7 +183,8 @@ public abstract class EventsDirectoryPage : CheckerboardPage {
base (page_name);
// set comparator before monitoring source collection, to prevent a re-sort
get_view().set_comparator(get_event_comparator(true), event_comparator_predicate);
get_view().set_comparator(get_event_comparator(Config.get_instance().get_events_sort_ascending()),
event_comparator_predicate);
get_view().monitor_source_collection(Event.global, view_manager, null, initial_events);
init_item_context_menu("/EventsDirectoryContextMenu");
......
......@@ -1619,7 +1619,14 @@ public class LibraryWindow : AppWindow {
Gtk.RadioAction? sort_events_action = get_common_action("CommonSortEventsAscending")
as Gtk.RadioAction;
assert(sort_events_action != null);
sort_events_action.set_active(Config.get_instance().get_events_sort_ascending());
// Ticket #3321 - Event sorting order wasn't saving on exit.
// Instead of calling set_active against one of the toggles, call
// set_current_value against the entire radio group...
int event_sort_val = Config.get_instance().get_events_sort_ascending() ? SORT_EVENTS_ORDER_ASCENDING :
SORT_EVENTS_ORDER_DESCENDING;
sort_events_action.set_current_value(event_sort_val);
}
private void start_pulse_background_progress_bar(string label, int priority) {
......
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