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.
This commit is contained in:
parent
335381d6f2
commit
18c4be96dc
|
@ -116,16 +116,29 @@ class Gadget(e.Gadget):
|
||||||
return main_box
|
return main_box
|
||||||
|
|
||||||
def popup_destroyed(self, popup):
|
def popup_destroyed(self, popup):
|
||||||
# DBG("POPUP DESTROYED")
|
""" remove the popup objects from our tracking lists """
|
||||||
# remove the objects from our lists
|
|
||||||
for obj in popup.data['players_box'].children:
|
""" This was used to work, but it doesn't work anymore :(
|
||||||
for player, objs in self.player_objs.items():
|
box.children is always empty, probably E is deleting the contents
|
||||||
while obj in objs:
|
before calling us """
|
||||||
objs.remove(obj)
|
# for obj in popup.data['players_box'].children:
|
||||||
for obj in popup.data['volumes_box'].children:
|
# for player, objs in self.player_objs.items():
|
||||||
for channel, objs in self.channel_objs.items():
|
# while obj in objs:
|
||||||
while obj in objs:
|
# objs.remove(obj)
|
||||||
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):
|
def popup_player_add(self, popup, player):
|
||||||
# create the edje obj for this player from 'e/gadgets/audio/player'
|
# create the edje obj for this player from 'e/gadgets/audio/player'
|
||||||
|
|
Loading…
Reference in New Issue