summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2020-05-02 10:37:30 +0200
committerDave Andreoli <dave@gurumeditation.it>2020-05-02 10:37:30 +0200
commit18c4be96dc3d8980c57b634abf8c3c840a3d738a (patch)
tree70254db83ad35d1c641351147c5ec19f08eabbe8
parent335381d6f2406e8d7b7520d9fa8fb9934ac130a7 (diff)
Audio: Fix cleanup of tracking lists
This was used to work, but it doesn't anymore :( box.children is always empty, probably E is deleting the contents of the popup before calling us. Try out a new implementation.
-rw-r--r--gadgets/audio/__init__.py33
1 files changed, 23 insertions, 10 deletions
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):
116 return main_box 116 return main_box
117 117
118 def popup_destroyed(self, popup): 118 def popup_destroyed(self, popup):
119 # DBG("POPUP DESTROYED") 119 """ remove the popup objects from our tracking lists """
120 # remove the objects from our lists 120
121 for obj in popup.data['players_box'].children: 121 """ This was used to work, but it doesn't work anymore :(
122 for player, objs in self.player_objs.items(): 122 box.children is always empty, probably E is deleting the contents
123 while obj in objs: 123 before calling us """
124 objs.remove(obj) 124 # for obj in popup.data['players_box'].children:
125 for obj in popup.data['volumes_box'].children: 125 # for player, objs in self.player_objs.items():
126 for channel, objs in self.channel_objs.items(): 126 # while obj in objs:
127 while obj in objs: 127 # objs.remove(obj)
128 objs.remove(obj) 128 # for obj in popup.data['volumes_box'].children:
129 # for channel, objs in self.channel_objs.items():
130 # while obj in objs:
131 # objs.remove(obj)
132
133 """ new implementation """
134 for player, objs_list in self.player_objs.items():
135 for obj in objs_list:
136 if obj.is_deleted():
137 objs_list.remove(obj)
138 for channel, sliders_list in self.channel_objs.items():
139 for slider in sliders_list:
140 if slider.is_deleted():
141 sliders_list.remove(slider)
129 142
130 def popup_player_add(self, popup, player): 143 def popup_player_add(self, popup, player):
131 # create the edje obj for this player from 'e/gadgets/audio/player' 144 # create the edje obj for this player from 'e/gadgets/audio/player'