@@ -206,6 +206,12 @@ def click_handler (self, callback):
206206 worker .signals .error .connect (self .handle_exception )
207207 self .thread_manager .start (worker )
208208
209+ def send_notification (self , title : str , body : str ) -> None :
210+ try :
211+ notification .notify (title = title , message = body )
212+ except Exception as e :
213+ print ('[.] Non-critical: Exception while trying to send a notification: {}' .format (str (e )))
214+
209215 def handler_select_file_reading (self ):
210216 filename = QFileDialog ().getSaveFileName ()[0 ]
211217 self .readingFileInput .setText (filename )
@@ -414,7 +420,7 @@ def gui_read_eeprom (self, ecu: ECU, address_start: int = 0x000000, address_stop
414420 log_callback .emit ('[*] saved to {}' .format (home + "/" + output_filename ))
415421
416422 log_callback .emit ('[*] Done!' )
417- notification . notify ( title = 'Reading finished' , message = 'Saved to {}' .format (home + "\\ " + output_filename ))
423+ self . send_notification ( 'Reading finished' , 'Saved to {}' .format (home + "\\ " + output_filename ))
418424
419425 def gui_flash_eeprom (self , ecu : ECU , input_filename : str , flash_calibration : bool = True , flash_program : bool = True , log_callback = None , progress_callback = None ):
420426 log_callback .emit ('[*] Loading up {}' .format (input_filename ))
@@ -480,7 +486,7 @@ def gui_flash_eeprom (self, ecu: ECU, input_filename: str, flash_calibration: bo
480486 progress_callback (100 , 100 )
481487 log_callback .emit ('[*] ecu reset' )
482488 log_callback .emit ('[*] Done!' )
483- notification . notify ( title = 'Flashing finished' , message = 'Turn off your ignition for 10 seconds' )
489+ self . send_notification ( 'Flashing finished' , 'Turn off your ignition for 10 seconds' )
484490
485491 ecu .bus .transport .hardware .set_timeout (0.5 )
486492 try :
0 commit comments