Add button to clear identifiers edit

This commit is contained in:
Kovid Goyal 2011-04-18 10:07:41 -06:00
parent 7281c8de79
commit ba71b95f78
2 changed files with 6 additions and 3 deletions

View File

@ -973,7 +973,7 @@ class IdentifiersEdit(QLineEdit): # {{{
tt = self.BASE_TT
extra = ''
if not isbn:
col = 'rgba(0,255,0,0%)'
col = 'none'
elif check_isbn(isbn) is not None:
col = 'rgba(0,255,0,20%)'
extra = '\n\n'+_('This ISBN number is valid')

View File

@ -156,6 +156,9 @@ class MetadataSingleDialogBase(ResizableDialog):
self.identifiers = IdentifiersEdit(self)
self.basic_metadata_widgets.append(self.identifiers)
self.clear_identifiers_button = QToolButton(self)
self.clear_identifiers_button.setIcon(QIcon(I('trash.png')))
self.clear_identifiers_button.clicked.connect(self.identifiers.clear)
self.publisher = PublisherEdit(self)
self.basic_metadata_widgets.append(self.publisher)
@ -541,8 +544,8 @@ class MetadataSingleDialog(MetadataSingleDialogBase): # {{{
sto(self.rating, self.tags)
create_row2(2, self.tags, self.tags_editor_button)
sto(self.tags_editor_button, self.identifiers)
create_row2(3, self.identifiers)
sto(self.identifiers, self.timestamp)
create_row2(3, self.identifiers, self.clear_identifiers_button)
sto(self.clear_identifiers_button, self.timestamp)
create_row2(4, self.timestamp, self.timestamp.clear_button)
sto(self.timestamp.clear_button, self.pubdate)
create_row2(5, self.pubdate, self.pubdate.clear_button)