layout_editor: don't emit changed signals while loading from kb
parent
e7ca2548b8
commit
40726d244d
|
|
@ -102,6 +102,8 @@ class LayoutEditor(BasicEditor):
|
||||||
if not self.valid():
|
if not self.valid():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.blockSignals(True)
|
||||||
|
|
||||||
for choice in self.choices:
|
for choice in self.choices:
|
||||||
choice.delete()
|
choice.delete()
|
||||||
self.choices = []
|
self.choices = []
|
||||||
|
|
@ -115,6 +117,8 @@ class LayoutEditor(BasicEditor):
|
||||||
|
|
||||||
self.unpack(self.device.keyboard.layout_options)
|
self.unpack(self.device.keyboard.layout_options)
|
||||||
|
|
||||||
|
self.blockSignals(False)
|
||||||
|
|
||||||
def valid(self):
|
def valid(self):
|
||||||
return isinstance(self.device, VialKeyboard) and "labels" in self.device.keyboard.layouts
|
return isinstance(self.device, VialKeyboard) and "labels" in self.device.keyboard.layouts
|
||||||
|
|
||||||
|
|
@ -137,8 +141,5 @@ class LayoutEditor(BasicEditor):
|
||||||
def get_choice(self, index):
|
def get_choice(self, index):
|
||||||
return int(self.choices[index].pack(), 2)
|
return int(self.choices[index].pack(), 2)
|
||||||
|
|
||||||
def set_choice(self, index, value):
|
|
||||||
self.choices[index].change(value)
|
|
||||||
|
|
||||||
def on_changed(self):
|
def on_changed(self):
|
||||||
self.changed.emit()
|
self.changed.emit()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue