From 94e62757b648caf46b3226636ce84cab93d8e616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Wed, 16 Oct 2019 17:28:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=B0?= =?UTF-8?q?=20=D1=82=D0=B8=D0=BF=D0=B0=20Tristate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/consolegui/application/mainframe.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pym/consolegui/application/mainframe.py b/pym/consolegui/application/mainframe.py index 4de0b71..5e2740e 100644 --- a/pym/consolegui/application/mainframe.py +++ b/pym/consolegui/application/mainframe.py @@ -2425,15 +2425,24 @@ class MainFrame(qt.QWidget): elif type(self.view_dict[field.name]) == qt.QCheckBox: if self.view_dict[field.name].isTristate(): - if self.view_dict[field.name].checkState() \ - == qt.Qt.PartiallyChecked: - param_object[paramname] = None - elif self.view_dict[field.name].checkState() \ - == qt.Qt.Checked: - param_object[paramname] = True + if field.type == "bool3": + if self.view_dict[field.name].checkState() \ + == qt.Qt.PartiallyChecked: + param_object[paramname] = "auto" + elif self.view_dict[field.name].checkState() \ + == qt.Qt.Checked: + param_object[paramname] = "on" + else: + param_object[paramname] = "off" else: - param_object[paramname] = False - + if self.view_dict[field.name].checkState() \ + == qt.Qt.PartiallyChecked: + param_object[paramname] = None + elif self.view_dict[field.name].checkState() \ + == qt.Qt.Checked: + param_object[paramname] = True + else: + param_object[paramname] = False else: param_object[paramname] = \ self.view_dict[field.name].isChecked()