Call 'remove curve from playlist' when deleting curves via the playlist panel.
authorW. Trevor King <wking@drexel.edu>
Thu, 10 Nov 2011 17:03:39 +0000 (12:03 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 10 Nov 2011 17:03:39 +0000 (12:03 -0500)
hooke/ui/gui/__init__.py
hooke/ui/gui/panel/playlist.py

index f5a0958..fc41717 100644 (file)
@@ -609,7 +609,10 @@ class HookeFrame (wx.Frame):
         pass
 
     def _on_delete_curve(self, _class, method, playlist, curve):
-        # TODO: execute_command 'remove curve from playlist'
+        index = playlist.index(curve)
+        results = self.execute_command(
+            command=self._command_by_name('remove curve from playlist'),
+            args={'index': index})
         #os.remove(curve.path)
         pass
 
index f355e6d..9c8dc36 100644 (file)
@@ -244,7 +244,9 @@ class Tree (wx.TreeCtrl):
             if c.name == name:
                 curve = c
                 break
-        self._delete_curve(playlist, curve)
+        if curve is None:
+            raise ValueError(name)
+        self._delete_curve(playlist=playlist, curve=curve)
         in_callback(self, playlist, curve)
 
     def _delete_curve(self, playlist, curve):
@@ -254,7 +256,7 @@ class Tree (wx.TreeCtrl):
         """
         _id = self._id_for_name.pop((playlist.name, curve.name))
         del(self._name_for_id[_id])
-        in_callback(self, playlistcurve)
+        in_callback(self, playlist=playlist, curve=curve)
 
     # Get selection