mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
BibTeX catalog: Add support for custom columns
This commit is contained in:
parent
24e60cc357
commit
0c685dcfe0
@ -27,14 +27,17 @@ class PluginWidget(QWidget, Ui_Form):
|
||||
def __init__(self, parent=None):
|
||||
QWidget.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
from calibre.library.catalog import FIELDS
|
||||
self.all_fields = []
|
||||
for x in FIELDS :
|
||||
if x != 'all':
|
||||
self.all_fields.append(x)
|
||||
QListWidgetItem(x, self.db_fields)
|
||||
|
||||
def initialize(self, name, db): #not working properly to update
|
||||
from calibre.library.catalog import FIELDS
|
||||
|
||||
self.all_fields = [x for x in FIELDS if x != 'all']
|
||||
#add custom columns
|
||||
self.all_fields.extend([x for x in sorted(db.custom_field_keys())])
|
||||
#populate
|
||||
for x in self.all_fields:
|
||||
QListWidgetItem(x, self.db_fields)
|
||||
|
||||
self.name = name
|
||||
fields = gprefs.get(name+'_db_fields', self.all_fields)
|
||||
# Restore the activated db_fields from last use
|
||||
|
Loading…
x
Reference in New Issue
Block a user