88from tkinter import messagebox
99from AdWMFuncLib .Systemrepair import *
1010from AdWMFuncLib .Systemclean import *
11+ from tkinter import font
12+
13+ def get_input ():
14+ user_input = str (private_time_input .get ("1.0" , "end-1c" ))
15+ print (user_input )
16+ os .system ("cmd.exe /c shutdown -s -t {0}" . format (user_input ))
17+
18+ def shutdownpc (second ):
19+ os .system ("cmd.exe /c shutdown -s -t {0}" . format (second ))
20+ print (second )
1121
1222def ShutdownPC ():
23+ global private_time_input
1324 if messagebox .askyesno (adwmgui_txt_title , shutdownpc_askyesno_txt_title ) == True :
14- userTime = str (input (usertm_title ))
15- os .system ("cmd.exe /c shutdown -s -t {0}" . format (userTime ))
25+ window = Tk ()
26+ window .title (shutdownpc_title )
27+ window .geometry ("500x500" )
28+ window .resizable (FALSE ,FALSE )
29+ quick_access = Label (window , text = quick_access_title , font = ("Arial" ,12 ,"bold" ), anchor = "w" , justify = LEFT )
30+ quick_access .pack (fill = "x" , anchor = "w" )
31+ zero_second = Button (window , text = "0" , width = 10 , command = lambda : shutdownpc (0 ))
32+ zero_second .place (x = 5 , y = 35 )
33+ five_second = Button (window , text = "5" , width = 10 , command = lambda : shutdownpc (5 ))
34+ five_second .place (x = 85 , y = 35 )
35+ ten_second = Button (window , text = "10" , width = 10 , command = lambda : shutdownpc (10 ))
36+ ten_second .place (x = 165 , y = 35 )
37+ fifteen_second = Button (window , text = "15" , width = 10 , command = lambda : shutdownpc (15 ))
38+ fifteen_second .place (x = 245 , y = 35 )
39+ twenty_second = Button (window , text = "20" , width = 10 , command = lambda : shutdownpc (20 ))
40+ twenty_second .place (x = 325 , y = 35 )
41+ twentyfive_second = Button (window , text = "25" , width = 10 , command = lambda : shutdownpc (25 ))
42+ twentyfive_second .place (x = 405 , y = 35 )
43+ thirty_second = Button (window , text = "30" , width = 10 , command = lambda : shutdownpc (30 ))
44+ thirty_second .place (x = 5 , y = 70 )
45+ thirtyfive_second = Button (window , text = "35" , width = 10 , command = lambda : shutdownpc (35 ))
46+ thirtyfive_second .place (x = 85 , y = 70 )
47+ fourty_second = Button (window , text = "40" , width = 10 , command = lambda : shutdownpc (40 ))
48+ fourty_second .place (x = 165 , y = 70 )
49+ fourtyfive_second = Button (window , text = "45" , width = 10 , command = lambda : shutdownpc (45 ))
50+ fourtyfive_second .place (x = 245 , y = 70 )
51+ fifty_second = Button (window , text = "50" , width = 10 , command = lambda : shutdownpc (50 ))
52+ fifty_second .place (x = 325 , y = 70 )
53+ fiftyfive_second = Button (window , text = "55" , width = 10 , command = lambda : shutdownpc (55 ))
54+ fiftyfive_second .place (x = 405 , y = 70 )
55+ sixty_second = Button (window , text = "60" , width = 10 , command = lambda : shutdownpc (60 ))
56+ sixty_second .place (x = 5 , y = 105 )
57+ private_time = Label (window , text = private_time_title , font = ("Arial" ,12 ,"bold" ), anchor = "w" , justify = LEFT )
58+ private_time .place (y = 140 )
59+ private_time_input = Text (window , width = 15 , height = 1 )
60+ private_time_input .place (x = 5 , y = 170 )
61+ private_time_button = Button (window , text = private_time_button_title , width = 13 , command = get_input )
62+ private_time_button .place (x = 135 , y = 170 )
63+ all_operations_shutdownpc = Label (window , text = all_operations_shutdownpc_title_ , font = ("Arial" ,12 ,"bold" ), anchor = "w" , justify = LEFT )
64+ all_operations_shutdownpc .place (y = 200 )
65+ all_operations_shutdownpc_button = Button (window , text = all_operations_shutdownpc_title , command = all_operations_ShutdownPC )
66+ all_operations_shutdownpc_button .place (x = 5 , y = 230 )
67+ window .mainloop ()
1668 else :
1769 print (shutdownpc_askyesno_cancel_txt_title )
1870
@@ -25,6 +77,6 @@ def all_operations_ShutdownPC():
2577 time (0.5 )
2678 RepairSystem ()
2779 time (0.5 )
28- ShutdownPC ( )
80+ shutdownpc ( 0 )
2981 else :
3082 print (shutdownpc_askyesno_cancel_txt_title )
0 commit comments