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 f5a09580aed5eb1204da72d65303a5a142b0a5b9..fc417178ec9c567447eb99d0fb2872a7dc112047 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 f355e6d0038943a774e3778bf00beb8d09d67826..9c8dc3659c21398b043efb9d1f592ae811be6ce7 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