From bbac6e953d0edc052cdf57ec361dbd56a88e193e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 17 Oct 2013 16:29:17 +0530 Subject: [PATCH] Tolino driver: Add an option to swap the main memory and card in calibre Fixes #1240504 [Tolino Shine: Please change (again, sorry) device order](https://bugs.launchpad.net/calibre/+bug/1240504) --- src/calibre/devices/eb600/driver.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/eb600/driver.py b/src/calibre/devices/eb600/driver.py index 12812f3b9a..67a8bb5242 100644 --- a/src/calibre/devices/eb600/driver.py +++ b/src/calibre/devices/eb600/driver.py @@ -59,10 +59,24 @@ class TOLINO(EB600): VENDOR_NAME = ['DEUTSCHE'] WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = ['_TELEKOMTOLINO'] + EXTRA_CUSTOMIZATION_MESSAGE = [ + _('Swap main and card A') + + ':::' + + _('Check this box if the device\'s main memory is being seen as card a and the card ' + 'is being seen as main memory. Some Tolino devices may need this option.'), + ] + + EXTRA_CUSTOMIZATION_DEFAULT = [ + True, + ] + + OPT_SWAP_MEMORY = 0 + # There are apparently two versions of this device, one with swapped # drives and one without, see https://bugs.launchpad.net/bugs/1240504 def linux_swap_drives(self, drives): - if len(drives) < 2 or not drives[0] or not drives[1]: + e = self.settings().extra_customization + if len(drives) < 2 or not drives[0] or not drives[1] or not e[self.OPT_SWAP_MEMORY]: return drives drives = list(drives) t = drives[0] @@ -71,7 +85,8 @@ class TOLINO(EB600): return tuple(drives) def windows_sort_drives(self, drives): - if len(drives) < 2: + e = self.settings().extra_customization + if len(drives) < 2 or not e[self.OPT_SWAP_MEMORY]: return drives main = drives.get('main', None) carda = drives.get('carda', None)