From 40726d244d56c5439685ebf60456abe64ea4fce2 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sun, 20 Dec 2020 23:09:14 -0500 Subject: [PATCH] layout_editor: don't emit changed signals while loading from kb --- src/main/python/layout_editor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/python/layout_editor.py b/src/main/python/layout_editor.py index 06b5956..96480b5 100644 --- a/src/main/python/layout_editor.py +++ b/src/main/python/layout_editor.py @@ -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()