@@ -597,8 +597,23 @@ def save_recording(self):
597
597
if not self .recorder .events :
598
598
messagebox .showwarning ("Warning" , "No events to save. Please record actions first." )
599
599
return
600
+
601
+ # Temporarily stop hotkey listeners
602
+ if hasattr (self , 'stop_listener' ) and self .stop_listener and hasattr (self .stop_listener , 'listener' ):
603
+ self .stop_listener .listener .stop ()
604
+ if hasattr (self , 'start_listener' ) and self .start_listener and hasattr (self .start_listener , 'listener' ):
605
+ self .start_listener .listener .stop ()
606
+
600
607
# Prompt user for a recording name
601
608
name = simpledialog .askstring ("Save Recording" , "Enter a name for the recording:" )
609
+
610
+ # Restart hotkey listeners
611
+ if not self .recorder .recording and not (self .player and self .player .playing ):
612
+ # Only restart listeners if we're not recording or playing
613
+ self .stop_listener = HotkeyListener (self .stop_current_action , STOP_HOTKEY )
614
+ START_HOTKEY = {KeyCode .from_char ('r' )}
615
+ self .start_listener = HotkeyListener (self .start_recording_if_idle , START_HOTKEY )
616
+
602
617
if name :
603
618
# Sanitize and check for duplicates
604
619
safe_name = "" .join ([c for c in name if c .isalpha () or c .isdigit () or c in (' ' , '_' , '-' )]).rstrip ()
@@ -782,56 +797,68 @@ def show_disclaimer(self):
782
797
"""Show the disclaimer window if not already agreed."""
783
798
disclaimer_window = tk .Toplevel (self )
784
799
disclaimer_window .title ("Disclaimer - AutoWiz" )
785
- disclaimer_window .geometry ("600x400" )
800
+ disclaimer_window .geometry ("700x500" ) # Increased size
786
801
disclaimer_window .configure (bg = "#ffffff" )
787
802
disclaimer_window .transient (self ) # Set to be on top of the main window
788
803
disclaimer_window .grab_set () # Make it modal
789
- self .center_child_window (disclaimer_window , 600 , 400 )
804
+ self .center_child_window (disclaimer_window , 700 , 500 )
790
805
791
- # Use a professional font
792
- header_font = font . Font ( family = "Helvetica " , size = 16 , weight = "bold" )
793
- text_font = font . Font ( family = "Helvetica " , size = 10 )
806
+ # Create main content frame with padding
807
+ content_frame = tk . Frame ( disclaimer_window , bg = "#ffffff " , padx = 40 , pady = 30 )
808
+ content_frame . pack ( fill = "both " , expand = True )
794
809
795
810
# Header
796
- disclaimer_label = tk .Label (disclaimer_window , text = "Disclaimer" , font = header_font , bg = "#ffffff" , fg = "#333333" )
797
- disclaimer_label .pack (pady = (20 , 10 ))
811
+ header_font = font .Font (family = "Helvetica" , size = 18 , weight = "bold" )
812
+ disclaimer_label = tk .Label (content_frame , text = "Disclaimer" , font = header_font , bg = "#ffffff" , fg = "#333333" )
813
+ disclaimer_label .pack (pady = (0 , 20 ))
798
814
799
815
# Disclaimer Text
816
+ text_font = font .Font (family = "Helvetica" , size = 11 )
800
817
disclaimer_text = (
801
818
"By using AutoWiz, you agree to the following terms:\n \n "
802
- "1. Responsibility: You are solely responsible for how you use this tool.\n "
803
- "2. Compliance: Ensure that your use of AutoWiz complies with all applicable laws and regulations.\n "
804
- "3. Ethical Use: Do not use AutoWiz for malicious purposes, such as automating actions to deceive or harm others.\n "
819
+ "1. Responsibility: You are solely responsible for how you use this tool.\n \n "
820
+ "2. Compliance: Ensure that your use of AutoWiz complies with all applicable laws and regulations.\n \n "
821
+ "3. Ethical Use: Do not use AutoWiz for malicious purposes, such as automating actions to deceive or harm others.\n \n "
805
822
"4. Permissions: Ensure that AutoWiz has the necessary permissions to control your keyboard and mouse.\n \n "
806
823
"Do you agree to these terms?"
807
824
)
808
- disclaimer_label = tk .Label (disclaimer_window , text = disclaimer_text , justify = "left" , bg = "#ffffff" , fg = "#333333" , font = text_font , wraplength = 560 )
809
- disclaimer_label .pack (padx = 30 , pady = (0 , 20 ))
825
+
826
+ # Create Text widget for better text display
827
+ text_widget = tk .Text (content_frame , wrap = "word" , bg = "#ffffff" , fg = "#333333" ,
828
+ font = text_font , width = 50 , height = 12 , relief = "flat" ,
829
+ padx = 20 , pady = 20 )
830
+ text_widget .insert ("1.0" , disclaimer_text )
831
+ text_widget .configure (state = "disabled" ) # Make text read-only
832
+ text_widget .pack (fill = "both" , expand = True , pady = (0 , 20 ))
810
833
811
- # Buttons
812
- button_frame = tk .Frame (disclaimer_window , bg = "#ffffff" )
813
- button_frame .pack (pady = 10 )
834
+ # Buttons frame with padding
835
+ button_frame = tk .Frame (content_frame , bg = "#ffffff" )
836
+ button_frame .pack (pady = ( 0 , 20 ) )
814
837
838
+ # Style buttons
839
+ button_font = font .Font (family = "Helvetica" , size = 10 , weight = "bold" )
815
840
agree_button = tk .Button (
816
841
button_frame ,
817
- text = "Agree" ,
842
+ text = "I Agree" ,
818
843
command = lambda : self .agree_disclaimer (disclaimer_window ),
819
- width = 12 ,
844
+ width = 15 ,
845
+ height = 2 ,
820
846
bg = "#4CAF50" ,
821
847
fg = "white" ,
822
- font = ( "Helvetica" , 10 , "bold" ) ,
848
+ font = button_font ,
823
849
cursor = "hand2"
824
850
)
825
851
agree_button .pack (side = "left" , padx = 20 )
826
852
827
853
decline_button = tk .Button (
828
854
button_frame ,
829
- text = "Decline" ,
855
+ text = "I Decline" ,
830
856
command = self .decline_disclaimer ,
831
- width = 12 ,
857
+ width = 15 ,
858
+ height = 2 ,
832
859
bg = "#f44336" ,
833
860
fg = "white" ,
834
- font = ( "Helvetica" , 10 , "bold" ) ,
861
+ font = button_font ,
835
862
cursor = "hand2"
836
863
)
837
864
decline_button .pack (side = "left" , padx = 20 )
0 commit comments