mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
c2d78fefc0
commit
2b14b4f21b
@ -170,12 +170,13 @@ class ApplyDialog(QDialog):
|
|||||||
self.failures = []
|
self.failures = []
|
||||||
self.ids = []
|
self.ids = []
|
||||||
self.canceled = False
|
self.canceled = False
|
||||||
|
self.finalized = False
|
||||||
self.pb.setMinimum(0)
|
self.pb.setMinimum(0)
|
||||||
self.pb.setMaximum(len(id_map))
|
self.pb.setMaximum(len(id_map))
|
||||||
self.timer.start(50)
|
self.timer.start(50)
|
||||||
|
|
||||||
def do_one(self):
|
def do_one(self):
|
||||||
if self.canceled:
|
if self.canceled or self.finalized:
|
||||||
return
|
return
|
||||||
if self.current_idx >= len(self.id_map):
|
if self.current_idx >= len(self.id_map):
|
||||||
self.finalize()
|
self.finalize()
|
||||||
@ -210,10 +211,10 @@ class ApplyDialog(QDialog):
|
|||||||
def finalize(self):
|
def finalize(self):
|
||||||
self.timer.stop()
|
self.timer.stop()
|
||||||
|
|
||||||
if self.canceled:
|
if self.canceled or self.finalized:
|
||||||
return
|
return
|
||||||
# Prevent queued timer events from having any effect
|
# Prevent queued timer events from having any effect
|
||||||
self.canceled = True
|
self.finalized = True
|
||||||
|
|
||||||
if self.failures:
|
if self.failures:
|
||||||
msg = []
|
msg = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user