From 2656c7f248613383c0653087da4cf3e090c65000 Mon Sep 17 00:00:00 2001 From: Greg Carl <26096779+snowgoer540@users.noreply.github.com> Date: Sun, 27 Sep 2026 12:25:41 -0400 Subject: [PATCH] qtplasmac: fix dual-code button's optional inidicator Previously this used "setCheckable", but user button actions are based on "pressed" and "released", and checkable works from "clicked". Since the GUI was also toggling setChecked, it created a race. Allowing qt to determine whether or not it was to be checked or not also did not work reliably. Changed to manually handling the button's sytling which is congruent with what is done elsewhere in the GUI very reliably. --- .../screens/qtplasmac/qtplasmac_handler.py | 23 ++++++++++--------- share/qtvcp/screens/qtplasmac/versions.html | 7 ++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py b/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py index 9ca14058a9a..8a3672d9b3c 100644 --- a/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py +++ b/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py @@ -1,4 +1,4 @@ -VERSION = '016.089' +VERSION = '016.090' LCNCVER = '2.10' ''' @@ -3907,7 +3907,7 @@ def user_button_setup(self): 'probe-test', 'single-cut', 'torch-pulse', 'user-manual', 'latest-file', 'toggle-joint'] head = _translate('HandlerClass', 'User Button Error') for bNum in range(1, 21): - self.w[f'button_{bNum}'].setCheckable(False) + self.w[f'button_{bNum}'].setStyleSheet('') bName = self.PREFS.getpref(f'{bNum} Name', '', str, 'BUTTONS') or None bCode = self.PREFS.getpref(f'{bNum} Code', '', str, 'BUTTONS') or None if bName or bCode: @@ -4136,7 +4136,7 @@ def user_button_setup(self): self.interlockRules[self.jtButton] = self.interlockRules['toggle-joint_template'].copy() else: if 'dual-code' in bCode: - # incoming code is: "dual-code" ;; code1 ;; label1 ;; code2 ;; checked (optional = true) + # incoming code is: "dual-code" ;; code1 ;; label1 ;; code2 ;; indicator (optional = true) data = bCode.split(';;') if len(data) not in [4, 5]: head = _translate('HandlerClass', 'User Button Error') @@ -4146,12 +4146,11 @@ def user_button_setup(self): continue else: if len(data) == 5 and data[4].strip().lower() == 'true': - self.w[f'button_{bNum}'].setCheckable(True) - checked = True + indicator = True else: - checked = True - self.dualCodeButtons[bNum] = [data[1], data[2], data[3], bLabel, checked] - # dualCodeButtons format is: code1 ;; label1 ;; code2 ;; label2 ;; checked + indicator = False + self.dualCodeButtons[bNum] = [data[1], data[2], data[3], bLabel, indicator] + # dualCodeButtons format is: code1 ;; label1 ;; code2 ;; label2 ;; indicator self.interlockRules[f'button_{bNum}'] = self.interlockRules['dual-code_template'].copy() commands = f'{data[1]}\\{data[3]}' else: @@ -4293,15 +4292,17 @@ def user_button_down(self, bNum): else: self.reloadRequired = False if bCode.lower().startswith('dual-code'): - # dualCodeButtons format is: code1 ;; label1 ;; code2 ;; label2 ;; checked + # dualCodeButtons format is: code1 ;; label1 ;; code2 ;; label2 ;; indicator if self.w[f'button_{bNum}'].text() == self.dualCodeButtons[bNum][3]: bCode = self.dualCodeButtons[bNum][0] self.w[f'button_{bNum}'].setText(self.dualCodeButtons[bNum][1]) - self.w[f'button_{bNum}'].setChecked(True) + if self.dualCodeButtons[bNum][4]: + self.button_active(f'button_{bNum}') else: bCode = self.dualCodeButtons[bNum][2] self.w[f'button_{bNum}'].setText(self.dualCodeButtons[bNum][3]) - self.w[f'button_{bNum}'].setChecked(False) + if self.dualCodeButtons[bNum][4]: + self.button_normal(f'button_{bNum}') for command in bCode.split('\\'): command = command.strip() self.user_button_command(bNum, command) diff --git a/share/qtvcp/screens/qtplasmac/versions.html b/share/qtvcp/screens/qtplasmac/versions.html index 468bd58606e..1b8b361f964 100644 --- a/share/qtvcp/screens/qtplasmac/versions.html +++ b/share/qtvcp/screens/qtplasmac/versions.html @@ -26,6 +26,13 @@

QtPlasmaC Version History - LinuxCNC 2.10


+
016.090 2026 Sep 27 + +
016.089 2026 Sep 22