Skip to content

Commit 906dc94

Browse files
committed
qtplasmac: squish some conversational block bugs
remove material drop down from conversation block in all instances leave conversational block if new or clear was clicked
1 parent eedf9d3 commit 906dc94

3 files changed

Lines changed: 26 additions & 13 deletions

File tree

lib/python/qtvcp/lib/qtplasmac/conversational.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
conversational.py
33
44
Copyright (C) 2019 - 2024 Phillip A Carter
5-
Copyright (C) 2020 - 2024 Gregory D Carl
5+
Copyright (C) 2020 - 2025 Gregory D Carl
66
77
This program is free software; you can redistribute it and/or modify it
88
under the terms of the GNU General Public License as published by the
@@ -87,18 +87,22 @@ def conv_setup(P, W):
8787
P.ySaved = '0.000'
8888
P.convBlock = [False, False]
8989
if not P.oldConvButton:
90-
conv_shape_request(P, W, 'conv_line', True)
90+
conv_shape_request(P, W, 'conv_line')
9191
else:
92-
conv_shape_request(P, W, P.oldConvButton, True)
92+
conv_shape_request(P, W, P.oldConvButton)
9393

9494

9595
def conv_new_pressed(P, W, button):
96-
if button and (W.conv_save.isEnabled() or W.conv_send.isEnabled() or P.convPreviewActive):
96+
if button and (W.conv_save.isEnabled() or W.conv_send.isEnabled() or P.convPreviewActive or P.oldConvButton == 'conv_block'):
9797
head = _translate('HandlerClass', 'Unsaved Shape')
9898
btn1 = _translate('HandlerClass', 'CONTINUE')
9999
btn2 = _translate('HandlerClass', 'CANCEL')
100-
msg0 = _translate('HandlerClass', 'You have an unsaved, unsent, or active previewed shape')
101-
msg1 = _translate('HandlerClass', 'If you continue it will be deleted')
100+
if P.oldConvButton == 'conv_block':
101+
msg0 = _translate('HandlerClass', 'A loaded file from the MAIN tab is being previewed')
102+
msg1 = _translate('HandlerClass', 'If you continue it will be removed from the Conversational preview')
103+
else:
104+
msg0 = _translate('HandlerClass', 'You have an unsaved, unsent, or active previewed shape')
105+
msg1 = _translate('HandlerClass', 'If you continue it will be deleted')
102106
if not P.dialog_show_yesno(QMessageBox.Warning, f'{head}', f'{msg0}\n\n{msg1}\n', f'{btn1}', f'{btn2}'):
103107
return
104108
if P.oldConvButton == 'conv_line':
@@ -124,6 +128,8 @@ def conv_new_pressed(P, W, button):
124128
P.validShape = False
125129
conv_preview_button(P, W, False)
126130
conv_enable_tabs(P, W)
131+
if P.oldConvButton == 'conv_block':
132+
conv_shape_request(P, W, 'conv_line')
127133

128134

129135
def conv_save_pressed(P, W):
@@ -152,6 +158,7 @@ def conv_save_pressed(P, W):
152158

153159

154160
def conv_settings_pressed(P, W):
161+
W.conv_material.hide()
155162
P.color_item(P.oldConvButton, P.foreColor, 'button')
156163
W[P.oldConvButton].setStyleSheet(f'QPushButton {{ background: {P.backColor} }} \
157164
QPushButton:pressed {{ background: {P.backColor} }}')
@@ -193,10 +200,10 @@ def conv_block_pressed(P, W):
193200
# return
194201
elif 'M3' in line or 'm3' in line:
195202
break
196-
conv_shape_request(P, W, W.sender().objectName(), False)
203+
conv_shape_request(P, W, W.sender().objectName())
197204

198205

199-
def conv_shape_request(P, W, shape, material):
206+
def conv_shape_request(P, W, shape):
200207
if shape == 'conv_line':
201208
module = CONVLINE
202209
elif shape == 'conv_circle':
@@ -229,10 +236,10 @@ def conv_shape_request(P, W, shape, material):
229236
if P.convPreviewActive and not conv_active_shape(P, W):
230237
return
231238
conv_preview_button(P, W, False)
232-
if material:
233-
W.conv_material.show()
234-
else:
239+
if shape == 'conv_block':
235240
W.conv_material.hide()
241+
else:
242+
W.conv_material.show()
236243
# we use exception handlers here as there may be no signals connected
237244
try:
238245
W.conv_material.currentTextChanged.disconnect()

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '008.063'
1+
VERSION = '008.064'
22
LCNCVER = '2.10'
33

44
'''
@@ -3184,7 +3184,7 @@ def conv_call(self, operation):
31843184
elif operation == 'send':
31853185
self.CONV.conv_send_pressed(self, self.w)
31863186
else:
3187-
self.CONV.conv_shape_request(self, self.w, f'conv_{operation}', True)
3187+
self.CONV.conv_shape_request(self, self.w, f'conv_{operation}')
31883188

31893189
def set_axes_and_joints(self):
31903190
self.coordinates = 'xyz' # backup in case we cannot find valid coordinates

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ <h2>QtPlasmaC Version History - LinuxCNC 2.10</h2>
2626
</table>
2727
<br>
2828
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
29+
<br><b><u>008.064 2025 May 18</u></b>
30+
<ul style="margin:0;">
31+
<li>remove material drop down from conversation block in all instances</li>
32+
<li>leave conversational block if new or clear was clicked</li>
33+
</ul>
34+
2935
<br><b><u>008.063 2025 May 02</u></b>
3036
<ul style="margin:0;">
3137
<li>remove gcodegraphics patch</li>

0 commit comments

Comments
 (0)