Fixes #1997926 [in_tag_browser appears in Search & Replace](https://bugs.launchpad.net/calibre/+bug/1997926)
Fixes #1998036 [Enhancement Request: MDE: Option to view full datetime](https://bugs.launchpad.net/calibre/+bug/1998036)
This commit is contained in:
Kovid Goyal 2022-12-05 08:20:25 +05:30
commit e09dbe0e7a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 2 deletions

View File

@ -15,7 +15,8 @@ from qt.core import (Qt, QComboBox, QLabel, QSpinBox, QDoubleSpinBox,
QMessageBox, QToolButton, QPlainTextEdit, QApplication, QStyle, QDialog)
from calibre.ebooks.metadata import title_sort
from calibre.utils.date import qt_to_dt, now, as_local_time, as_utc, internal_iso_format_string
from calibre.utils.date import (qt_to_dt, now, as_local_time, as_utc,
internal_iso_format_string, is_date_undefined)
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, gprefs
@ -362,6 +363,14 @@ class DateTime(Base):
self.clear_button.clicked.connect(dte.set_to_clear)
self.clear_button.setToolTip(_('Clear {0}').format(self.col_metadata['name']))
l.addWidget(self.clear_button)
self.connect_data_changed(self.set_tooltip)
def set_tooltip(self, val):
if is_date_undefined(val):
self.dte.setToolTip(get_tooltip(self.col_metadata, False))
else:
self.dte.setToolTip(get_tooltip(self.col_metadata, False) + '\n' +
_('Exact time: {}').format(as_local_time(qt_to_dt(val))))
def setter(self, val):
if val is None:

View File

@ -636,7 +636,7 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
if (f in ['author_sort'] or
(fm[f]['datatype'] in ['text', 'series', 'enumeration', 'comments', 'rating'] and
fm[f].get('search_terms', None) and
f not in ['formats', 'ondevice', 'series_sort']) or
f not in ['formats', 'ondevice', 'series_sort', 'in_tag_browser']) or
(fm[f]['datatype'] in ['int', 'float', 'bool', 'datetime'] and
f not in ['id', 'timestamp'])):
self.all_fields.append(f)