From 1584a4751e83c215a7eded7ac798f169395cf803 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 24 May 2020 09:42:20 +0100 Subject: [PATCH] Cosmetic changes to edit tags (edit items): use toolbuttons instead of pushbuttons. --- src/calibre/gui2/dialogs/tag_editor.py | 5 + src/calibre/gui2/dialogs/tag_editor.ui | 208 +++++++++++++++---------- 2 files changed, 132 insertions(+), 81 deletions(-) diff --git a/src/calibre/gui2/dialogs/tag_editor.py b/src/calibre/gui2/dialogs/tag_editor.py index 48d024537f..28176d74ad 100644 --- a/src/calibre/gui2/dialogs/tag_editor.py +++ b/src/calibre/gui2/dialogs/tag_editor.py @@ -5,6 +5,7 @@ __copyright__ = '2008, Kovid Goyal ' from PyQt5.Qt import Qt, QDialog, QAbstractItemView, QApplication +from calibre.gui2.dialogs.confirm_delete import confirm from calibre.gui2.dialogs.tag_editor_ui import Ui_TagEditor from calibre.gui2 import question_dialog, error_dialog, gprefs from calibre.constants import islinux @@ -118,6 +119,10 @@ class TagEditor(QDialog, Ui_TagEditor): if not items: error_dialog(self, 'No tags selected', 'You must select at least one tag from the list of Available tags.').exec_() return + if not confirm( + _('Deleting tags is done immediately and there is no undo.'), + 'tag_editor_delete'): + return pos = self.available_tags.verticalScrollBar().value() for item in items: used = self.db.is_tag_used(unicode_type(item.text())) \ diff --git a/src/calibre/gui2/dialogs/tag_editor.ui b/src/calibre/gui2/dialogs/tag_editor.ui index ea2a4de5cb..346b2955b4 100644 --- a/src/calibre/gui2/dialogs/tag_editor.ui +++ b/src/calibre/gui2/dialogs/tag_editor.ui @@ -82,120 +82,166 @@ - - - - - - - Filter the available items + + + + + Filter the available items + + + true + + + + + + + true + + + QAbstractItemView::MultiSelection + + + QAbstractItemView::SelectRows + + + + + + + + + Qt::Vorizontal - - true + + + 10 + 20 + - + - - - - true - - - QAbstractItemView::MultiSelection - - - QAbstractItemView::SelectRows - - - - - + + Delete the item from database. This will unapply the item from all books and then remove it from the database. - - &Delete item(s) - :/images/trash.png:/images/trash.png - - - - Ava&ilable items + + + + Qt::Vorizontal - - available_tags + + + 10 + 20 + - + - - - - Apply item to current book + + + + Ava&ilable items - - - :/images/forward.png:/images/forward.png + + available_tags - - - - - - Filter the applied items + + + + + + Qt::Vorizontal - - true + + + 10 + 20 + - + - - - - true - - - QAbstractItemView::MultiSelection - - - QAbstractItemView::SelectRows - - - - - - - Applied &items - - - applied_tags - - - - - + + - Unapply (remove) the item from current book - - - &Unapply item(s) + Apply item to current book - :/images/minus.png:/images/minus.png + :/images/forward.png:/images/forward.png + + + + Unapply (remove) the item from current book + + + + :/images/back.png:/images/back.png + + + + + + + Qt::Vorizontal + + + + 10 + 20 + + + + + + + + Filter the applied items + + + true + + + + + + + true + + + QAbstractItemView::MultiSelection + + + QAbstractItemView::SelectRows + + + + + + + Applied &items + + + applied_tags + + +