mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Display the forced IP address in the Connect/Share menu and the Wireless device dialog.
This commit is contained in:
parent
1a19cd7c19
commit
fd80b279cd
@ -505,6 +505,8 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
|
||||
return self.OPT_USE_PORT
|
||||
elif opt_string == 'port_number':
|
||||
return self.OPT_PORT_NUMBER
|
||||
elif opt_string == 'force_ip_address':
|
||||
return self.OPT_FORCE_IP_ADDRESS
|
||||
else:
|
||||
return None
|
||||
|
||||
|
@ -240,6 +240,11 @@ class ConnectShareAction(InterfaceAction):
|
||||
from calibre.gui2.dialogs.smartdevice import get_all_ip_addresses
|
||||
dm = self.gui.device_manager
|
||||
|
||||
forced_ip = dm.get_option('smartdevice', 'force_ip_address')
|
||||
if forced_ip:
|
||||
formatted_addresses = forced_ip
|
||||
show_port = True
|
||||
else:
|
||||
all_ips = get_all_ip_addresses()
|
||||
if len(all_ips) > 3:
|
||||
formatted_addresses = _('Many IP addresses. See Start/Stop dialog.')
|
||||
|
@ -115,6 +115,10 @@ class SmartdeviceDialog(QDialog, Ui_Dialog):
|
||||
self.auto_mgmt_button.setText(_('Automatic metadata management is enabled'))
|
||||
self.auto_mgmt_button.setEnabled(False)
|
||||
|
||||
forced_ip = self.device_manager.get_option('smartdevice', 'force_ip_address')
|
||||
if forced_ip:
|
||||
self.ip_addresses.setText(forced_ip)
|
||||
else:
|
||||
self.ip_addresses.setText(', '.join(get_all_ip_addresses()))
|
||||
|
||||
self.resize(self.sizeHint())
|
||||
|
Loading…
x
Reference in New Issue
Block a user