diff --git a/gadgets/audio/__init__.py b/gadgets/audio/__init__.py index ca034c5..8019029 100644 --- a/gadgets/audio/__init__.py +++ b/gadgets/audio/__init__.py @@ -116,16 +116,29 @@ class Gadget(e.Gadget): return main_box def popup_destroyed(self, popup): - # DBG("POPUP DESTROYED") - # remove the objects from our lists - for obj in popup.data['players_box'].children: - for player, objs in self.player_objs.items(): - while obj in objs: - objs.remove(obj) - for obj in popup.data['volumes_box'].children: - for channel, objs in self.channel_objs.items(): - while obj in objs: - objs.remove(obj) + """ remove the popup objects from our tracking lists """ + + """ This was used to work, but it doesn't work anymore :( + box.children is always empty, probably E is deleting the contents + before calling us """ + # for obj in popup.data['players_box'].children: + # for player, objs in self.player_objs.items(): + # while obj in objs: + # objs.remove(obj) + # for obj in popup.data['volumes_box'].children: + # for channel, objs in self.channel_objs.items(): + # while obj in objs: + # objs.remove(obj) + + """ new implementation """ + for player, objs_list in self.player_objs.items(): + for obj in objs_list: + if obj.is_deleted(): + objs_list.remove(obj) + for channel, sliders_list in self.channel_objs.items(): + for slider in sliders_list: + if slider.is_deleted(): + sliders_list.remove(slider) def popup_player_add(self, popup, player): # create the edje obj for this player from 'e/gadgets/audio/player'