Skip to content

Commit

Permalink
Set modal dialogs parent
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanderBrown committed Apr 13, 2018
1 parent 550698a commit 27e0f8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions mu/interface/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class ModeSelector(QDialog):
Defines a UI for selecting the mode for Mu.
"""

def __init__(self, parent):
super().__init__(parent)

def setup(self, modes, current_mode, theme):

This comment has been minimized.

Copy link
@ZanderBrown

ZanderBrown Apr 13, 2018

Author Contributor

@ntoll What's the reasoning for having this method instead of using __init__?

This comment has been minimized.

Copy link
@ntoll

ntoll Apr 13, 2018

Member

None, but it happens elsewhere and it's completely harmless. ;-)

if theme == 'day':
self.setStyleSheet(DAY_STYLE)
Expand Down Expand Up @@ -169,6 +172,9 @@ class AdminDialog(QDialog):
variables etc...).
"""

def __init__(self, parent):
super().__init__(parent)

def setup(self, log, settings, theme):
if theme == 'day':
self.setStyleSheet(DAY_STYLE)
Expand Down
4 changes: 2 additions & 2 deletions mu/interface/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def show_admin(self, log, settings, theme):
and settings. Return a dictionary of the settings that may have been
changed by the admin dialog.
"""
admin_box = AdminDialog()
admin_box = AdminDialog(self)
admin_box.setup(log, settings, theme)
admin_box.exec()
return admin_box.settings()
Expand Down Expand Up @@ -797,7 +797,7 @@ def select_mode(self, modes, current_mode, theme):
"""
Display the mode selector dialog and return the result.
"""
mode_select = ModeSelector()
mode_select = ModeSelector(self)
mode_select.setup(modes, current_mode, theme)
mode_select.exec()
try:
Expand Down

0 comments on commit 27e0f8e

Please sign in to comment.