mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 18:43:39 +02:00
Add user-setable device name to wireless device
This commit is contained in:
parent
61dac94abe
commit
eafa02f6f9
1 changed files with 5 additions and 0 deletions
|
|
@ -875,6 +875,9 @@ def open(self, connected_device, library_uuid):
|
|||
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 @@ def open(self, connected_device, library_uuid):
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue