mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
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:
commit
e09dbe0e7a
@ -15,7 +15,8 @@ from qt.core import (Qt, QComboBox, QLabel, QSpinBox, QDoubleSpinBox,
|
|||||||
QMessageBox, QToolButton, QPlainTextEdit, QApplication, QStyle, QDialog)
|
QMessageBox, QToolButton, QPlainTextEdit, QApplication, QStyle, QDialog)
|
||||||
|
|
||||||
from calibre.ebooks.metadata import title_sort
|
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.complete2 import EditWithComplete as EWC
|
||||||
from calibre.gui2.comments_editor import Editor as CommentsEditor
|
from calibre.gui2.comments_editor import Editor as CommentsEditor
|
||||||
from calibre.gui2 import UNDEFINED_QDATETIME, error_dialog, elided_text, gprefs
|
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.clicked.connect(dte.set_to_clear)
|
||||||
self.clear_button.setToolTip(_('Clear {0}').format(self.col_metadata['name']))
|
self.clear_button.setToolTip(_('Clear {0}').format(self.col_metadata['name']))
|
||||||
l.addWidget(self.clear_button)
|
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):
|
def setter(self, val):
|
||||||
if val is None:
|
if val is None:
|
||||||
|
@ -636,7 +636,7 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
if (f in ['author_sort'] or
|
if (f in ['author_sort'] or
|
||||||
(fm[f]['datatype'] in ['text', 'series', 'enumeration', 'comments', 'rating'] and
|
(fm[f]['datatype'] in ['text', 'series', 'enumeration', 'comments', 'rating'] and
|
||||||
fm[f].get('search_terms', None) 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
|
(fm[f]['datatype'] in ['int', 'float', 'bool', 'datetime'] and
|
||||||
f not in ['id', 'timestamp'])):
|
f not in ['id', 'timestamp'])):
|
||||||
self.all_fields.append(f)
|
self.all_fields.append(f)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user