Fix #2056623 [[Enhancement] Move the Show options closer to the search field in the Manage items window](https://bugs.launchpad.net/calibre/+bug/2056623)

This commit is contained in:
Kovid Goyal 2024-03-10 10:05:59 +05:30
parent 2aec8675cd
commit f6e7d13bee
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 321 additions and 242 deletions

View File

@ -336,7 +336,6 @@ class TagListEditor(QDialog, Ui_TagListEditor):
from calibre.gui2.ui import get_gui from calibre.gui2.ui import get_gui
self.supports_notes = bool(category and get_gui().current_db.new_api.field_supports_notes(category)) self.supports_notes = bool(category and get_gui().current_db.new_api.field_supports_notes(category))
self.verticalLayout_2.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.search_box.setMinimumContentsLength(25) self.search_box.setMinimumContentsLength(25)
if category is not None: if category is not None:
item_map = get_gui().current_db.new_api.get_item_name_map(category) item_map = get_gui().current_db.new_api.get_item_name_map(category)
@ -620,10 +619,10 @@ class TagListEditor(QDialog, Ui_TagListEditor):
# something in this class, but replacing the table fixes it. # something in this class, but replacing the table fixes it.
if self.table is not None: if self.table is not None:
self.save_geometry() self.save_geometry()
self.gridlayout.removeWidget(self.table) self.central_layout.removeWidget(self.table)
sip.delete(self.table) sip.delete(self.table)
self.table = TleTableWidget(self) self.table = TleTableWidget(self)
self.gridlayout.addWidget(self.table, 2, 1, 1, 4) self.central_layout.addWidget(self.table)
self.table.setAlternatingRowColors(True) self.table.setAlternatingRowColors(True)
self.table.setSelectionMode(QAbstractItemView.ExtendedSelection) self.table.setSelectionMode(QAbstractItemView.ExtendedSelection)

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>676</width> <width>688</width>
<height>335</height> <height>335</height>
</rect> </rect>
</property> </property>
@ -17,275 +17,355 @@
<iconset resource="../../../../resources/images.qrc"> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/chapters.png</normaloff>:/images/chapters.png</iconset> <normaloff>:/images/chapters.png</normaloff>:/images/chapters.png</iconset>
</property> </property>
<layout class="QGridLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="0" column="0"> <item>
<widget class="QLabel" name="label"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="text">
<string>&amp;Search for:</string>
</property>
<property name="buddy">
<cstring>search_box</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="HistoryLineEdit" name="search_box">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Search for an item in the first column</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="search_button">
<property name="toolTip">
<string>Find items containing the search string</string>
</property>
<property name="text">
<string>S&amp;earch</string>
</property>
<property name="icon">
<iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/search.png</normaloff>:/images/search.png</iconset>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4" rowspan="2">
<layout class="QVBoxLayout" name="show_button_layout">
<item> <item>
<widget class="QRadioButton" name="apply_all_checkbox"> <layout class="QFormLayout" name="formLayout">
<property name="text"> <property name="fieldGrowthPolicy">
<string>Show &amp;all items</string> <enum>QFormLayout::ExpandingFieldsGrow</enum>
</property> </property>
</widget> <item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Search for:</string>
</property>
<property name="buddy">
<cstring>search_box</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="HistoryLineEdit" name="search_box">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Search for an item in the first column</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="search_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Find items containing the search string</string>
</property>
<property name="text">
<string>S&amp;earch</string>
</property>
<property name="icon">
<iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/search.png</normaloff>:/images/search.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Filter by:</string>
</property>
<property name="buddy">
<cstring>filter_box</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QWidget" name="widget_2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="HistoryLineEdit" name="filter_box">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Filter items using the text in this box</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="filter_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Show only items containing this text</string>
</property>
<property name="text">
<string>F&amp;ilter</string>
</property>
<property name="icon">
<iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/filter.png</normaloff>:/images/filter.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="apply_vl_checkbox"> <layout class="QVBoxLayout" name="show_button_layout">
<property name="toolTip"> <item>
<string>&lt;p&gt;Show items only if they appear in the <widget class="QRadioButton" name="apply_all_checkbox">
<property name="text">
<string>Show &amp;all items</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="apply_vl_checkbox">
<property name="toolTip">
<string>&lt;p&gt;Show items only if they appear in the
current Virtual library. Edits already done may be hidden but will current Virtual library. Edits already done may be hidden but will
not be forgotten. not be forgotten.
&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;
Note that this box affects only what is displayed. Changes Note that this box affects only what is displayed. Changes
will affect all books in your library even if this box will affect all books in your library even if this box
is checked.&lt;/p&gt;</string> is checked.&lt;/p&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Only show items in the current &amp;Virtual library</string> <string>Only show items in the current &amp;Virtual library</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="apply_selection_checkbox"> <widget class="QRadioButton" name="apply_selection_checkbox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Show items only if they appear in the <string>&lt;p&gt;Show items only if they appear in the
currently selected books. Edits already done may be hidden but will currently selected books. Edits already done may be hidden but will
not be forgotten. not be forgotten.
&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;
Note that this box affects only what is displayed. Changes Note that this box affects only what is displayed. Changes
will affect all books in your library even if this box will affect all books in your library even if this box
is checked.&lt;/p&gt;</string> is checked.&lt;/p&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>O&amp;nly show items in the currently selected books</string> <string>O&amp;nly show items in the currently selected books</string>
</property> </property>
</widget> </widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QLabel" name="label"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="text">
<string>&amp;Filter by:</string>
</property>
<property name="buddy">
<cstring>filter_box</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="HistoryLineEdit" name="filter_box">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Filter items using the text in this box</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="filter_button">
<property name="toolTip">
<string>Show only items containing this text</string>
</property>
<property name="text">
<string>F&amp;ilter</string>
</property>
<property name="icon">
<iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/filter.png</normaloff>:/images/filter.png</iconset>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<spacer name="verticalSpacer_3"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="orientation"> <item>
<enum>Qt::Vertical</enum> <spacer name="verticalSpacer_3">
</property> <property name="orientation">
<property name="sizeHint" stdset="0"> <enum>Qt::Vertical</enum>
<size> </property>
<width>20</width> <property name="sizeHint" stdset="0">
<height>40</height> <size>
</size> <width>20</width>
</property> <height>40</height>
</spacer> </size>
</item> </property>
<item> </spacer>
<widget class="QToolButton" name="delete_button"> </item>
<property name="toolTip"> <item>
<string>&lt;p&gt;Delete selected items from the database. <widget class="QToolButton" name="delete_button">
<property name="toolTip">
<string>&lt;p&gt;Delete selected items from the database.
This will unapply the items from all books and then remove them This will unapply the items from all books and then remove them
from the database. This button's shortcut is Ctrl+D&lt;/p&gt;</string> from the database. This button's shortcut is Ctrl+D&lt;/p&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>32</width> <width>32</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+D</string> <string>Ctrl+D</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="rename_button"> <widget class="QToolButton" name="rename_button">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Edit the currently selected cell. If a tag is edited then it is renamed <string>&lt;p&gt;Edit the currently selected cell. If a tag is edited then it is renamed
in every book where it is used. Double-clicking and pressing the edit in every book where it is used. Double-clicking and pressing the edit
key also work. This button's shortcut is Ctrl+E&lt;/p&gt;</string> key also work. This button's shortcut is Ctrl+E&lt;/p&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../resources/images.qrc"> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/edit_input.png</normaloff>:/images/edit_input.png</iconset> <normaloff>:/images/edit_input.png</normaloff>:/images/edit_input.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>32</width> <width>32</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+E</string> <string>Ctrl+E</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="undo_button"> <widget class="QToolButton" name="undo_button">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Undo all deletes or edits on the selected lines. <string>&lt;p&gt;Undo all deletes or edits on the selected lines.
This button's shortcut is Ctrl+U&lt;/p&gt; This button's shortcut is Ctrl+U&lt;/p&gt;
</string> </string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../resources/images.qrc"> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/edit-undo.png</normaloff>:/images/edit-undo.png</iconset> <normaloff>:/images/edit-undo.png</normaloff>:/images/edit-undo.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>32</width> <width>32</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+U</string> <string>Ctrl+U</string>
</property> </property>
</widget> </widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_4"> <widget class="QWidget" name="widget_3" native="true">
<property name="orientation"> <layout class="QVBoxLayout" name="central_layout">
<enum>Qt::Vertical</enum> <property name="leftMargin">
</property> <number>0</number>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="topMargin">
<width>20</width> <number>0</number>
<height>40</height> </property>
</size> <property name="rightMargin">
</property> <number>0</number>
</spacer> </property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0" colspan="5"> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>