1- VERSION = '1.229.224 '
1+ VERSION = '1.229.225 '
22
33'''
44qtplasmac_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
0 commit comments