Skip to content

Commit

Permalink
Tutorial: Clean up tutorial objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Feb 11, 2020
1 parent 937c87c commit 9a27269
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/windows/views/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ def __init__(self, id, text, arrow, *args):
# Make transparent
self.setAttribute(Qt.WA_NoSystemBackground, True)
self.setAttribute(Qt.WA_TranslucentBackground, True)
#self.setWindowFlags(Qt.FramelessWindowHint)
# self.setWindowFlags(Qt.FramelessWindowHint)

self.setAttribute(Qt.WA_DeleteOnClose, True)


class TutorialManager(object):
Expand Down Expand Up @@ -197,6 +199,9 @@ def process(self, parent_name=None):
tutorial_dialog.btn_next_tip.clicked.connect(functools.partial(self.next_tip, tutorial_id))
tutorial_dialog.btn_close_tips.clicked.connect(functools.partial(self.hide_tips, tutorial_id, True))

# Get previous dock contents
old_widget = self.dock.widget()

# Insert into tutorial dock
self.dock.setWidget(tutorial_dialog)
self.current_dialog = tutorial_dialog
Expand All @@ -206,6 +211,11 @@ def process(self, parent_name=None):
self.dock.setEnabled(True)
self.re_position_dialog()
self.dock.show()

# Delete old widget
if old_widget:
old_widget.close()

break

def get_object(self, object_id):
Expand Down

0 comments on commit 9a27269

Please sign in to comment.