mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Fix restoring confirmation dialogs not restoring question_dialog() based confirmations
This commit is contained in:
parent
26431a36ea
commit
61bf9e10ce
@ -412,11 +412,12 @@ def question_dialog(parent, title, msg, det_msg='', show_copy_button=False,
|
|||||||
yes_text=None, no_text=None, yes_icon=None, no_icon=None,
|
yes_text=None, no_text=None, yes_icon=None, no_icon=None,
|
||||||
):
|
):
|
||||||
from calibre.gui2.dialogs.message_box import MessageBox
|
from calibre.gui2.dialogs.message_box import MessageBox
|
||||||
|
prefs = gui_prefs()
|
||||||
|
|
||||||
if not isinstance(skip_dialog_name, unicode_type):
|
if not isinstance(skip_dialog_name, unicode_type):
|
||||||
skip_dialog_name = None
|
skip_dialog_name = None
|
||||||
try:
|
try:
|
||||||
auto_skip = set(gprefs.get('questions_to_auto_skip', ()))
|
auto_skip = set(prefs.get('questions_to_auto_skip', ()))
|
||||||
except Exception:
|
except Exception:
|
||||||
auto_skip = set()
|
auto_skip = set()
|
||||||
if (skip_dialog_name is not None and skip_dialog_name in auto_skip):
|
if (skip_dialog_name is not None and skip_dialog_name in auto_skip):
|
||||||
@ -438,7 +439,7 @@ def question_dialog(parent, title, msg, det_msg='', show_copy_button=False,
|
|||||||
|
|
||||||
if skip_dialog_name is not None and not d.toggle_checkbox.isChecked():
|
if skip_dialog_name is not None and not d.toggle_checkbox.isChecked():
|
||||||
auto_skip.add(skip_dialog_name)
|
auto_skip.add(skip_dialog_name)
|
||||||
gprefs.set('questions_to_auto_skip', list(auto_skip))
|
prefs.set('questions_to_auto_skip', list(auto_skip))
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@ -841,6 +841,10 @@ class Preferences(QDialog):
|
|||||||
elif key.startswith('skip_ask_to_show_current_diff_for_'):
|
elif key.startswith('skip_ask_to_show_current_diff_for_'):
|
||||||
del tprefs[key]
|
del tprefs[key]
|
||||||
changed += 1
|
changed += 1
|
||||||
|
elif key == 'questions_to_auto_skip':
|
||||||
|
changed += len(tprefs[key] or ())
|
||||||
|
del tprefs[key]
|
||||||
|
|
||||||
msg = _('There are no disabled confirmation prompts')
|
msg = _('There are no disabled confirmation prompts')
|
||||||
if changed:
|
if changed:
|
||||||
msg = ngettext(
|
msg = ngettext(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user