mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Display lookup key and description in tooltips for custom column widgets in edit metadata.
This commit is contained in:
parent
7733877cc9
commit
91d571ffc7
@ -42,6 +42,20 @@ class Base(object):
|
||||
self.initial_val = self.widgets = None
|
||||
self.signals_to_disconnect = []
|
||||
self.setup_ui(parent)
|
||||
key = db.field_metadata.label_to_key(self.col_metadata['label'],
|
||||
prefer_custom=True)
|
||||
description = self.col_metadata.get('display', {}).get('description', '')
|
||||
if description:
|
||||
description = key + ': ' + description
|
||||
else:
|
||||
description = key
|
||||
try:
|
||||
self.widgets[1].setToolTip(description)
|
||||
except:
|
||||
try:
|
||||
self.widgets[0].setToolTip(description)
|
||||
except:
|
||||
pass
|
||||
|
||||
def initialize(self, book_id):
|
||||
val = self.db.get_custom(book_id, num=self.col_id, index_is_id=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user