mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Device drivers: Support for device specific icons
This commit is contained in:
parent
319196add3
commit
ee9e45d50d
BIN
resources/images/devices/italica.png
Normal file
BIN
resources/images/devices/italica.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
BIN
resources/images/devices/kindle.jpg
Normal file
BIN
resources/images/devices/kindle.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
@ -116,6 +116,7 @@ class ITALICA(EB600):
|
|||||||
|
|
||||||
name = 'Italica Device Interface'
|
name = 'Italica Device Interface'
|
||||||
gui_name = 'Italica'
|
gui_name = 'Italica'
|
||||||
|
icon = I('devices/italica.png')
|
||||||
|
|
||||||
FORMATS = ['epub', 'rtf', 'fb2', 'html', 'prc', 'mobi', 'pdf', 'txt']
|
FORMATS = ['epub', 'rtf', 'fb2', 'html', 'prc', 'mobi', 'pdf', 'txt']
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ class DevicePlugin(Plugin):
|
|||||||
CAN_SET_METADATA = True
|
CAN_SET_METADATA = True
|
||||||
#: Path separator for paths to books on device
|
#: Path separator for paths to books on device
|
||||||
path_sep = os.sep
|
path_sep = os.sep
|
||||||
|
#: Icon for this device
|
||||||
|
icon = I('reader.svg')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def test_bcd_windows(cls, device_id, bcd):
|
def test_bcd_windows(cls, device_id, bcd):
|
||||||
|
@ -18,6 +18,7 @@ class KINDLE(USBMS):
|
|||||||
|
|
||||||
name = 'Kindle Device Interface'
|
name = 'Kindle Device Interface'
|
||||||
gui_name = 'Amazon Kindle'
|
gui_name = 'Amazon Kindle'
|
||||||
|
icon = I('devices/kindle.jpg')
|
||||||
description = _('Communicate with the Kindle eBook reader.')
|
description = _('Communicate with the Kindle eBook reader.')
|
||||||
author = 'John Schember'
|
author = 'John Schember'
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
|
@ -295,7 +295,7 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
|
|
||||||
# This is typically needed when the device has the same
|
# This is typically needed when the device has the same
|
||||||
# WINDOWS_MAIN_MEM and WINDOWS_CARD_A_MEM in which case
|
# WINDOWS_MAIN_MEM and WINDOWS_CARD_A_MEM in which case
|
||||||
# if the devices is connected without a card, the above
|
# if the device is connected without a card, the above
|
||||||
# will incorrectly identify the main mem as carda
|
# will incorrectly identify the main mem as carda
|
||||||
# See for example the driver for the Nook
|
# See for example the driver for the Nook
|
||||||
if 'main' not in drives and 'carda' in drives:
|
if 'main' not in drives and 'carda' in drives:
|
||||||
|
@ -775,6 +775,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
|||||||
_(' detected.'), 3000)
|
_(' detected.'), 3000)
|
||||||
self.device_connected = True
|
self.device_connected = True
|
||||||
self._sync_menu.enable_device_actions(True, self.device_manager.device.card_prefix())
|
self._sync_menu.enable_device_actions(True, self.device_manager.device.card_prefix())
|
||||||
|
self.location_view.model().device_connected(self.device_manager.device)
|
||||||
else:
|
else:
|
||||||
self.save_device_view_settings()
|
self.save_device_view_settings()
|
||||||
self.device_connected = False
|
self.device_connected = False
|
||||||
|
@ -242,6 +242,10 @@ class LocationModel(QAbstractListModel):
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def device_connected(self, dev):
|
||||||
|
self.icons[1] = QIcon(dev.icon)
|
||||||
|
self.dataChanged.emit(self.index(1), self.index(1))
|
||||||
|
|
||||||
def headerData(self, section, orientation, role):
|
def headerData(self, section, orientation, role):
|
||||||
return NONE
|
return NONE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user