update drobilla's fascistic dir-locals.el to force emacs users into whitespace submis...
[ardour.git] / gtk2_ardour / export_format_selector.cc
index 122facdd39d8affa4e3de581c1477c145f4e850b..d3ffce936a67867618724c6df17533f4f602ebfe 100644 (file)
@@ -46,14 +46,15 @@ ExportFormatSelector::ExportFormatSelector () :
        edit_button.signal_clicked().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &ExportFormatSelector::open_edit_dialog), false)));
        remove_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::remove_format));
        new_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::add_new_format));
-       
+
        /* Format combo */
-       
+
        format_list = Gtk::ListStore::create (format_cols);
+        format_list->set_sort_column (format_cols.label, Gtk::SORT_ASCENDING);
        format_combo.set_model (format_list);
        format_combo.pack_start (format_cols.label);
        format_combo.set_active (0);
-       
+
        format_combo.signal_changed().connect (sigc::mem_fun (*this, &ExportFormatSelector::update_format_combo));
 }
 
@@ -65,9 +66,10 @@ ExportFormatSelector::~ExportFormatSelector ()
 void
 ExportFormatSelector::set_state (ARDOUR::ExportProfileManager::FormatStatePtr const state_, ARDOUR::Session * session_)
 {
-       session = session_;
+       SessionHandlePtr::set_session (session_);
+
        state = state_;
-       
+
        update_format_list ();
 }
 
@@ -97,7 +99,7 @@ ExportFormatSelector::update_format_list ()
        if (format_combo.get_active_row_number() == -1) {
                format_combo.set_active (0);
        }
-       
+
        select_format (format_to_select);
 }
 
@@ -111,7 +113,7 @@ ExportFormatSelector::select_format (FormatPtr f)
                        break;
                }
        }
-       
+
        CriticalSelectionChanged();
 }
 
@@ -119,7 +121,7 @@ void
 ExportFormatSelector::add_new_format ()
 {
        FormatPtr new_format = state->format = NewFormat (state->format);
-       
+
        if (open_edit_dialog (true) != Gtk::RESPONSE_APPLY) {
                remove_format();
                if (state->list->empty()) {
@@ -141,7 +143,7 @@ int
 ExportFormatSelector::open_edit_dialog (bool new_dialog)
 {
        ExportFormatDialog dialog (state->format, new_dialog);
-       dialog.set_session (session);
+       dialog.set_session (_session);
        Gtk::ResponseType response = (Gtk::ResponseType) dialog.run();
        if (response == Gtk::RESPONSE_APPLY) {
                update_format_description ();
@@ -163,7 +165,7 @@ ExportFormatSelector::update_format_combo ()
                edit_button.set_sensitive (false);
                remove_button.set_sensitive (false);
        }
-       
+
        CriticalSelectionChanged();
 }