Skip to content

Commit 2a333b1

Browse files
committed
qtplasmac: add M52P1 to conversational pre and postamble
1 parent 628c8c0 commit 2a333b1

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

lib/python/qtvcp/lib/qtplasmac/updater.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
import os
2323
from shutil import copy as COPY
2424

25+
###########################################################################################################
26+
# add M52P1 to the [CONVERSATIONAL] Preamble and Postamble #
27+
###########################################################################################################
28+
29+
30+
def add_adaptive(prefs):
31+
for option in ('Preamble', 'Postamble'):
32+
value = prefs.getpref(option, '', str, 'CONVERSATIONAL') or ''
33+
if 'M52P1' not in value:
34+
prefs.putpref(option, f'{value.strip()} M52P1'.strip(), str, 'CONVERSATIONAL')
35+
with open(prefs.fn, 'w') as f:
36+
prefs.write(f)
37+
return(False, False, 'Updated to V2.10-009.070')
38+
2539
###########################################################################################################
2640
# helper function to expand ini file if #INCLUDE is used in the ini file #
2741
###########################################################################################################

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '009.069'
1+
VERSION = '009.070'
22
LCNCVER = '2.10'
33

44
'''
@@ -2594,6 +2594,12 @@ def update_check(self):
25942594
if error:
25952595
return
25962596
self.updateIni['001-017'] = mPath
2597+
# add M52P1 to the [CONVERSATIONAL] Preamble and Postamble
2598+
if any(self.PREFS.has_option('CONVERSATIONAL', option) and 'M52P1' not in self.PREFS.get('CONVERSATIONAL', option) for option in ('Preamble', 'Postamble')):
2599+
restart, error, text = UPDATER.add_adaptive(self.PREFS)
2600+
self.updateData.append([restart, error, text])
2601+
if error:
2602+
return
25972603

25982604
def update_iniwrite(self):
25992605
# this is for updates that write to the INI file

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ <h2>QtPlasmaC Version History - LinuxCNC 2.10</h2>
2626
</table>
2727
<br>
2828
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
29+
<br><b><u>009.070 2025 August 07</u></b>
30+
<ul style="margin:0;">
31+
<li>add M52P1 to conversational pre and postamble</li>
32+
2933
<br><b><u>009.069 2025 July 28</u></b>
3034
<ul style="margin:0;">
3135
<li>enhance cutcritical dialog with checkboxes for each untoggled button</li>

0 commit comments

Comments
 (0)