mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Fix incorrect serialization of ip_addresses in the preferences dialog after the content server has been started
This commit is contained in:
parent
affd7be313
commit
5858575750
@ -171,6 +171,14 @@ class Text(QLineEdit):
|
|||||||
self.setText(str(val or ''))
|
self.setText(str(val or ''))
|
||||||
|
|
||||||
|
|
||||||
|
class IPAddresses(Text):
|
||||||
|
|
||||||
|
def set(self, val):
|
||||||
|
if isinstance(val, tuple):
|
||||||
|
val = ', '.join(map(str, val))
|
||||||
|
self.setText(str(val or ''))
|
||||||
|
|
||||||
|
|
||||||
class Path(QWidget):
|
class Path(QWidget):
|
||||||
|
|
||||||
changed_signal = pyqtSignal()
|
changed_signal = pyqtSignal()
|
||||||
@ -257,6 +265,8 @@ class AdvancedTab(QWidget):
|
|||||||
w = Text
|
w = Text
|
||||||
if name in ('ssl_certfile', 'ssl_keyfile'):
|
if name in ('ssl_certfile', 'ssl_keyfile'):
|
||||||
w = Path
|
w = Path
|
||||||
|
elif name == 'trusted_ips':
|
||||||
|
w = IPAddresses
|
||||||
w = w(name, l)
|
w = w(name, l)
|
||||||
setattr(self, 'opt_' + name, w)
|
setattr(self, 'opt_' + name, w)
|
||||||
self.widgets.append(w)
|
self.widgets.append(w)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user