From 6144e41bf9a709e78dc571067c12791643819bba Mon Sep 17 00:00:00 2001 From: Papoteur Date: Thu, 23 Feb 2023 08:52:48 +0100 Subject: Display nodev dialog only after the main windows (mga#31586) --- lib/isodumper.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/isodumper.py b/lib/isodumper.py index fe5d49a..56eb3d6 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -204,6 +204,7 @@ class IsoDumper(basedialog.BaseDialog): if self.nodevDialog(): self.list = self.u.find_devices() else: + self._running = False return False self.devicelist.addItem("", False) if len(self.list) > 0: @@ -897,20 +898,8 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.eventManager.addWidgetEvent(self.refreshbt, self.update_list) self.eventManager.addWidgetEvent(self.helpbt, self.help_dialog) self.eventManager.addWidgetEvent(self.aboutbt, self.aboutDialog) - self.u = None - try: - self.u = UDisks2() - except: - message = _('UDisks2 is not available on your system') - logging.error(message) - self.emergency(message) - if not self.get_devices(): - self.dialog.destroy() - yui.YUILoader.deleteUI() - self._running = False - return # Set the initial state, active, disabled - self.initial_state() + #self.initial_state() self.dialog.recalcLayout() self.uEventQueue = SimpleQueue() @@ -1165,6 +1154,9 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog #if event.eventType() == yui.YEvent.CancelEvent: #self.confirm_close() #break + if self._start: + self._start = False + self.initial_state() try: item = self.uEventQueue.get_nowait() logging.debug(f"Dealing with {item['event']}") @@ -1177,11 +1169,22 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.backupTitle = yui.YUI.app().applicationTitle() yui.YUI.app().setApplicationTitle(self._title) + try: + self.u = UDisks2() + print("UDisks2 OK") + except: + message = _('UDisks2 is not available on your system') + logging.error(message) + self.emergency(message) + self._running = False + return self._setupUI() # setting to False will break the event loop self._running = True + self._start = False self.timeout = 100 + self._start = True try: self._handleEvents() -- cgit v1.2.1