recent_label.set_markup (string_compose ("<span weight=\"bold\" size=\"large\">%1</span>", _("Recent Sessions")));
recent_session_model = TreeStore::create (recent_session_columns);
+ recent_session_model->signal_sort_column_changed().connect (sigc::mem_fun (*this, &SessionDialog::recent_session_sort_changed));
+
recent_session_display.set_model (recent_session_model);
recent_session_display.append_column (_("Session Name"), recent_session_columns.visible_name);
Gtk::TreeView::Column* pColumn;
if ((pColumn = recent_session_display.get_column (0))) { // name
pColumn->set_sort_column (recent_session_columns.visible_name);
- pColumn->set_sort_indicator (true);
}
if ((pColumn = recent_session_display.get_column (3))) { // date
pColumn->set_sort_column (recent_session_columns.time_modified); // unixtime
}
+ const int32_t sort = ARDOUR_UI::config()->get_recent_session_sort();
+ recent_session_model->set_sort_column (abs (sort), sort < 0 ? Gtk::SORT_DESCENDING : Gtk::SORT_ASCENDING);
+
return session_snapshot_count;
}
+void
+SessionDialog::recent_session_sort_changed ()
+{
+ int column;
+ SortType order;
+ if (recent_session_model->get_sort_column_id (column, order)) {
+ int32_t sort = column * (order == Gtk::SORT_DESCENDING ? -1 : 1);
+ if (sort != ARDOUR_UI::config()->get_recent_session_sort()) {
+ ARDOUR_UI::config()->set_recent_session_sort(sort);
+ }
+ }
+}
+
void
SessionDialog::recent_session_row_selected ()
{
Gtk::FileChooserButton existing_session_chooser;
int redisplay_recent_sessions ();
void recent_session_row_selected ();
+ void recent_session_sort_changed ();
void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
void existing_session_selected ();
UI_CONFIG_VARIABLE (bool, buggy_gradients, "buggy-gradients", false)
UI_CONFIG_VARIABLE (bool, cairo_image_surface, "cairo-image-surface", false)
UI_CONFIG_VARIABLE (uint64_t, waveform_cache_size, "waveform-cache-size", 100) /* units of megagbytes */
+UI_CONFIG_VARIABLE (int32_t, recent_session_sort, "recent-session-sort", 0)