mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Confirm quit while delete in progress
This commit is contained in:
parent
05572d975a
commit
c4a82de4c7
@ -113,4 +113,9 @@ def shutdown(timeout=20):
|
||||
__ds.shutdown(timeout)
|
||||
__ds = None
|
||||
|
||||
def has_jobs():
|
||||
global __ds
|
||||
if __ds is not None:
|
||||
return (not __ds.requests.empty()) or __ds.requests.unfinished_tasks
|
||||
return False
|
||||
|
||||
|
@ -809,6 +809,14 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
|
||||
if not question_dialog(self, _('Active jobs'), msg):
|
||||
return False
|
||||
from calibre.db.delete_service import has_jobs
|
||||
if has_jobs():
|
||||
msg = _('Some deleted books are still being moved to the Recycle '
|
||||
'Bin, if you quit now, they will be left behind. Are you '
|
||||
'sure you want to quit?')
|
||||
if not question_dialog(self, _('Active jobs'), msg):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def shutdown(self, write_settings=True):
|
||||
|
Loading…
x
Reference in New Issue
Block a user