From d5a6652396441bdc7aeef084b65862ca9976871c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 14 Dec 2009 22:21:08 +0100 Subject: [PATCH] Update clear menu item to also clear output channels --- channel.py | 9 +++++++-- jack_mixer.py | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/channel.py b/channel.py index ac4a605..ee5e39f 100644 --- a/channel.py +++ b/channel.py @@ -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() diff --git a/jack_mixer.py b/jack_mixer.py index e99d682..cb71ae7 100755 --- a/jack_mixer.py +++ b/jack_mixer.py @@ -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) -- 2.39.2