Skip to content

Commit

Permalink
Fix viewer plugin relocation issue (ros-visualization#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
suryaambrose committed Mar 20, 2015
1 parent 121bde9 commit 293c523
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions rqt_bag/src/rqt_bag/timeline_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ def hideEvent(self, event):
item = self.layout().itemAt(0)
self.layout().removeItem(item)

def showEvent(self, event):
if self.isVisible():
# remove old listener
if self._viewer:
self._timeline.remove_listener(self._topic, self._viewer)
self._viewer = None

# clean out the layout
while self.layout().count() > 0:
item = self.layout().itemAt(0)
self.layout().removeItem(item)

# create a new viewer
self._viewer = self._viewer_type(self._timeline, self, self._topic)
self._timeline.add_listener(self._topic, self._viewer)

super(TopicPopupWidget, self).show()


def show(self, context):
"""
Make this topic popup visible, if necessary. This includes setting up
Expand Down

0 comments on commit 293c523

Please sign in to comment.