mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Change the plugin configuration do_user_config() to reopen the the dialog if the validator fails. This happens only if the plugin has a config widget and validators.
This commit is contained in:
parent
04642ffda9
commit
19a2115618
@ -180,14 +180,19 @@ class Plugin: # {{{
|
||||
v.addWidget(button_box)
|
||||
if not config_dialog.restore_geometry(gprefs, prefname):
|
||||
QApplication.instance().ensure_window_on_screen(config_dialog)
|
||||
config_dialog.exec()
|
||||
|
||||
if config_dialog.result() == QDialog.DialogCode.Accepted:
|
||||
if hasattr(config_widget, 'validate'):
|
||||
if config_widget.validate():
|
||||
while True:
|
||||
validation_error = False
|
||||
config_dialog.exec()
|
||||
if config_dialog.result() == QDialog.DialogCode.Accepted:
|
||||
if hasattr(config_widget, 'validate'):
|
||||
if config_widget.validate():
|
||||
self.save_settings(config_widget)
|
||||
else:
|
||||
validation_error = True
|
||||
else:
|
||||
self.save_settings(config_widget)
|
||||
else:
|
||||
self.save_settings(config_widget)
|
||||
if not validation_error:
|
||||
break
|
||||
else:
|
||||
from calibre.customize.ui import customize_plugin, plugin_customization
|
||||
help_text = self.customization_help(gui=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user