mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow users to set the content server port to < 1025 (system ports) witha warning. Fixes #5470 (You can only set the server port with the up and down arrows, not direct entry)
This commit is contained in:
parent
56fc01dbac
commit
f2f2996940
@ -464,6 +464,17 @@ class ConfigDialog(ResizableDialog, Ui_Dialog):
|
||||
self.opt_overwrite_author_title_metadata.setChecked(config['overwrite_author_title_metadata'])
|
||||
self.opt_enforce_cpu_limit.setChecked(config['enforce_cpu_limit'])
|
||||
self.device_detection_button.clicked.connect(self.debug_device_detection)
|
||||
self.port.editingFinished.connect(self.check_port_value)
|
||||
|
||||
def check_port_value(self, *args):
|
||||
port = self.port.value()
|
||||
if port < 1025:
|
||||
warning_dialog(self, _('System port selected'), '<p>'+
|
||||
_('The value <b>%d</b> you have chosen for the content '
|
||||
'server port is a system port. You operating '
|
||||
'system <b>may</b> not allow the server to run on this '
|
||||
'port. To be safe choose a port number larger than '
|
||||
'1024.')%port, show=True)
|
||||
|
||||
def debug_device_detection(self):
|
||||
from calibre.gui2.dialogs.config.device_debug import DebugDevice
|
||||
|
@ -719,9 +719,6 @@
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="port">
|
||||
<property name="minimum">
|
||||
<number>1025</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65535</number>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user