mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Cosmetic changes to edit tags (edit items): use toolbuttons instead of pushbuttons.
This commit is contained in:
parent
d909d2effc
commit
1584a4751e
@ -5,6 +5,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|||||||
|
|
||||||
from PyQt5.Qt import Qt, QDialog, QAbstractItemView, QApplication
|
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.dialogs.tag_editor_ui import Ui_TagEditor
|
||||||
from calibre.gui2 import question_dialog, error_dialog, gprefs
|
from calibre.gui2 import question_dialog, error_dialog, gprefs
|
||||||
from calibre.constants import islinux
|
from calibre.constants import islinux
|
||||||
@ -118,6 +119,10 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
if not items:
|
if not items:
|
||||||
error_dialog(self, 'No tags selected', 'You must select at least one tag from the list of Available tags.').exec_()
|
error_dialog(self, 'No tags selected', 'You must select at least one tag from the list of Available tags.').exec_()
|
||||||
return
|
return
|
||||||
|
if not confirm(
|
||||||
|
_('Deleting tags is done immediately and there is no undo.'),
|
||||||
|
'tag_editor_delete'):
|
||||||
|
return
|
||||||
pos = self.available_tags.verticalScrollBar().value()
|
pos = self.available_tags.verticalScrollBar().value()
|
||||||
for item in items:
|
for item in items:
|
||||||
used = self.db.is_tag_used(unicode_type(item.text())) \
|
used = self.db.is_tag_used(unicode_type(item.text())) \
|
||||||
|
@ -82,120 +82,166 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QGridLayout" name="middleBoxLayout">
|
||||||
<item>
|
<item row="1" column="1">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<widget class="QLineEdit" name="available_filter_input">
|
||||||
<item row="1" column="0">
|
<property name="placeholderText">
|
||||||
<widget class="QLineEdit" name="available_filter_input">
|
<string>Filter the available items</string>
|
||||||
<property name="placeholderText">
|
</property>
|
||||||
<string>Filter the available items</string>
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QListWidget" name="available_tags">
|
||||||
|
<property name="alternatingRowColors">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<layout class="QVBoxLayout" name="buttonverticalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vorizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="clearButtonEnabled">
|
<property name="sizeHint" stdset="0">
|
||||||
<bool>true</bool>
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item>
|
||||||
<widget class="QListWidget" name="available_tags">
|
<widget class="QToolButton" name="delete_button">
|
||||||
<property name="alternatingRowColors">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::MultiSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="selectionBehavior">
|
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<widget class="QPushButton" name="delete_button">
|
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Delete the item from database. This will unapply the item from all books and then remove it from the database.</string>
|
<string>Delete the item from database. This will unapply the item from all books and then remove it from the database.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
|
||||||
<string>&Delete item(s)</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../../../resources/images.qrc">
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/trash.png</normaloff>:/images/trash.png</iconset>
|
<normaloff>:/images/trash.png</normaloff>:/images/trash.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="2">
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<spacer name="verticalSpacer2">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Ava&ilable items</string>
|
<enum>Qt::Vorizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="sizeHint" stdset="0">
|
||||||
<cstring>available_tags</cstring>
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1" colspan="2">
|
||||||
<widget class="QToolButton" name="apply_button">
|
<widget class="QLabel" name="label">
|
||||||
<property name="toolTip">
|
<property name="text">
|
||||||
<string>Apply item to current book</string>
|
<string>Ava&ilable items</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="buddy">
|
||||||
<iconset resource="../../../../resources/images.qrc">
|
<cstring>available_tags</cstring>
|
||||||
<normaloff>:/images/forward.png</normaloff>:/images/forward.png</iconset>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="2">
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QVBoxLayout" name="buttonverticalLayout">
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="QLineEdit" name="applied_filter_input">
|
<spacer name="verticalSpacer">
|
||||||
<property name="placeholderText">
|
<property name="orientation">
|
||||||
<string>Filter the applied items</string>
|
<enum>Qt::Vorizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="clearButtonEnabled">
|
<property name="sizeHint" stdset="0">
|
||||||
<bool>true</bool>
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item>
|
||||||
<widget class="QListWidget" name="applied_tags">
|
<widget class="QToolButton" name="apply_button">
|
||||||
<property name="alternatingRowColors">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::MultiSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="selectionBehavior">
|
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Applied &items</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>applied_tags</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<widget class="QPushButton" name="unapply_button">
|
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Unapply (remove) the item from current book</string>
|
<string>Apply item to current book</string>
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Unapply item(s)</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../../../resources/images.qrc">
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/minus.png</normaloff>:/images/minus.png</iconset>
|
<normaloff>:/images/forward.png</normaloff>:/images/forward.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="unapply_button">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Unapply (remove) the item from current book</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
|
<normaloff>:/images/back.png</normaloff>:/images/back.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vorizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QLineEdit" name="applied_filter_input">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Filter the applied items</string>
|
||||||
|
</property>
|
||||||
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="3">
|
||||||
|
<widget class="QListWidget" name="applied_tags">
|
||||||
|
<property name="alternatingRowColors">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Applied &items</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>applied_tags</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user