From 2ff72a513feda237d9430b0cc463bc74d61a7071 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Tue, 8 Mar 2011 08:23:28 +0000
Subject: [PATCH 1/2] Fix #9323: selection lost when editing metadata on device
---
src/calibre/gui2/device.py | 8 ++++++++
src/calibre/gui2/init.py | 6 +++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py
index 298e541730..2cbecc134c 100644
--- a/src/calibre/gui2/device.py
+++ b/src/calibre/gui2/device.py
@@ -1160,6 +1160,14 @@ class DeviceMixin(object): # {{{
), bad)
d.exec_()
+ def upload_dirtied_booklists(self):
+ '''
+ Upload metadata to device.
+ '''
+ plugboards = self.library_view.model().db.prefs.get('plugboards', {})
+ self.device_manager.sync_booklists(Dispatcher(lambda x: x),
+ self.booklists(), plugboards)
+
def upload_booklists(self):
'''
Upload metadata to device.
diff --git a/src/calibre/gui2/init.py b/src/calibre/gui2/init.py
index 9119a8da77..80f1f1c2cf 100644
--- a/src/calibre/gui2/init.py
+++ b/src/calibre/gui2/init.py
@@ -44,13 +44,13 @@ class LibraryViewMixin(object): # {{{
for view in (self.library_view, self.memory_view, self.card_a_view, self.card_b_view):
getattr(view, func)(*args)
- self.memory_view.connect_dirtied_signal(self.upload_booklists)
+ self.memory_view.connect_dirtied_signal(self.upload_dirtied_booklists)
self.memory_view.connect_upload_collections_signal(
func=self.upload_collections, oncard=None)
- self.card_a_view.connect_dirtied_signal(self.upload_booklists)
+ self.card_a_view.connect_dirtied_signal(self.upload_dirtied_booklists)
self.card_a_view.connect_upload_collections_signal(
func=self.upload_collections, oncard='carda')
- self.card_b_view.connect_dirtied_signal(self.upload_booklists)
+ self.card_b_view.connect_dirtied_signal(self.upload_dirtied_booklists)
self.card_b_view.connect_upload_collections_signal(
func=self.upload_collections, oncard='cardb')
self.book_on_device(None, reset=True)
From db47b8c067318dc1e49bcfeadeb191f718852a12 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Tue, 8 Mar 2011 08:53:54 +0000
Subject: [PATCH 2/2] Simplify identifier search/replace.
---
src/calibre/gui2/dialogs/metadata_bulk.py | 9 ++++++++-
src/calibre/gui2/dialogs/metadata_bulk.ui | 8 ++++----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py
index a7d25c0cb4..e270cd0a55 100644
--- a/src/calibre/gui2/dialogs/metadata_bulk.py
+++ b/src/calibre/gui2/dialogs/metadata_bulk.py
@@ -396,7 +396,10 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog):
ident_types = sorted(self.db.get_all_identifier_types(), key=sort_key)
self.s_r_dst_ident.setCompleter(QCompleter(ident_types))
- ident_types.insert(0, '')
+ try:
+ self.s_r_dst_ident.setPlaceholderText(_('Enter an identifier type'))
+ except:
+ pass
self.s_r_src_ident.addItems(ident_types)
self.main_heading = _(
@@ -644,6 +647,10 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog):
dest = src
dest_mode = self.replace_mode.currentIndex()
+ if self.destination_field_fm['is_csp']:
+ if not unicode(self.s_r_dst_ident.text()):
+ raise Exception(_('You must specify a destination identifier type'))
+
if self.destination_field_fm['is_multiple']:
if self.comma_separated.isChecked():
if dest == 'authors':
diff --git a/src/calibre/gui2/dialogs/metadata_bulk.ui b/src/calibre/gui2/dialogs/metadata_bulk.ui
index 75ea1ce8bd..59a68d6514 100644
--- a/src/calibre/gui2/dialogs/metadata_bulk.ui
+++ b/src/calibre/gui2/dialogs/metadata_bulk.ui
@@ -735,7 +735,7 @@ Future conversion of these books will use the default settings.
-
- Identifier:
+ Identifier type:
s_r_src_ident
@@ -751,7 +751,7 @@ Future conversion of these books will use the default settings.
- Choose which identifier to operate upon
+ Choose which identifier type to operate upon
@@ -936,7 +936,7 @@ not multiple and the destination field is multiple
-
- Identifier:
+ Identifier type:
s_r_dst_ident
@@ -952,7 +952,7 @@ not multiple and the destination field is multiple
- Choose which identifier to operate upon
+ Choose which identifier type to operate upon