mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Enhancement #1970045: is_marked() text as tooltip
This commit is contained in:
parent
3e06e32861
commit
61596cc05b
@ -1100,9 +1100,17 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
if role == Qt.ItemDataRole.DisplayRole:
|
if role == Qt.ItemDataRole.DisplayRole:
|
||||||
return (self.headers[self.column_map[section]])
|
return (self.headers[self.column_map[section]])
|
||||||
return None
|
return None
|
||||||
if DEBUG and role == Qt.ItemDataRole.ToolTipRole and orientation == Qt.Orientation.Vertical:
|
if role == Qt.ItemDataRole.ToolTipRole and orientation == Qt.Orientation.Vertical:
|
||||||
col = self.db.field_metadata['uuid']['rec_index']
|
col = self.db.field_metadata['marked']['rec_index']
|
||||||
return (_('This book\'s UUID is "{0}"').format(self.db.data[section][col]))
|
marked = self.db.data[section][col]
|
||||||
|
if marked is not None:
|
||||||
|
s = _('Marked with text "{0}"').format(marked) if marked != 'true' else _('Marked without text')
|
||||||
|
else:
|
||||||
|
s = ''
|
||||||
|
if DEBUG:
|
||||||
|
col = self.db.field_metadata['uuid']['rec_index']
|
||||||
|
s += ('\n' if s else '') + _('This book\'s UUID is "{0}"').format(self.db.data[section][col])
|
||||||
|
return s
|
||||||
|
|
||||||
if role == Qt.ItemDataRole.DisplayRole: # orientation is vertical
|
if role == Qt.ItemDataRole.DisplayRole: # orientation is vertical
|
||||||
return (section+1)
|
return (section+1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user