diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index d737d409fd..0ad46946bf 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -264,7 +264,19 @@ SoundFileBox::add_field_clicked () void SoundFileBox::remove_field_clicked () -{} +{ + field_view.get_selection()->selected_foreach_iter(mem_fun(*this, &SoundFileBox::delete_row)); + + Library->save_changes (); +} + +void +SoundFileBox::delete_row (const Gtk::TreeModel::iterator& iter) +{ + Gtk::TreeModel::Row row = *iter; + + Library->remove_field(row[label_columns.field]); +} void SoundFileBox::audition_status_changed (bool active) @@ -278,7 +290,13 @@ SoundFileBox::audition_status_changed (bool active) void SoundFileBox::field_selected () -{} +{ + if (field_view.get_selection()->count_selected_rows()) { + remove_field_btn.set_sensitive(true); + } else { + remove_field_btn.set_sensitive(false); + } +} SoundFileBrowser::SoundFileBrowser (std::string title) : diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h index 49f19e847d..d1725ce8f3 100644 --- a/gtk2_ardour/sfdb_ui.h +++ b/gtk2_ardour/sfdb_ui.h @@ -99,6 +99,7 @@ class SoundFileBox : public Gtk::VBox void stop_btn_clicked (); void add_field_clicked (); void remove_field_clicked (); + void delete_row (const Gtk::TreeModel::iterator& iter); void field_selected (); void audition_status_changed (bool state);