mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix crash when instantiating pluginwidget multiple times
This commit is contained in:
parent
44f6c0a1f5
commit
223e115f42
@ -17,9 +17,11 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
HELP = _('Options specific to')+' CSV/XML '+_('output')
|
||||
sync_enabled = False
|
||||
|
||||
def initialize(self, name):
|
||||
QWidget.__init__(self)
|
||||
def __init__(self, parent=None):
|
||||
QWidget.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
|
||||
def initialize(self, name):
|
||||
self.name = name
|
||||
# Restore the activated fields from last use
|
||||
for x in range(self.db_fields.count()):
|
||||
|
@ -17,7 +17,6 @@ from calibre.customize.ui import catalog_plugins
|
||||
|
||||
class Catalog(QDialog, Ui_Dialog):
|
||||
''' Catalog Dialog builder'''
|
||||
widgets = []
|
||||
|
||||
def __init__(self, parent, dbspec, ids):
|
||||
import re, cStringIO
|
||||
@ -40,7 +39,7 @@ class Catalog(QDialog, Ui_Dialog):
|
||||
# GwR *** Add option tabs for built-in formats
|
||||
# This code models #69 in calibre/gui2/dialogs/config/__init__.py
|
||||
|
||||
self.fmts = []
|
||||
self.fmts, self.widgets = [], []
|
||||
|
||||
from calibre.customize.builtins import plugins as builtin_plugins
|
||||
|
||||
@ -99,7 +98,7 @@ class Catalog(QDialog, Ui_Dialog):
|
||||
else:
|
||||
info("No dynamic tab resources found for %s" % name)
|
||||
|
||||
self.widgets = sorted(self.widgets, key=lambda x:(x.TITLE, x.TITLE))
|
||||
self.widgets = sorted(self.widgets, cmp=lambda x,y:cmp(x.TITLE, y.TITLE))
|
||||
for pw in self.widgets:
|
||||
self.tabs.addTab(pw, pw.TITLE)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user