@@ -248,12 +248,12 @@ def __init__(self, splash):
248
248
self .radioButton_sp .clicked .connect (self .run_sp_buttons_clicked )
249
249
self .score .setText ("0" )
250
250
self .callsign .textEdited .connect (self .callsign_changed )
251
- self .callsign .returnPressed .connect (self .save_contact )
252
- self .sent .returnPressed .connect (self .save_contact )
253
- self .receive .returnPressed .connect (self .save_contact )
254
- self .other_1 .returnPressed .connect (self .save_contact )
251
+ self .callsign .returnPressed .connect (self .check_esm )
252
+ self .sent .returnPressed .connect (self .check_esm )
253
+ self .receive .returnPressed .connect (self .check_esm )
254
+ self .other_1 .returnPressed .connect (self .check_esm )
255
255
self .other_1 .textEdited .connect (self .other_1_changed )
256
- self .other_2 .returnPressed .connect (self .save_contact )
256
+ self .other_2 .returnPressed .connect (self .check_esm )
257
257
self .other_2 .textEdited .connect (self .other_2_changed )
258
258
259
259
self .sent .setText ("59" )
@@ -665,6 +665,20 @@ def restore_button_color(self, the_button: QtWidgets.QPushButton) -> None:
665
665
"""Restores the color of the button"""
666
666
the_button .setPalette (self .current_palette )
667
667
668
+ def check_esm (self ):
669
+ """Check for ESM, otherwise save contact."""
670
+ print (f"{ self .use_esm = } " )
671
+ if self .use_esm :
672
+ print (f"{ hasattr (self .contest , "process_esm" )= } " )
673
+ if hasattr (self .contest , "process_esm" ):
674
+ print (f"{ hasattr (self .contest , "process_esm" )= } " )
675
+ self .contest .process_esm ()
676
+ else :
677
+ print ("Save contact" )
678
+ self .save_contact ()
679
+ else :
680
+ self .save_contact ()
681
+
668
682
def show_splash_msg (self , msg : str ) -> None :
669
683
"""Show text message in the splash window."""
670
684
self .splash .showMessage (
0 commit comments