mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont allow GUI prefs to override userdb
This commit is contained in:
parent
b0e2cb8452
commit
0fab2c603e
@ -71,6 +71,7 @@ class Float(QDoubleSpinBox):
|
|||||||
def __init__(self, name, layout):
|
def __init__(self, name, layout):
|
||||||
QDoubleSpinBox.__init__(self)
|
QDoubleSpinBox.__init__(self)
|
||||||
self.setRange(0, 10000)
|
self.setRange(0, 10000)
|
||||||
|
self.setDecimals(1)
|
||||||
opt = options[name]
|
opt = options[name]
|
||||||
self.valueChanged.connect(self.changed_signal.emit)
|
self.valueChanged.connect(self.changed_signal.emit)
|
||||||
init_opt(self, opt, layout)
|
init_opt(self, opt, layout)
|
||||||
@ -133,7 +134,7 @@ class AdvancedTab(QWidget):
|
|||||||
self.widgets = []
|
self.widgets = []
|
||||||
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||||
for name in sorted(options, key=lambda n:options[n].shortdoc.lower()):
|
for name in sorted(options, key=lambda n:options[n].shortdoc.lower()):
|
||||||
if name in ('auth', 'port', 'allow_socket_preallocation'):
|
if name in ('auth', 'port', 'allow_socket_preallocation', 'userdb'):
|
||||||
continue
|
continue
|
||||||
opt = options[name]
|
opt = options[name]
|
||||||
if opt.choices:
|
if opt.choices:
|
||||||
@ -387,7 +388,7 @@ class ConfigWidget(ConfigWidgetBase):
|
|||||||
settings.update(getattr(tab, 'settings', {}))
|
settings.update(getattr(tab, 'settings', {}))
|
||||||
if settings['auth']:
|
if settings['auth']:
|
||||||
from calibre.srv.users import UserManager
|
from calibre.srv.users import UserManager
|
||||||
if not UserManager(settings['userdb']).all_user_names:
|
if not UserManager().all_user_names:
|
||||||
error_dialog(self, _('No users specified'), _(
|
error_dialog(self, _('No users specified'), _(
|
||||||
'You have turned on the setting to require passwords to access'
|
'You have turned on the setting to require passwords to access'
|
||||||
' the content server, but you have not created any user accounts.'
|
' the content server, but you have not created any user accounts.'
|
||||||
|
@ -148,7 +148,7 @@ raw_options = (
|
|||||||
_('Comma separated list of user-defined metadata fields that will not be displayed'
|
_('Comma separated list of user-defined metadata fields that will not be displayed'
|
||||||
' by the content server in the /opds and /mobile views.'),
|
' by the content server in the /opds and /mobile views.'),
|
||||||
|
|
||||||
_('Only display user-defined fields'),
|
_('Restrict displayed user-defined fields'),
|
||||||
'displayed_fields', None,
|
'displayed_fields', None,
|
||||||
_('Comma separated list of user-defined metadata fields that will be displayed'
|
_('Comma separated list of user-defined metadata fields that will be displayed'
|
||||||
' by the content server in the /opds and /mobile views. If you specify this'
|
' by the content server in the /opds and /mobile views. If you specify this'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user