Fix QtHandler modality
This commit is contained in:
parent
3422d855c9
commit
3f2ba5ec20
|
@ -13,6 +13,8 @@ from electrum.plugins import hook
|
||||||
from electrum.util import PrintError
|
from electrum.util import PrintError
|
||||||
|
|
||||||
|
|
||||||
|
# By far the trickiest thing about this handler is the window stack;
|
||||||
|
# MacOSX is very fussy the modal dialogs are perfectly parented
|
||||||
class QtHandler(PrintError):
|
class QtHandler(PrintError):
|
||||||
'''An interface between the GUI (here, QT) and the device handling
|
'''An interface between the GUI (here, QT) and the device handling
|
||||||
logic for handling I/O. This is a generic implementation of the
|
logic for handling I/O. This is a generic implementation of the
|
||||||
|
@ -82,6 +84,7 @@ class QtHandler(PrintError):
|
||||||
self.clear_dialog()
|
self.clear_dialog()
|
||||||
title = _('Please check your %s device') % self.device
|
title = _('Please check your %s device') % self.device
|
||||||
self.dialog = dialog = WindowModalDialog(self.window_stack[-1], title)
|
self.dialog = dialog = WindowModalDialog(self.window_stack[-1], title)
|
||||||
|
self.window_stack.append(dialog)
|
||||||
l = QLabel(msg)
|
l = QLabel(msg)
|
||||||
vbox = QVBoxLayout(dialog)
|
vbox = QVBoxLayout(dialog)
|
||||||
if cancel_callback:
|
if cancel_callback:
|
||||||
|
@ -96,6 +99,7 @@ class QtHandler(PrintError):
|
||||||
def clear_dialog(self):
|
def clear_dialog(self):
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
self.dialog.accept()
|
self.dialog.accept()
|
||||||
|
self.window_stack.remove(self.dialog)
|
||||||
self.dialog = None
|
self.dialog = None
|
||||||
|
|
||||||
def exec_dialog(self, dialog):
|
def exec_dialog(self, dialog):
|
||||||
|
|
Loading…
Reference in New Issue