From 25905711fb0fea3454c0a6dd97422c5d2cc2fbfe Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Mon, 5 Jul 2010 14:48:51 +0100
Subject: [PATCH] 1) More changes for connect-time syncing. 2) some changes to
the Boox driver
---
src/calibre/devices/hanlin/driver.py | 17 ++++++++++-------
src/calibre/devices/usbms/driver.py | 4 +++-
src/calibre/gui2/dialogs/config/add_save.ui | 4 ++--
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/src/calibre/devices/hanlin/driver.py b/src/calibre/devices/hanlin/driver.py
index f19135a7e7..3db55d05c5 100644
--- a/src/calibre/devices/hanlin/driver.py
+++ b/src/calibre/devices/hanlin/driver.py
@@ -119,22 +119,25 @@ class BOOX(HANLINV3):
MAIN_MEMORY_VOLUME_LABEL = 'BOOX Internal Memory'
STORAGE_CARD_VOLUME_LABEL = 'BOOX Storage Card'
- EBOOK_DIR_MAIN = ['MyBooks']
- EXTRA_CUSTOMIZATION_MESSAGE = _('Comma separated list of directories to '
- 'send e-books to on the device. The first one that exists will '
- 'be used.')
+ EBOOK_DIR_MAIN = ['MyBooks', 'MyBooks']
+ EXTRA_CUSTOMIZATION_MESSAGE = _('Directories to send e-books to on the device. '
+ 'The first directory is used for main memory. '
+ 'The second is used for cards.')
EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN)
- # EBOOK_DIR_CARD_A = 'MyBooks' ## Am quite sure we need this.
-
def post_open_callback(self):
opts = self.settings()
dirs = opts.extra_customization
if not dirs:
dirs = self.EBOOK_DIR_MAIN
else:
+ # will have at least one item ...
dirs = [x.strip() for x in dirs.split(',')]
- self.EBOOK_DIR_MAIN = dirs
+ self.EBOOK_DIR_MAIN = dirs[0]
+ if len(dirs) > 1:
+ self.EBOOK_DIR_CARD_A = self.EBOOK_DIR_CARD_B = dirs[1]
+ else:
+ self.EBOOK_DIR_CARD_A = self.EBOOK_DIR_CARD_B = dirs[0]
def windows_sort_drives(self, drives):
return drives
diff --git a/src/calibre/devices/usbms/driver.py b/src/calibre/devices/usbms/driver.py
index 1a088cc77c..73a329be58 100644
--- a/src/calibre/devices/usbms/driver.py
+++ b/src/calibre/devices/usbms/driver.py
@@ -58,7 +58,7 @@ class USBMS(CLI, Device):
debug_print ('USBMS: Fetching list of books from device. oncard=', oncard)
- dummy_bl = booklist_class(None, None, None)
+ dummy_bl = self.booklist_class(None, None, None)
if oncard == 'carda' and not self._card_a_prefix:
self.report_progress(1.0, _('Getting list of books on device...'))
@@ -78,6 +78,8 @@ class USBMS(CLI, Device):
self.EBOOK_DIR_CARD_B if oncard == 'cardb' else \
self.get_main_ebook_dir()
+ debug_print ('USBMS: dirs are:', prefix, ebook_dirs)
+
# get the metadata cache
bl = self.booklist_class(oncard, prefix, self.settings)
need_sync = self.parse_metadata_cache(bl, prefix, self.METADATA_CACHE)
diff --git a/src/calibre/gui2/dialogs/config/add_save.ui b/src/calibre/gui2/dialogs/config/add_save.ui
index 35824ef847..9ded5d91c2 100644
--- a/src/calibre/gui2/dialogs/config/add_save.ui
+++ b/src/calibre/gui2/dialogs/config/add_save.ui
@@ -6,7 +6,7 @@
0
0
- 588
+ 599
516
@@ -200,7 +200,7 @@ Title match ignores leading indefinite articles ("the", "a",
-
- Choose 'Manual Management', to have Calibre update the metadata cache (not the book) and add collections when a book is sent. With this option, calibre will never remove a collection. Choose 'Calibre manages metadata when sending books' to have Calibre update the metadata cache and add/remove collections when you send a book to the device. Choose 'Calibre manages metadata when device is connected' to have Calibre update the metadata cache and add/remove collections when you connect the device.
+ Choose 'Manual Management', to have Calibre update the metadata cache (not the book) and add collections when a book is sent. With this option, calibre will never remove a collection. Choose 'Calibre manages metadata when sending books' to have Calibre update the metadata cache and add/remove collections for a book when it is sent to the device. Choose 'Calibre manages metadata when device is connected' to have Calibre update the metadata cache and add/remove collections when calibre connects to the device and when you send a book.
Qt::PlainText