diff --git a/Tribler/Main/vwxGUI/list_body.py b/Tribler/Main/vwxGUI/list_body.py index 56905f4b0ac..2e5ff3df500 100644 --- a/Tribler/Main/vwxGUI/list_body.py +++ b/Tribler/Main/vwxGUI/list_body.py @@ -440,6 +440,8 @@ def GetColumn(self, column): return self.data[column] @warnWxThread + @inlineCallbacks + # TODO (Laurens): Refactor callers because deferred. def OnMouse(self, event): if event.Entering(): event.GetEventObject().selected = True @@ -456,7 +458,7 @@ def OnMouse(self, event): elif event.LeftUp(): if getattr(self.parent_list.lastMouseLeftDownEvent, 'listitem', None) == self: - self.OnClick(event) + yield self.OnClick(event) elif event.RightUp(): self.OnRightClick(event) @@ -478,7 +480,6 @@ def OnMouse(self, event): @warnWxThread @inlineCallbacks - # TODO (Laurens): Refactor callers because deferred. def OnClick(self, event=None, force=False): if not self.expanded or force: expanded = yield self.parent_list.OnExpand(self) @@ -501,9 +502,11 @@ def OnDClick(self, event=None): pass @warnWxThread + @inlineCallbacks + # TODO (Laurens): Refactor callers because deferred. def DoExpand(self): if not self.expanded: - self.OnClick() + yield self.OnClick() @warnWxThread def Expand(self, panel): @@ -1306,7 +1309,7 @@ def Select(self, key, raise_event=True, force=False): yield self.DeselectAll() if raise_event: - self.items[key].OnClick(None, force=force) + yield self.items[key].OnClick(None, force=force) else: self.items[key].expanded = True self.cur_expanded = self.items[key] diff --git a/Tribler/Main/vwxGUI/list_item.py b/Tribler/Main/vwxGUI/list_item.py index f3b26301959..d303716fd9b 100644 --- a/Tribler/Main/vwxGUI/list_item.py +++ b/Tribler/Main/vwxGUI/list_item.py @@ -225,10 +225,12 @@ def RefreshData(self, data): self.icons[index].Show(False) @warnWxThread + @inlineCallbacks + # TODO (Laurens): Refactor callers because deferred. def OnRightClick(self, event=None): mousepos = wx.GetMousePosition() if not self.expanded: - self.OnClick(event) + yield self.OnClick(event) def do_menu(): menu = self.GetContextMenu()