layout_editor: don't emit changed signals while loading from kb

main
Ilya Zhuravlev 2020-12-20 23:09:14 -05:00
parent e7ca2548b8
commit 40726d244d
1 changed files with 4 additions and 3 deletions

View File

@ -102,6 +102,8 @@ class LayoutEditor(BasicEditor):
if not self.valid():
return
self.blockSignals(True)
for choice in self.choices:
choice.delete()
self.choices = []
@ -115,6 +117,8 @@ class LayoutEditor(BasicEditor):
self.unpack(self.device.keyboard.layout_options)
self.blockSignals(False)
def valid(self):
return isinstance(self.device, VialKeyboard) and "labels" in self.device.keyboard.layouts
@ -137,8 +141,5 @@ class LayoutEditor(BasicEditor):
def get_choice(self, index):
return int(self.choices[index].pack(), 2)
def set_choice(self, index, value):
self.choices[index].change(value)
def on_changed(self):
self.changed.emit()