diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index af56e2e657..a736f9fb27 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -188,6 +188,10 @@ class MetadataSingleDialogBase(ResizableDialog): self.tags_editor_button.setToolTip(_('Open Tag Editor')) self.tags_editor_button.setIcon(QIcon(I('chapters.png'))) self.tags_editor_button.clicked.connect(self.tags_editor) + self.clear_tags_button = QToolButton(self) + self.clear_tags_button.setToolTip(_('Clear all tags')) + self.clear_tags_button.setIcon(QIcon(I('trash.png'))) + self.clear_tags_button.clicked.connect(self.tags.clear) self.basic_metadata_widgets.append(self.tags) self.identifiers = IdentifiersEdit(self) @@ -656,9 +660,10 @@ class MetadataSingleDialog(MetadataSingleDialogBase): # {{{ l.addItem(self.tabs[0].spc_one, 1, 0, 1, 3) sto(self.cover.buttons[-1], self.rating) create_row2(1, self.rating) - sto(self.rating, self.tags) - create_row2(2, self.tags, self.tags_editor_button) - sto(self.tags_editor_button, self.paste_isbn_button) + sto(self.rating, self.tags_editor_button) + sto(self.tags_editor_button, self.tags) + create_row2(2, self.tags, self.clear_tags_button, front_button=self.tags_editor_button) + sto(self.clear_tags_button, self.paste_isbn_button) sto(self.paste_isbn_button, self.identifiers) create_row2(3, self.identifiers, self.clear_identifiers_button, front_button=self.paste_isbn_button) @@ -761,6 +766,7 @@ class MetadataSingleDialogAlt1(MetadataSingleDialogBase): # {{{ tl.addWidget(self.swap_title_author_button, 0, 0, 2, 1) tl.addWidget(self.manage_authors_button, 2, 0, 1, 1) tl.addWidget(self.paste_isbn_button, 12, 0, 1, 1) + tl.addWidget(self.tags_editor_button, 6, 0, 1, 1) create_row(0, self.title, self.title_sort, button=self.deduce_title_sort_button, span=2, @@ -773,7 +779,7 @@ class MetadataSingleDialogAlt1(MetadataSingleDialogBase): # {{{ create_row(4, self.series, self.series_index, button=self.clear_series_button, icon='trash.png') create_row(5, self.series_index, self.tags) - create_row(6, self.tags, self.rating, button=self.tags_editor_button) + create_row(6, self.tags, self.rating, button=self.clear_tags_button) create_row(7, self.rating, self.pubdate) create_row(8, self.pubdate, self.publisher, button=self.pubdate.clear_button, icon='trash.png') @@ -785,7 +791,8 @@ class MetadataSingleDialogAlt1(MetadataSingleDialogBase): # {{{ button=self.clear_identifiers_button, icon='trash.png') sto(self.clear_identifiers_button, self.swap_title_author_button) sto(self.swap_title_author_button, self.manage_authors_button) - sto(self.manage_authors_button, self.paste_isbn_button) + sto(self.manage_authors_button, self.tags_editor_button) + sto(self.tags_editor_button, self.paste_isbn_button) tl.addItem(QSpacerItem(1, 1, QSizePolicy.Fixed, QSizePolicy.Expanding), 13, 1, 1 ,1) @@ -896,6 +903,7 @@ class MetadataSingleDialogAlt2(MetadataSingleDialogBase): # {{{ tl.addWidget(self.swap_title_author_button, 0, 0, 2, 1) tl.addWidget(self.manage_authors_button, 2, 0, 2, 1) tl.addWidget(self.paste_isbn_button, 12, 0, 1, 1) + tl.addWidget(self.tags_editor_button, 6, 0, 1, 1) create_row(0, self.title, self.title_sort, button=self.deduce_title_sort_button, span=2, @@ -908,7 +916,7 @@ class MetadataSingleDialogAlt2(MetadataSingleDialogBase): # {{{ create_row(4, self.series, self.series_index, button=self.clear_series_button, icon='trash.png') create_row(5, self.series_index, self.tags) - create_row(6, self.tags, self.rating, button=self.tags_editor_button) + create_row(6, self.tags, self.rating, button=self.clear_tags_button) create_row(7, self.rating, self.pubdate) create_row(8, self.pubdate, self.publisher, button=self.pubdate.clear_button, icon='trash.png') @@ -920,7 +928,8 @@ class MetadataSingleDialogAlt2(MetadataSingleDialogBase): # {{{ button=self.clear_identifiers_button, icon='trash.png') sto(self.clear_identifiers_button, self.swap_title_author_button) sto(self.swap_title_author_button, self.manage_authors_button) - sto(self.manage_authors_button, self.paste_isbn_button) + sto(self.manage_authors_button, self.tags_editor_button) + sto(self.tags_editor_button, self.paste_isbn_button) tl.addItem(QSpacerItem(1, 1, QSizePolicy.Fixed, QSizePolicy.Expanding), 13, 1, 1 ,1)