diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py
index e9247113a0..6f90f3b479 100644
--- a/src/calibre/gui2/complete2.py
+++ b/src/calibre/gui2/complete2.py
@@ -291,6 +291,7 @@ class LineEdit(QLineEdit, LineEditECM):
def __init__(self, parent=None, completer_widget=None, sort_func=sort_key, strip_completion_entries=True):
QLineEdit.__init__(self, parent)
+ self.setClearButtonEnabled(True)
self.sep = ','
self.space_before_sep = False
@@ -480,6 +481,9 @@ class EditWithComplete(EnComboBox):
def set_elide_mode(self, val):
self.lineEdit().set_elide_mode(val)
+
+ def set_clear_button_enabled(self, val=True):
+ self.lineEdit().setClearButtonEnabled(bool(val))
# }}}
def text(self):
diff --git a/src/calibre/gui2/convert/azw3_output.ui b/src/calibre/gui2/convert/azw3_output.ui
index 6f9da8a64d..27de08ce92 100644
--- a/src/calibre/gui2/convert/azw3_output.ui
+++ b/src/calibre/gui2/convert/azw3_output.ui
@@ -35,7 +35,11 @@
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/convert/comic_input.ui b/src/calibre/gui2/convert/comic_input.ui
index 5cfc63a26c..f12065e1c1 100644
--- a/src/calibre/gui2/convert/comic_input.ui
+++ b/src/calibre/gui2/convert/comic_input.ui
@@ -7,7 +7,7 @@
0
0
599
- 415
+ 445
@@ -157,7 +157,11 @@
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/convert/epub_output.ui b/src/calibre/gui2/convert/epub_output.ui
index 4e5048006c..448c6385b8 100644
--- a/src/calibre/gui2/convert/epub_output.ui
+++ b/src/calibre/gui2/convert/epub_output.ui
@@ -116,7 +116,11 @@
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/convert/font_key.ui b/src/calibre/gui2/convert/font_key.ui
index 8fa7995c9b..bd34bdd7d0 100644
--- a/src/calibre/gui2/convert/font_key.ui
+++ b/src/calibre/gui2/convert/font_key.ui
@@ -70,7 +70,11 @@
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/convert/look_and_feel.ui b/src/calibre/gui2/convert/look_and_feel.ui
index 9039a07f21..48a49cb04d 100644
--- a/src/calibre/gui2/convert/look_and_feel.ui
+++ b/src/calibre/gui2/convert/look_and_feel.ui
@@ -466,6 +466,9 @@
Comma separated list of CSS properties to remove. For example: display, color, font-family
+
+ true
+
diff --git a/src/calibre/gui2/convert/lrf_output.ui b/src/calibre/gui2/convert/lrf_output.ui
index ff9b925fb9..7ba724ca58 100644
--- a/src/calibre/gui2/convert/lrf_output.ui
+++ b/src/calibre/gui2/convert/lrf_output.ui
@@ -135,7 +135,11 @@
-
-
+
+
+ true
+
+
@@ -176,13 +180,13 @@
-
-
+
-
-
+
-
-
+
diff --git a/src/calibre/gui2/convert/metadata.ui b/src/calibre/gui2/convert/metadata.ui
index 7f17d17950..23e8a8a3ed 100644
--- a/src/calibre/gui2/convert/metadata.ui
+++ b/src/calibre/gui2/convert/metadata.ui
@@ -138,6 +138,9 @@
Change the title of this book
+
+ true
+
-
@@ -177,6 +180,9 @@
Change the author(s) of this book. Multiple authors should be separated by a comma
+
+ true
+
-
diff --git a/src/calibre/gui2/convert/mobi_output.ui b/src/calibre/gui2/convert/mobi_output.ui
index 4c6d7074d3..93e4e6afd4 100644
--- a/src/calibre/gui2/convert/mobi_output.ui
+++ b/src/calibre/gui2/convert/mobi_output.ui
@@ -32,7 +32,11 @@
-
-
+
+
+ true
+
+
-
@@ -99,7 +103,11 @@
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/convert/pdf_output.ui b/src/calibre/gui2/convert/pdf_output.ui
index db330271f2..f0fe5a4525 100644
--- a/src/calibre/gui2/convert/pdf_output.ui
+++ b/src/calibre/gui2/convert/pdf_output.ui
@@ -54,6 +54,9 @@
0
+
+ true
+
-
@@ -109,7 +112,11 @@
-
-
+
+
+ true
+
+
-
@@ -208,7 +215,11 @@
-
-
+
+
+ true
+
+
-
@@ -247,7 +258,11 @@
-
-
+
+
+ true
+
+
-
@@ -260,7 +275,11 @@
-
-
+
+
+ true
+
+
diff --git a/src/calibre/gui2/convert/regex_builder.ui b/src/calibre/gui2/convert/regex_builder.ui
index 35863c0480..0441e40357 100644
--- a/src/calibre/gui2/convert/regex_builder.ui
+++ b/src/calibre/gui2/convert/regex_builder.ui
@@ -26,7 +26,11 @@
-
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/convert/search_and_replace.ui b/src/calibre/gui2/convert/search_and_replace.ui
index 8af21120c1..07607b4710 100644
--- a/src/calibre/gui2/convert/search_and_replace.ui
+++ b/src/calibre/gui2/convert/search_and_replace.ui
@@ -72,6 +72,9 @@
0
+
+ true
+
@@ -80,7 +83,7 @@
-
- -1
+ 6
0
@@ -146,94 +149,94 @@
-
-
- false
-
-
- Save this list of expressions so that you can re-use it easily
-
-
- &Save
-
+
+ false
+
+
+ Save this list of expressions so that you can re-use it easily
+
+
+ &Save
+
-
-
-
- -1
-
-
- 0
-
-
-
-
-
- QAbstractItemView::SingleSelection
-
-
- QAbstractItemView::SelectRows
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 32
- 16777215
-
-
-
- false
-
-
- Move expression up.
-
-
-
- :/images/arrow-up.png:/images/arrow-up.png
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 32
- 16777215
-
-
-
- false
-
-
- Move expression down.
-
-
-
- :/images/arrow-down.png:/images/arrow-down.png
-
-
-
-
-
-
+
+
+ 6
+
+
+ 0
+
+ -
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+
+ -
+
+
-
+
+
+ false
+
+
+
+ 0
+ 0
+
+
+
+
+ 32
+ 16777215
+
+
+
+ Move expression up.
+
+
+
+ :/images/arrow-up.png:/images/arrow-up.png
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+ 0
+
+
+
+
+ 32
+ 16777215
+
+
+
+ Move expression down.
+
+
+
+ :/images/arrow-down.png:/images/arrow-down.png
+
+
+
+
+
+
-
diff --git a/src/calibre/gui2/convert/toc.ui b/src/calibre/gui2/convert/toc.ui
index e97cd910ab..2eb07e862c 100644
--- a/src/calibre/gui2/convert/toc.ui
+++ b/src/calibre/gui2/convert/toc.ui
@@ -99,7 +99,11 @@
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/convert/xpath_wizard.ui b/src/calibre/gui2/convert/xpath_wizard.ui
index c9cf00498d..d7c7f7a89b 100644
--- a/src/calibre/gui2/convert/xpath_wizard.ui
+++ b/src/calibre/gui2/convert/xpath_wizard.ui
@@ -122,7 +122,11 @@
-
-
+
+
+ true
+
+
-
diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py
index f03bb22e49..bcdf4f714f 100644
--- a/src/calibre/gui2/custom_column_widgets.py
+++ b/src/calibre/gui2/custom_column_widgets.py
@@ -15,7 +15,7 @@ from qt.core import (Qt, QComboBox, QLabel, QSpinBox, QDoubleSpinBox,
QMessageBox, QToolButton, QPlainTextEdit, QApplication, QStyle, QDialog)
from calibre.utils.date import qt_to_dt, now, as_local_time, as_utc, internal_iso_format_string
-from calibre.gui2.complete2 import EditWithComplete
+from calibre.gui2.complete2 import EditWithComplete as EWC
from calibre.gui2.comments_editor import Editor as CommentsEditor
from calibre.gui2 import UNDEFINED_QDATETIME, error_dialog, elided_text
from calibre.gui2.dialogs.tag_editor import TagEditor
@@ -27,6 +27,13 @@ from calibre.gui2.widgets2 import RatingEditor, DateTimeEdit as DateTimeEditBase
from polyglot.builtins import unicode_type
+class EditWithComplete(EWC):
+
+ def __init__(self, *a, **kw):
+ super().__init__(*a, **kw)
+ self.set_clear_button_enabled(False)
+
+
def safe_disconnect(signal):
try:
signal.disconnect()
diff --git a/src/calibre/gui2/dialogs/metadata_bulk.ui b/src/calibre/gui2/dialogs/metadata_bulk.ui
index cf8bb6a538..898bba3d29 100644
--- a/src/calibre/gui2/dialogs/metadata_bulk.ui
+++ b/src/calibre/gui2/dialogs/metadata_bulk.ui
@@ -107,6 +107,9 @@
Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles.
+
+ true
+
-
diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py
index 32a2dc6a1d..ba59876dc3 100644
--- a/src/calibre/gui2/metadata/basic_widgets.py
+++ b/src/calibre/gui2/metadata/basic_widgets.py
@@ -341,6 +341,7 @@ class AuthorsEdit(EditWithComplete, ToMetadataMixin):
self.dialog = parent
self.books_to_refresh = set()
EditWithComplete.__init__(self, parent)
+ self.set_clear_button_enabled(False)
self.setToolTip(self.TOOLTIP)
self.setWhatsThis(self.TOOLTIP)
self.setEditable(True)
@@ -598,6 +599,7 @@ class SeriesEdit(EditWithComplete, ToMetadataMixin):
def __init__(self, parent):
EditWithComplete.__init__(self, parent)
+ self.set_clear_button_enabled(False)
self.set_separator(None)
self.dialog = parent
self.setSizeAdjustPolicy(
@@ -1379,6 +1381,7 @@ class TagsEdit(EditWithComplete, ToMetadataMixin): # {{{
def __init__(self, parent):
EditWithComplete.__init__(self, parent)
+ self.set_clear_button_enabled(False)
self.set_elide_mode(Qt.TextElideMode.ElideMiddle)
self.currentTextChanged.connect(self.data_changed)
self.lineEdit().setMaxLength(655360) # see https://bugs.launchpad.net/bugs/1630944
@@ -1462,6 +1465,7 @@ class LanguagesEdit(LE, ToMetadataMixin): # {{{
def __init__(self, *args, **kwargs):
LE.__init__(self, *args, **kwargs)
+ self.set_clear_button_enabled(False)
self.textChanged.connect(self.data_changed)
self.setToolTip(self.TOOLTIP)
@@ -1779,6 +1783,7 @@ class PublisherEdit(EditWithComplete, ToMetadataMixin): # {{{
def __init__(self, parent):
EditWithComplete.__init__(self, parent)
+ self.set_clear_button_enabled(False)
self.currentTextChanged.connect(self.data_changed)
self.set_separator(None)
self.setSizeAdjustPolicy(