Skip to content

Commit b90e9e4

Browse files
committed
qtplasmac: fix closing_cleanup__ not being called
1 parent 5de8e34 commit b90e9e4

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '1.229.224'
1+
VERSION = '1.229.225'
22

33
'''
44
qtplasmac_handler.py
@@ -219,8 +219,8 @@ def __init__(self, halcomp, widgets, paths):
219219
self.yMax = float(self.iniFile.find('AXIS_Y', 'MAX_LIMIT'))
220220
self.zMin = float(self.iniFile.find('AXIS_Z', 'MIN_LIMIT'))
221221
self.zMax = float(self.iniFile.find('AXIS_Z', 'MAX_LIMIT'))
222-
self.xLen = float(self.xMax - self.xMin)
223-
self.yLen = float(self.yMax - self.yMin)
222+
self.xLen = self.xMax - self.xMin
223+
self.yLen = self.yMax - self.yMin
224224
self.thcFeedRate = float(self.iniFile.find('AXIS_Z', 'MAX_VELOCITY')) * \
225225
float(self.iniFile.find('AXIS_Z', 'OFFSET_AV_RATIO')) * 60
226226
self.maxHeight = self.zMax - self.zMin
@@ -319,8 +319,6 @@ def initialized__(self):
319319
self.init_preferences()
320320
self.hide_widgets()
321321
self.init_widgets()
322-
# hijack the qtvcp shutdown to our own close event
323-
self.w.screen_options.QTVCP_INSTANCE_.closeEvent = self.closeEvent
324322
self.w.button_frame.installEventFilter(self.w)
325323
self.link_hal_pins()
326324
self.statistics_init()
@@ -2132,6 +2130,7 @@ def conv_tab_changed(self, state):
21322130
# GENERAL FUNCTIONS #
21332131
#########################################################################################################################
21342132
def closeEvent(self, event):
2133+
O = self.w.screen_options
21352134
if self.w.chk_exit_warning.isChecked() or not STATUS.is_interp_idle():
21362135
icon = QMessageBox.Question if STATUS.is_interp_idle() else QMessageBox.Critical
21372136
head = _translate('HandlerClass', 'Shutdown')
@@ -2144,9 +2143,22 @@ def closeEvent(self, event):
21442143
msg0 += '{}\n\n'.format(self.exitMessage)
21452144
msg0 += _translate('HandlerClass', 'Do you want to shutdown QtPlasmaC')
21462145
if self.dialog_show_yesno(icon, head, '\n{}?\n'.format(msg0)):
2146+
if O.PREFS_ and O.play_sounds and O.shutdown_play_sound:
2147+
STATUS.emit('play-sound', O.shutdown_exit_sound_type)
2148+
O.QTVCP_INSTANCE_.settings.sync()
2149+
O.QTVCP_INSTANCE_.shutdown()
2150+
O.QTVCP_INSTANCE_.panel_.shutdown()
2151+
STATUS.shutdown()
21472152
event.accept()
21482153
else:
21492154
event.ignore()
2155+
else:
2156+
if O.PREFS_ and O.play_sounds and O.shutdown_play_sound:
2157+
STATUS.emit('play-sound', O.shutdown_exit_sound_type)
2158+
O.QTVCP_INSTANCE_.settings.sync()
2159+
O.QTVCP_INSTANCE_.shutdown()
2160+
O.QTVCP_INSTANCE_.panel_.shutdown()
2161+
STATUS.shutdown()
21502162

21512163
def update_check(self):
21522164
# newest update must be added last in this function

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ <h2>QtPlasmaC Version History</h2>
3030
</table>
3131
<br>
3232
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
33+
<br><b><u>v1.229.225 2022 Aug 14</u></b>
34+
<ul style="margin:0;">
35+
<li>conv. use relative instead of absolute positon for origin</li>
36+
<li>fix closing_cleanup__ not being called</li>
37+
</ul>
38+
<i>Changes submitted by snowgoer540 (Greg Carl)</i><br>
39+
3340
<br><b><u>v1.229.224 2022 Aug 12</u></b>
3441
<ul style="margin:0;">
3542
<li>fix button interlocking for torch pulse and ohmic test when not homed</li>

0 commit comments

Comments
 (0)