progress dialog tweaks

- don't use mw as parent if it's not visible
- wider
This commit is contained in:
Damien Elmes 2017-08-16 13:20:29 +10:00
parent 8ab5a3a176
commit b3a569ed57

View file

@ -98,7 +98,10 @@ class ProgressManager:
if self._levels > 1: if self._levels > 1:
return return
# setup window # setup window
parent = parent or self.app.activeWindow() or self.mw parent = parent or self.app.activeWindow()
if not parent and self.mw.isVisible():
parent = self.mw
label = label or _("Processing...") label = label or _("Processing...")
if cancellable: if cancellable:
klass = self.ProgressCancellable klass = self.ProgressCancellable
@ -110,6 +113,7 @@ class ProgressManager:
self._win.setAutoClose(False) self._win.setAutoClose(False)
self._win.setAutoReset(False) self._win.setAutoReset(False)
self._win.setWindowModality(Qt.ApplicationModal) self._win.setWindowModality(Qt.ApplicationModal)
self._win.setMinimumWidth(300)
# we need to manually manage minimum time to show, as qt gets confused # we need to manually manage minimum time to show, as qt gets confused
# by the db handler # by the db handler
self._win.setMinimumDuration(100000) self._win.setMinimumDuration(100000)