Removing fields from the sfdb works. Dialog is fully functional as presented.
authorTaybin Rutkin <taybin@taybin.com>
Wed, 18 Jan 2006 21:05:59 +0000 (21:05 +0000)
committerTaybin Rutkin <taybin@taybin.com>
Wed, 18 Jan 2006 21:05:59 +0000 (21:05 +0000)
git-svn-id: svn://localhost/trunk/ardour2@276 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/sfdb_ui.cc
gtk2_ardour/sfdb_ui.h

index d737d409fddc42699dc06fcdfc7b234841b0cad5..0ad46946bf275f7935fa748451a2fe55e40c1853 100644 (file)
@@ -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)
        :
index 49f19e847d0baf1fdf7cda06ed735b04980e4185..d1725ce8f3cc6909e503513c44814216398ce9ed 100644 (file)
@@ -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);