From ba63ef51e5ab14cef4d1a85ad2df41909c3d77af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= Date: Tue, 20 Apr 2021 14:37:53 +0200 Subject: [PATCH] Arch: Parse window opening modes with more than one digit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ɓukasz Stelmach --- src/Mod/Arch/ArchWindow.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py index 8326d1a3d6..4b9f92cdd5 100644 --- a/src/Mod/Arch/ArchWindow.py +++ b/src/Mod/Arch/ArchWindow.py @@ -632,7 +632,10 @@ class _Window(ArchComponent.Component): elif "Edge" in s: hinge = int(s[4:])-1 elif "Mode" in s: - omode = int(s[-1]) + omode = int(s[4:]) + if omode >= len(WindowOpeningModes): + # Ignore modes not listed in WindowOpeningModes + omode = None if wires: max_length = 0 for w in wires: @@ -1510,7 +1513,11 @@ class _ArchWindowTaskPanel: elif "Edge" in l: self.field6.setText(l) elif "Mode" in l: - self.field7.setCurrentIndex(int(l[-1])) + if int(l[4:]) < len(WindowOpeningModes): + self.field7.setCurrentIndex(int(l[4:])) + else: + # Ignore modes not listed in WindowOpeningModes + self.field7.setCurrentIndex(0) if wires: f.setText(",".join(wires))