From eafa02f6f9ffc7991e92acb6b9fdf7324954bd93 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Tue, 14 May 2013 16:44:28 +0200 Subject: [PATCH] Add user-setable device name to wireless device --- src/calibre/devices/smart_device_app/driver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py index 6187f94b31..5fe60862e1 100644 --- a/src/calibre/devices/smart_device_app/driver.py +++ b/src/calibre/devices/smart_device_app/driver.py @@ -875,6 +875,9 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): self.client_device_kind = result.get('deviceKind', '') self._debug('Client device kind', self.client_device_kind) + self.client_device_name = result.get('deviceName', self.client_device_kind) + self._debug('Client device name', self.client_device_name) + self.max_book_packet_len = result.get('maxBookContentPacketLen', self.BASE_PACKET_LEN) self._debug('max_book_packet_len', self.max_book_packet_len) @@ -946,6 +949,8 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): return False def get_gui_name(self): + if getattr(self, 'client_device_name', None): + return self.gui_name_template%(self.gui_name, self.client_device_name) if getattr(self, 'client_device_kind', None): return self.gui_name_template%(self.gui_name, self.client_device_kind) return self.gui_name