From f34d509415b50d5c2851f765f56efb50182631fe Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 27 Sep 2012 18:52:48 +0200 Subject: [PATCH] Add port number to content server action menu line. --- src/calibre/gui2/actions/device.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/actions/device.py b/src/calibre/gui2/actions/device.py index 5ab56121c1..c44e77e605 100644 --- a/src/calibre/gui2/actions/device.py +++ b/src/calibre/gui2/actions/device.py @@ -17,6 +17,7 @@ from calibre.customize.ui import is_disabled from calibre.devices.bambook.driver import BAMBOOK from calibre.gui2.dialogs.smartdevice import SmartdeviceDialog from calibre.gui2 import info_dialog, question_dialog +from calibre.library.server import server_config as content_server_config class ShareConnMenu(QMenu): # {{{ @@ -90,7 +91,12 @@ class ShareConnMenu(QMenu): # {{{ if running: listen_on = (verify_ipV4_address(tweaks['server_listen_on']) or get_external_ip()) - text = _('Stop Content Server') + ' [%s]'%listen_on + try : + cs_port = content_server_config().parse().port + ip_text = ' [%s, port %d]'%(listen_on, cs_port) + except: + ip_text = ''; + text = _('Stop Content Server') + ip_text self.toggle_server_action.setText(text) def hide_smartdevice_menus(self):