mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression caused by enum clear fix
This commit is contained in:
parent
5c2829f5d9
commit
fcbfbc8007
@ -786,9 +786,9 @@ class Enumeration(Base):
|
|||||||
w = MultipleWidget(parent, only_manage_items=True, widget=QComboBox, name=self.col_metadata['name'])
|
w = MultipleWidget(parent, only_manage_items=True, widget=QComboBox, name=self.col_metadata['name'])
|
||||||
w.get_editor_button().clicked.connect(self.edit)
|
w.get_editor_button().clicked.connect(self.edit)
|
||||||
w.setSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
w.setSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
||||||
self.editor = w.edit_widget
|
|
||||||
self.widgets = [QLabel(label_string(self.col_metadata['name']), parent)]
|
self.widgets = [QLabel(label_string(self.col_metadata['name']), parent)]
|
||||||
self.finish_ui_setup(parent, lambda parent: w)
|
self.finish_ui_setup(parent, lambda parent: w)
|
||||||
|
self.editor = w.edit_widget
|
||||||
vals = self.col_metadata['display']['enum_values']
|
vals = self.col_metadata['display']['enum_values']
|
||||||
self.editor.addItem('')
|
self.editor.addItem('')
|
||||||
for v in vals:
|
for v in vals:
|
||||||
@ -830,6 +830,7 @@ class Enumeration(Base):
|
|||||||
self.editor.setCurrentIndex(0)
|
self.editor.setCurrentIndex(0)
|
||||||
|
|
||||||
def connect_data_changed(self, slot):
|
def connect_data_changed(self, slot):
|
||||||
|
print(1111111111, self.editor)
|
||||||
self.editor.currentIndexChanged.connect(slot)
|
self.editor.currentIndexChanged.connect(slot)
|
||||||
self.signals_to_disconnect.append(self.editor.currentIndexChanged)
|
self.signals_to_disconnect.append(self.editor.currentIndexChanged)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user