]> git.0d.be Git - jack_mixer.git/commitdiff
Update clear menu item to also clear output channels
authorFrédéric Péters <fpeters@0d.be>
Mon, 14 Dec 2009 21:21:08 +0000 (22:21 +0100)
committerFrédéric Péters <fpeters@0d.be>
Mon, 14 Dec 2009 21:27:14 +0000 (22:27 +0100)
channel.py
jack_mixer.py

index ac4a605c30824a07e0fe2599a17e06534afb7da6..ee5e39f0ab0988e00d775d50f5abb5d41e66e60a 100644 (file)
@@ -373,6 +373,10 @@ class InputChannel(Channel):
         self.vbox.pack_start(control_group, False)
         return control_group
 
+    def remove_control_group(self, channel):
+        ctlgroup = self.get_control_group(channel)
+        self.vbox.remove(ctlgroup)
+
     def update_control_group(self, channel):
         for control_group in self.vbox.get_children():
             if isinstance(control_group, ControlGroup):
@@ -389,7 +393,7 @@ class InputChannel(Channel):
     def unrealize(self):
         Channel.unrealize(self)
         self.channel.remove()
-        self.channel = False
+        self.channel = None
 
     channel_properties_dialog = None
     def on_channel_properties(self):
@@ -597,7 +601,8 @@ class OutputChannel(Channel):
 
     def unrealize(self):
         Channel.unrealize(self)
-        self.channel = False
+        self.channel.remove()
+        self.channel = None
 
     def serialization_name(self):
         return output_channel_serialization_name()
index e99d682f5997438576964874b28447a27609ddcc..cb71ae77d84680eb03167aad0e3f78d85621aa2e 100755 (executable)
@@ -284,10 +284,14 @@ class JackMixer(SerializedObject):
             self.channel_remove_menu_item.set_sensitive(False)
 
     def on_channels_clear(self, widget):
+        for channel in self.output_channels:
+            channel.unrealize()
+            self.hbox_outputs.remove(channel.parent)
         for channel in self.channels:
             channel.unrealize()
             self.hbox_inputs.remove(channel.parent)
         self.channels = []
+        self.output_channels = []
         self.channel_remove_menu = gtk.Menu()
         self.channel_remove_menu_item.set_submenu(self.channel_remove_menu)
         self.channel_remove_menu_item.set_sensitive(False)