|
5 | 5 | Bu Yazılımın Bir Kopyası GitHub da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/AdWMGUI
|
6 | 6 | A Copy of This Software is published on GitHub To view: https://github.com/LinuxUsersLinuxMint/AdWMGUI """
|
7 | 7 |
|
| 8 | +import os |
8 | 9 | from tkinter import messagebox
|
9 | 10 | from AdWMFuncLib.Systemrepair import *
|
10 | 11 | from AdWMFuncLib.Systemclean import *
|
11 | 12 | from tkinter import font
|
| 13 | +from Theme.theme import * |
12 | 14 |
|
13 | 15 | def get_input():
|
14 | 16 | 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 | + shutdownpc(user_input) |
17 | 18 |
|
18 | 19 | def shutdownpc(second):
|
19 | 20 | os.system("cmd.exe /c shutdown -s -t {0}". format(second))
|
20 |
| - print(second) |
| 21 | + |
| 22 | +resx = config['ShutdownPC']['xsupportforresizability'] |
| 23 | +resy = config['ShutdownPC']['ysupportforresizability'] |
| 24 | + |
| 25 | +def close(event=None): |
| 26 | + window.destroy() |
21 | 27 |
|
22 | 28 | def ShutdownPC():
|
| 29 | + global window |
23 | 30 | global private_time_input
|
24 | 31 | if messagebox.askyesno(adwmgui_txt_title, shutdownpc_askyesno_txt_title) == True:
|
25 | 32 | window = Tk()
|
26 | 33 | window.title(shutdownpc_title)
|
27 | 34 | 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) |
| 35 | + window.resizable(resx,resy) |
| 36 | + window.configure(bg=window_bg) |
| 37 | + quick_access = Label(window, text=quick_access_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT, bg=label_bg, fg=label_fg) |
30 | 38 | quick_access.pack(fill="x", anchor="w")
|
31 |
| - zero_second = Button(window, text="0", width=10, command=lambda: shutdownpc(0)) |
| 39 | + zero_second = Button(window, text="0", width=10, command=lambda: shutdownpc(0), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
32 | 40 | zero_second.place(x=5, y=35)
|
33 |
| - five_second = Button(window, text="5", width=10, command=lambda: shutdownpc(5)) |
| 41 | + five_second = Button(window, text="5", width=10, command=lambda: shutdownpc(5), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
34 | 42 | five_second.place(x=85, y=35)
|
35 |
| - ten_second = Button(window, text="10", width=10, command=lambda: shutdownpc(10)) |
| 43 | + ten_second = Button(window, text="10", width=10, command=lambda: shutdownpc(10), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
36 | 44 | ten_second.place(x=165, y=35)
|
37 |
| - fifteen_second = Button(window, text="15", width=10, command=lambda: shutdownpc(15)) |
| 45 | + fifteen_second = Button(window, text="15", width=10, command=lambda: shutdownpc(15), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
38 | 46 | fifteen_second.place(x=245, y=35)
|
39 |
| - twenty_second = Button(window, text="20", width=10, command=lambda: shutdownpc(20)) |
| 47 | + twenty_second = Button(window, text="20", width=10, command=lambda: shutdownpc(20), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
40 | 48 | twenty_second.place(x=325, y=35)
|
41 |
| - twentyfive_second = Button(window, text="25", width=10, command=lambda: shutdownpc(25)) |
| 49 | + twentyfive_second = Button(window, text="25", width=10, command=lambda: shutdownpc(25), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
42 | 50 | twentyfive_second.place(x=405, y=35)
|
43 |
| - thirty_second = Button(window, text="30", width=10, command=lambda: shutdownpc(30)) |
| 51 | + thirty_second = Button(window, text="30", width=10, command=lambda: shutdownpc(30), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
44 | 52 | thirty_second.place(x=5, y=70)
|
45 |
| - thirtyfive_second = Button(window, text="35", width=10, command=lambda: shutdownpc(35)) |
| 53 | + thirtyfive_second = Button(window, text="35", width=10, command=lambda: shutdownpc(35), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
46 | 54 | thirtyfive_second.place(x=85, y=70)
|
47 |
| - fourty_second = Button(window, text="40", width=10, command=lambda: shutdownpc(40)) |
| 55 | + fourty_second = Button(window, text="40", width=10, command=lambda: shutdownpc(40), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
48 | 56 | fourty_second.place(x=165, y=70)
|
49 |
| - fourtyfive_second = Button(window, text="45", width=10, command=lambda: shutdownpc(45)) |
| 57 | + fourtyfive_second = Button(window, text="45", width=10, command=lambda: shutdownpc(45), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
50 | 58 | fourtyfive_second.place(x=245, y=70)
|
51 |
| - fifty_second = Button(window, text="50", width=10, command=lambda: shutdownpc(50)) |
| 59 | + fifty_second = Button(window, text="50", width=10, command=lambda: shutdownpc(50), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
52 | 60 | fifty_second.place(x=325, y=70)
|
53 |
| - fiftyfive_second = Button(window, text="55", width=10, command=lambda: shutdownpc(55)) |
| 61 | + fiftyfive_second = Button(window, text="55", width=10, command=lambda: shutdownpc(55), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
54 | 62 | fiftyfive_second.place(x=405, y=70)
|
55 |
| - sixty_second = Button(window, text="60", width=10, command=lambda: shutdownpc(60)) |
| 63 | + sixty_second = Button(window, text="60", width=10, command=lambda: shutdownpc(60), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
56 | 64 | sixty_second.place(x=5, y=105)
|
57 |
| - private_time = Label(window, text=private_time_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT) |
| 65 | + private_time = Label(window, text=private_time_title, font=("Arial",12,"bold"), bg=label_bg, fg=label_fg) |
58 | 66 | private_time.place(y=140)
|
59 |
| - private_time_input = Text(window, width=15, height=1) |
| 67 | + private_time_input = Entry(window, width=20, font=("Arial",12,"bold"), bg=entry_bg, fg=entry_fg, insertbackground=entry_instert_bg) |
60 | 68 | 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) |
| 69 | + private_time_button = Button(window, text=private_time_button_title, width=13, command=get_input, bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
| 70 | + private_time_button.place(x=195, y=170) |
| 71 | + all_operations_shutdownpc = Label(window, text=all_operations_shutdownpc_title_, font=("Arial",12,"bold"), bg=label_bg, fg=label_fg) |
64 | 72 | all_operations_shutdownpc.place(y=200)
|
65 |
| - all_operations_shutdownpc_button = Button(window, text=all_operations_shutdownpc_title, command=all_operations_ShutdownPC) |
| 73 | + all_operations_shutdownpc_button = Button(window, text=all_operations_shutdownpc_title, command=all_operations_ShutdownPC, bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg) |
66 | 74 | all_operations_shutdownpc_button.place(x=5, y=230)
|
| 75 | + window.bind('<Control-w>', close) |
67 | 76 | window.mainloop()
|
68 | 77 | else:
|
69 | 78 | print(shutdownpc_askyesno_cancel_txt_title)
|
70 | 79 |
|
71 | 80 | def all_operations_ShutdownPC():
|
72 | 81 | if messagebox.askyesno(adwmgui_txt_title, shutdownpc_askyesno_txt_title) == True:
|
73 | 82 | time(0.5)
|
74 |
| - OpenCleanmgr() |
| 83 | + Cleanmgr() |
75 | 84 | time(0.5)
|
76 |
| - AdvancedCleanup() |
| 85 | + DISMClean(mode="auto") |
77 | 86 | time(0.5)
|
78 |
| - RepairSystem() |
| 87 | + RepairSystem(mode="auto") |
79 | 88 | time(0.5)
|
80 | 89 | shutdownpc(0)
|
81 | 90 | else:
|
|
0 commit comments