Skip to content

Commit edb024c

Browse files
committed
qtplasmac: add newlines between codes in conversational pre and postamble
1 parent 88dd541 commit edb024c

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,27 @@
2323
from shutil import copy as COPY
2424

2525
###########################################################################################################
26-
# add M52P1 to the [CONVERSATIONAL] Preamble and Postamble #
26+
# add newlines between codes [CONVERSATIONAL] Preamble and Postamble (pre V2.10-009.071 2025/08/09) #
27+
###########################################################################################################
28+
29+
30+
def add_newlines(prefs):
31+
for option in ('Preamble', 'Postamble'):
32+
value = prefs.getpref(option, '', str, 'CONVERSATIONAL')
33+
newlines = '\n'.join(value.strip().split())
34+
prefs.putpref(option, newlines, str, 'CONVERSATIONAL')
35+
with open(prefs.fn, 'w') as f:
36+
prefs.write(f)
37+
return(False, False, 'Updated to V2.10-009.071')
38+
39+
###########################################################################################################
40+
# add M52P1 to the [CONVERSATIONAL] Preamble and Postamble (pre V2.10-009.070 2025/08/07) #
2741
###########################################################################################################
2842

2943

3044
def add_adaptive(prefs):
3145
for option in ('Preamble', 'Postamble'):
32-
value = prefs.getpref(option, '', str, 'CONVERSATIONAL') or ''
46+
value = prefs.getpref(option, '', str, 'CONVERSATIONAL')
3347
if 'M52P1' not in value:
3448
prefs.putpref(option, f'{value.strip()} M52P1'.strip(), str, 'CONVERSATIONAL')
3549
with open(prefs.fn, 'w') as f:

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

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

44
'''
@@ -2594,12 +2594,18 @@ def update_check(self):
25942594
if error:
25952595
return
25962596
self.updateIni['001-017'] = mPath
2597-
# add M52P1 to the [CONVERSATIONAL] Preamble and Postamble
2597+
# add M52P1 to the [CONVERSATIONAL] Preamble and Postamble (pre V2.10-009.070 2025/08/07)
25982598
if any(self.PREFS.has_option('CONVERSATIONAL', option) and 'M52P1' not in self.PREFS.get('CONVERSATIONAL', option) for option in ('Preamble', 'Postamble')):
25992599
restart, error, text = UPDATER.add_adaptive(self.PREFS)
26002600
self.updateData.append([restart, error, text])
26012601
if error:
26022602
return
2603+
# add newlines between codes [CONVERSATIONAL] Preamble and Postamble (pre V2.10-009.071 2025/08/09)
2604+
if any(self.PREFS.has_option('CONVERSATIONAL', option) and ' ' in self.PREFS.get('CONVERSATIONAL', option) for option in ('Preamble', 'Postamble')):
2605+
restart, error, text = UPDATER.add_newlines(self.PREFS)
2606+
self.updateData.append([restart, error, text])
2607+
if error:
2608+
return
26032609

26042610
def update_iniwrite(self):
26052611
# 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 newlines between codes in conversational pre and postamble</li>
32+
2933
<br><b><u>009.070 2025 August 07</u></b>
3034
<ul style="margin:0;">
3135
<li>add M52P1 to conversational pre and postamble</li>

0 commit comments

Comments
 (0)