From db47b8c067318dc1e49bcfeadeb191f718852a12 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Tue, 8 Mar 2011 08:53:54 +0000
Subject: [PATCH] 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