mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
Fix for win10/qt6 progbar not displaying initially.
This commit is contained in:
parent
fc68c4574a
commit
a5832e8d02
1 changed files with 3 additions and 11 deletions
|
|
@ -662,7 +662,6 @@ class _LoopProgressDialog(QProgressDialog):
|
||||||
self.status_prefix = status_prefix
|
self.status_prefix = status_prefix
|
||||||
self.i = 0
|
self.i = 0
|
||||||
self.start_time = datetime.now()
|
self.start_time = datetime.now()
|
||||||
self.first = True
|
|
||||||
|
|
||||||
# can't import at file load.
|
# can't import at file load.
|
||||||
from calibre_plugins.fanficfare_plugin.prefs import prefs
|
from calibre_plugins.fanficfare_plugin.prefs import prefs
|
||||||
|
|
@ -673,7 +672,9 @@ class _LoopProgressDialog(QProgressDialog):
|
||||||
|
|
||||||
## self.do_loop does QTimer.singleShot on self.do_loop also.
|
## self.do_loop does QTimer.singleShot on self.do_loop also.
|
||||||
## A weird way to do a loop, but that was the example I had.
|
## A weird way to do a loop, but that was the example I had.
|
||||||
QTimer.singleShot(0, self.do_loop)
|
## 100 instead of 0 on the first go due to Win10(and later
|
||||||
|
## qt6) not displaying dialog properly.
|
||||||
|
QTimer.singleShot(100, self.do_loop)
|
||||||
self.exec_()
|
self.exec_()
|
||||||
|
|
||||||
def updateStatus(self):
|
def updateStatus(self):
|
||||||
|
|
@ -689,15 +690,6 @@ class _LoopProgressDialog(QProgressDialog):
|
||||||
|
|
||||||
def do_loop(self):
|
def do_loop(self):
|
||||||
|
|
||||||
if self.first:
|
|
||||||
## Windows 10 doesn't want to show the prog dialog content
|
|
||||||
## until after the timer's been called again. Something to
|
|
||||||
## do with cooperative multi threading maybe?
|
|
||||||
## So this just trips the timer loop an extra time at the start.
|
|
||||||
self.first = False
|
|
||||||
QTimer.singleShot(0, self.do_loop)
|
|
||||||
return
|
|
||||||
|
|
||||||
book = self.book_list[self.i]
|
book = self.book_list[self.i]
|
||||||
try:
|
try:
|
||||||
## collision spec passed into getadapter by partial from fff_plugin
|
## collision spec passed into getadapter by partial from fff_plugin
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue