Simplify identifier search/replace.

This commit is contained in:
Charles Haley 2011-03-08 08:53:54 +00:00
parent b670fe2194
commit db47b8c067
2 changed files with 12 additions and 5 deletions

View File

@ -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':

View File

@ -735,7 +735,7 @@ Future conversion of these books will use the default settings.</string>
<item row="5" column="0">
<widget class="QLabel" name="s_r_src_ident_label">
<property name="text">
<string>Identifier:</string>
<string>Identifier type:</string>
</property>
<property name="buddy">
<cstring>s_r_src_ident</cstring>
@ -751,7 +751,7 @@ Future conversion of these books will use the default settings.</string>
</sizepolicy>
</property>
<property name="toolTip">
<string>Choose which identifier to operate upon</string>
<string>Choose which identifier type to operate upon</string>
</property>
</widget>
</item>
@ -936,7 +936,7 @@ not multiple and the destination field is multiple</string>
<item row="9" column="0">
<widget class="QLabel" name="s_r_dst_ident_label">
<property name="text">
<string>Identifier:</string>
<string>Identifier type:</string>
</property>
<property name="buddy">
<cstring>s_r_dst_ident</cstring>
@ -952,7 +952,7 @@ not multiple and the destination field is multiple</string>
</sizepolicy>
</property>
<property name="toolTip">
<string>Choose which identifier to operate upon</string>
<string>Choose which identifier type to operate upon</string>
</property>
</widget>
</item>