-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
temp_cleaner_gui_r5.6.py
2195 lines (1845 loc) · 128 KB
/
temp_cleaner_gui_r5.6.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
The Project Temp_Cleaner GUI by Insertx2k Dev.
A simple alternative to all Temp cleaning software available for Windows available under the GNU General Public License v2.0 or later
License for the Project Temp_Cleaner GUI.
A simple program made to help you erase temporary files in your Windows-based PC.
Copyright (C) 2021, 2022, 2023 - Insertx2k Dev (Mr.X)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See github.com/insertx2k/temp_cleaner_gui
For a much better github page, try visiting https://insertx2k.github.io/temp_cleaner_gui
The program Temp_Cleaner GUI was previously Temp_Cleaner and it was using a CUI instead of a GUI.
**THIS FILE (AS IT IS) BELONGS TO THE TEMP_CLEANER GUI PROJECT AND SHALL BE ONLY USED IN ACCORDING TO THE TERMS OF THE PRODUCT**
"""
# defining the global variable that holds the font_size of the scrolledtext.ScrolledText widget
# named 'showLicense'
font_size = 14
# print greetings text.
print()
print("Greetings from the Temp_Cleaner GUI Project.")
print("By Ziad Ahmed aka. Insertx2k Dev (Mr.X)")
print("Github : https://github.com/insertx2k/temp_cleaner_gui")
print("Twitter : https://twitter.com/insertplayztw")
print()
print("Powered by Minimal Accessibility Pack v1.0 by Insertx2k Dev (Mr.X)")
print()
# end of print greetings text.
# Imports
import shutil
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
import os
from xmlrpc.client import Boolean
from PIL import Image, ImageTk
import configparser
from tkinter import filedialog
from tkinter import scrolledtext
import subprocess
from subprocess import PIPE
import awesometkinter as atk
import sys
import threading
import platform
from translations import *
from customtkinter import *
import webbrowser
import updater
# Defining the function that will get the current values of an configparser values.
GetConfig = configparser.ConfigParser()
GetConfig.read('Config.ini')
# checking if autocheck for updates is enabled or not, because if enabled will run the updater before running the main program.
# This is program's Main Window Class.
class MainWindowLightMode(CTk):
def __init__(self):
global GetConfig, font_size
super().__init__() # initializing the self.
print(f"""Current display properties (resolution) are:
Display Width: {self.winfo_screenwidth()}
Display height: {self.winfo_screenheight()}
""")
# Trying to change the theme.
try:
# Changing the self's theme.
self.style = ttk.Style()
# self.style.theme_use("native")
except Exception as excpt:
print(f"The following exception had occured while trying to apply the style \n {excpt}")
try:
set_default_color_theme("style.json")
except Exception as apply_style_file_error:
messagebox.showerror("Runtime Error", f"An error has occured while we were trying to load the style file 'style.json'\n{apply_style_file_error}\n\nYou can try to make sure if the file 'style.json' is in the same directory as this program and try again\nThe program will close.")
raise SystemExit(1225) # error code 1225 is for invalid style.json file
# self.configure(background='white')
try:
self.login = os.getlogin()
if str(GetConfig['ProgConfig']['languagesetting']) == 'en':
WindowNewTitle = f"{en.prog_title_1}{self.login}{en.prog_title_2}"
elif str(GetConfig['ProgConfig']['languagesetting']) == 'ar':
WindowNewTitle = f"{ar.prog_title_2}{self.login}{ar.prog_title_1}"
else:
WindowNewTitle = f"{en.prog_title_1}{self.login}{en.prog_title_2}"
self.title(WindowNewTitle)
except Exception as excpt129:
self.title(getCurrentLanguage().prog_title_no_username)
# configuring program's main window geometry (DO NOT MODIFY)
self.geometry('1225x600')
# attempting to change the iconbitmap attribute of the window.
try:
self.iconbitmap("icon0.ico")
except Exception as excpt12: # better high level exception handling.
messagebox.showerror("ERROR 1 in ICONBITMAP", f"Unable to load icon file for this window due to exception:\n{excpt12}")
pass
# basically preventing you from resizing it smaller than it's geometry.
self.minsize(1225,600)
if str(GetConfig['ProgConfig']['appearancemode']) == '1': # light mode
# making a full screen scrollable frame.
self.main_frame = Frame(self)
self.main_frame.pack(fill=BOTH, expand=1)
# Create a canvas.
self.main_canvas = Canvas(self.main_frame)
self.main_canvas.pack(side=LEFT, fill=BOTH, expand=1)
# Add a scrollbar to the canvas
self.main_scrollbar = atk.SimpleScrollbar(self.main_frame, orient=VERTICAL, command=self.main_canvas.yview, bg=atk.DEFAULT_COLOR, slider_color='grey', width=12)
self.main_scrollbar.pack(side=RIGHT, fill=Y)
# Configure the canvas.
self.main_canvas.configure(yscrollcommand=self.main_scrollbar.set)
self.main_canvas.bind('<Configure>', lambda e: self.main_canvas.configure(scrollregion = self.main_canvas.bbox("all")))
# Create another frame INSIDE the canvas.
self.show_frame = Frame(self.main_canvas)
# Add that New frame to a window in the canvas.
self.main_canvas.create_window((0,0), window=self.show_frame, anchor="nw")
self.banner = PhotoImage(file="banner.png")
self.banner_show = Label(self.show_frame, image=self.banner, width=1200, height=300)
self.banner_show.grid(column=0, row=1, sticky='w')
set_appearance_mode("light")
elif str(GetConfig['ProgConfig']['appearancemode']) == '2': # dark mode.
# making a full screen scrollable frame.
self.main_frame = Frame(self, background=atk.DEFAULT_COLOR)
self.main_frame.pack(fill=BOTH, expand=1)
# Create a canvas.
self.main_canvas = Canvas(self.main_frame, background=atk.DEFAULT_COLOR)
self.main_canvas.pack(side=LEFT, fill=BOTH, expand=1)
# Add a scrollbar to the canvas
self.main_scrollbar = atk.SimpleScrollbar(self.main_frame, orient=VERTICAL, command=self.main_canvas.yview, bg=atk.DEFAULT_COLOR, slider_color='grey', width=12)
self.main_scrollbar.pack(side=RIGHT, fill=Y)
# Configure the canvas.
self.main_canvas.configure(yscrollcommand=self.main_scrollbar.set)
self.main_canvas.bind('<Configure>', lambda e: self.main_canvas.configure(scrollregion = self.main_canvas.bbox("all")))
# Create another frame INSIDE the canvas.
self.show_frame = Frame(self.main_canvas, background=atk.DEFAULT_COLOR)
# Add that New frame to a window in the canvas.
self.main_canvas.create_window((0,0), window=self.show_frame, anchor="nw")
self.banner = PhotoImage(file="banner.png")
self.banner_show = Label(self.show_frame, image=self.banner, width=1200, height=300, background=atk.DEFAULT_COLOR)
self.banner_show.grid(column=0, row=1, sticky='w')
self.style.configure('TLabelframe.Label', background=atk.DEFAULT_COLOR, foreground='white')
self.style.configure('Label', background=atk.DEFAULT_COLOR)
self.style.configure('Label', foreground='white')
self.style.configure('TLabelframe', background=atk.DEFAULT_COLOR, foreground='white')
self.style.configure('TCheckbutton', background=atk.DEFAULT_COLOR, foreground='white')
self.style.configure('label', foreground='white')
# self.style.configure('Vertical.TScrollbar', background=atk.DEFAULT_COLOR, foreground=atk.DEFAULT_COLOR)
self.configure(background=atk.DEFAULT_COLOR)
set_appearance_mode("dark")
else:
messagebox.showerror("Unsupported appearance mode in Config file", f"Unsupported appearance mode in config file: {str(GetConfig['ProgConfig']['appearancemode'])}.\nThe program will continue with the Light mode instead.")
# making a full screen scrollable frame.
self.main_frame = Frame(self)
self.main_frame.pack(fill=BOTH, expand=1)
# Create a canvas.
self.main_canvas = Canvas(self.main_frame)
self.main_canvas.pack(side=LEFT, fill=BOTH, expand=1)
# Add a scrollbar to the canvas
self.main_scrollbar = atk.SimpleScrollbar(self.main_frame, orient=VERTICAL, command=self.main_canvas.yview, bg=atk.DEFAULT_COLOR, slider_color='grey', width=12)
self.main_scrollbar.pack(side=RIGHT, fill=Y)
# Configure the canvas.
self.main_canvas.configure(yscrollcommand=self.main_scrollbar.set)
self.main_canvas.bind('<Configure>', lambda e: self.main_canvas.configure(scrollregion = self.main_canvas.bbox("all")))
# Create another frame INSIDE the canvas.
self.show_frame = Frame(self.main_canvas)
# Add that New frame to a window in the canvas.
self.main_canvas.create_window((0,0), window=self.show_frame, anchor="nw")
self.banner = PhotoImage(file="banner.png")
self.banner_show = Label(self.show_frame, image=self.banner, width=1200, height=300)
self.banner_show.grid(column=0, row=1, sticky='w')
set_appearance_mode("light")
def execute_theprogram():
self.ShowNotificationDone = True
self.exec_btn.configure(text=getCurrentLanguage().executing_text)
self.exec_btn.configure(command=empty_function)
self.exec_btn.configure(state='disabled')
# show_output() # Calling the show output method so you can actually see what's happening inside.
self.output_show.configure(state='normal')
try:
# getting the systemdrive letter.
system_drive = str(os.getenv("SYSTEMDRIVE"))
# making sure to log the disk space before the cleaning up process and after the cleaning up process.
total_before, used_before, free_before = shutil.disk_usage(system_drive)
except Exception as exception_fetching_freeds_bexec:
messagebox.showerror("An ERROR has occured", f"An exception has occured while Temp_Cleaner GUI was trying to fetch the current available disk space, This can happen if the program doesn't have the administrative privileges or so on\nConsider trying to do any of the following:\n1-Restart Temp_Cleaner GUI\n2-Right click on Temp_Cleaner GUI's Icon and click on Run as Administrator and try again\n3-Create a Github issue on https://github.com/insertx2k/temp_cleaner_gui with a screenshot of this messagebox and more details you think that will be useful in solving this issue.\nMore details available below:\n{exception_fetching_freeds_bexec}")
self.selection = self.var0.get()
if self.selection == '1':
self.process = subprocess.getoutput('rmdir /s /q "%systemdrive%\\$Recycle.bin"')
self.output_show.insert(END, f"\n {self.process}")
self.selection1 = self.var1.get()
if self.selection1 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%windir%\\prefetch"')
self.output_show.insert(END, f"\n {self.process}")
self.selection2 = self.var2.get()
if self.selection2 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\D3DSCache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection3 = self.var3.get()
if self.selection3 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%windir%\\Temp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection4 = self.var4.get()
if self.selection4 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Temp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection5 = self.var5.get()
if self.selection5 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Google\\Chrome\\User Data\\Default\\GPUCache"&erase /s /f /q "%localappdata%\\Google\\Chrome\\User Data\\Default\\Cache"&erase /s /f /q "%localappdata%\\Google\\Chrome\\User Data\\Default\\Code Cache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection6 = self.var6.get()
if self.selection6 == '1':
self.process = subprocess.getoutput('del /s /q "%localappdata%\\Google\\Chrome\\User Data\\Default\\Cookies"&del /s /q "%localappdata%\\Google\\Chrome\\User Data\\Default\\Cookies-journal"')
self.output_show.insert(END, f"\n {self.process}")
self.selection9 = self.var7.get()
if self.selection9 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%systemdrive%\\Users\\Default\\AppData\\Local\\Temp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection10 = self.var8.get()
if self.selection10 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\INetCache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection11 = self.var9.get()
if self.selection11 == '1':
self.process = subprocess.getoutput('@echo off | clip')
self.output_show.insert(END, f"\n {self.process}")
self.selection12 = self.var10.get()
if self.selection12 == '1':
self.process = subprocess.getoutput(' cd /d %localappdata%&cd microsoft&cd windows&cd explorer&del /s /q *thumbcache*&cd /d %localappdata%\microsoft\windows\explorer&del /s /q *thumb*')
self.output_show.insert(END, f"\n {self.process}")
self.selection13 = self.var11.get()
if self.selection13 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\Recent"')
self.output_show.insert(END, f"\n {self.process}")
self.selection14 = self.var12.get()
if self.selection14 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\AppData\\Roaming\\discord\\Cache"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\discord\\Code Cache"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\discord\\GPUCache"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\discord\\Local Storage"')
self.output_show.insert(END, f"\n {self.process}")
self.selection15 = self.var13.get()
if self.selection15 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\AppData\\Roaming\\GIMP\\2.10\\tmp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection16 = self.var14.get()
if self.selection16 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Steam\\htmlcache\\Cache"&erase /s /f /q "%localappdata%\\Steam\\htmlcache\\Code Cache"&erase /s /f /q "%localappdata%\\Steam\\htmlcache\\GPUCache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection17 = self.var15.get()
if self.selection17 == '1':
self.process = subprocess.getoutput('del /f /s /q "%windir%\\SoftwareDistribution\\Download"')
self.output_show.insert(END, f"\n {self.process}")
self.reboot_uwp = messagebox.askquestion(getCurrentLanguage().restart_winupdate_window_title_text, getCurrentLanguage().restart_winupdate_window_content_text)
if self.reboot_uwp == "yes":
self.self_2 = Tk()
self.self_2.title(getCurrentLanguage().restart_winupdate_window_title_text)
self.self_2.geometry('500x90')
self.self_2.resizable(False,False)
try:
self.self_2.iconbitmap("icon0.ico")
except Exception as excpt24:
messagebox.showerror("ERROR 1 in ICONBITMAP process", f"Unable to load the icon file for this window due to Exception:\n{excpt24}")
pass
# Defining some labels used to show the user that something is happening inside.
self.lbl0x = Label(self.self_2, text=getCurrentLanguage().restarting_winupdate_service_text, font=("Arial", 19))
self.lbl0x.place(x=25 ,y=20)
# Defining the actions used to restart the Windows update service.
self.process = subprocess.getoutput('net start wuauserv')
# Defining the commands used to show the user that all pending operations has been successfully completed!
messagebox.showinfo(getCurrentLanguage().restarting_winupdate_service_text, getCurrentLanguage().restart_winupdate_service_done_text)
# Defining the mainloop destroy once the execution is done.
self.self_2.destroy()
self.self_2.mainloop()
messagebox.showinfo(getCurrentLanguage().restarting_winupdate_service_text, getCurrentLanguage().restart_winupdate_service_done_text)
else:
messagebox.showinfo(getCurrentLanguage().restart_winupdate_window_title_text, getCurrentLanguage().not_restarting_winupdate_service_warning_text)
self.selection18 = self.var16.get()
if self.selection18 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\Caches"')
self.output_show.insert(END, f"\n {self.process}")
self.selection19 = self.var17.get()
if self.selection19 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\INetCookies"')
self.output_show.insert(END, f"\n {self.process}")
self.selection20 = self.var18.get()
if self.selection20 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\IECompatCache"&erase /s /f /q "%localappdata%\\Microsoft\\Windows\\IECompatUaCache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection21 = self.var19.get()
if self.selection21 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\IEDownloadHistory"')
self.output_show.insert(END, f"\n {self.process}")
self.selection22 = self.var20.get()
if self.selection22 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\ActionCenterCache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection23 = self.var21.get()
if self.selection23 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\AppCache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection24 = self.var22.get()
if self.selection24 == '1':
self.conf1 = messagebox.askquestion(getCurrentLanguage().clean_ms_store_based_edge_cache_window_title, getCurrentLanguage().clean_ms_store_based_edge_cache_dialog_one_content)
if self.conf1 == "yes":
messagebox.showinfo(getCurrentLanguage().clean_ms_store_based_edge_cache_window_title, getCurrentLanguage().clean_ms_store_based_edge_cache_dialog_two_content)
self.process = subprocess.getoutput(' explorer.exe "%localappdata%\\Packages\\"')
self.output_show.insert(END, f"\n {self.process}")
messagebox.showinfo(getCurrentLanguage().clean_ms_store_based_edge_cache_window_title, getCurrentLanguage().done_text)
else:
messagebox.showinfo(getCurrentLanguage().clean_ms_store_based_edge_cache_window_title, getCurrentLanguage().operation_interrupted_by_user)
self.selection25 = self.var23.get()
if self.selection25 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Windows\\Explorer\\ThumbCacheToDelete"')
self.output_show.insert(END, f"\n {self.process}")
self.selection26 = self.var24.get()
if self.selection26 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microsoft\\Edge\\User Data\\Default\\GPUCache"&erase /s /f /q "%localappdata%\\Microsoft\\Edge\\User Data\\Default\\Cache"&erase /s /f /q "%localappdata%\\Microsoft\\Edge\\User Data\\Default\\Code Cache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection27 = self.var25.get()
if self.selection27 == '1':
self.process = subprocess.getoutput('del /s /q "%localappdata%\\Microsoft\\Edge\\User Data\\Default\\Cookies"&del /s /q "%localappdata%\\Microsoft\\Edge\\User Data\\Default\\Cookies-journal"')
self.output_show.insert(END, f"\n {self.process}")
self.selection28 = self.var26.get()
if self.selection28 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Roblox\\Downloads"')
self.output_show.insert(END, f"\n {self.process}")
self.selection29 = self.var27.get()
if self.selection29 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%appdata%\\Adobe\\Adobe Photoshop 2020\\Adobe Photoshop 2020 Settings\\web-cache-temp\\GPUCache"&erase /s /f /q "%appdata%\\Adobe\\Adobe Photoshop 2020\\Adobe Photoshop 2020 Settings\\web-cache-temp\\Code Cache"&del /s /f /q "%appdata%\\Adobe\\Adobe Photoshop 2020\\Adobe Photoshop 2020 Settings\\web-cache-temp\\Visited Links"')
self.output_show.insert(END, f"\n {self.process}")
self.selection30 = self.var28.get()
if self.selection30 == '1':
self.process = subprocess.getoutput(' cd /d "%localappdata%\\VEGAS Pro\\17.0"&erase /s /f /q "File Explorer Thumbnails"&erase /s /f /q "Device Explorer Thumbnails"&del /s /f /q "*.autosave.veg.bak"&del /s /f /q "svfx_Ofx*.log"')
self.output_show.insert(END, f"\n {self.process}")
self.selection31 = self.var29.get()
if self.selection31 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\McNeel\\Rhinoceros\\temp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection32 = self.var30.get()
if self.selection32 == '1':
self.process = subprocess.getoutput('erase /s /f /q /A:S "%userprofile%\\AppData\\LocalLow\\Microsoft\\CryptnetUrlCache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection33 = self.var31.get()
if self.selection33 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\pip\\cache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection34 = self.var32.get()
if self.selection34 == '1':
self.conf2 = messagebox.askquestion(getCurrentLanguage().erase_rammap_title, getCurrentLanguage().erase_rammap_content)
if self.conf2 == "yes":
self.RAMMAPpath_var = GetConfig['ProgConfig']['RAMMapPath']
if self.RAMMAPpath_var == '$DEFAULT':
messagebox.showinfo(getCurrentLanguage().default_path_msgbox_title, getCurrentLanguage().default_path_rammap)
self.process = subprocess.getoutput(r'"%systemdrive%\RAMMap\RAMMap.exe" -Ew')
self.output_show.insert(END, f"\n {self.process}")
messagebox.showinfo(getCurrentLanguage().erase_rammap_title, getCurrentLanguage().commandsent_to_rammap_text)
else:
self.process = subprocess.getoutput(rf'""{self.RAMMAPpath_var}"\RAMMap.exe" -Ew')
self.output_show.insert(END, f"\n {self.process}")
messagebox.showinfo(getCurrentLanguage().erase_rammap_title, getCurrentLanguage().commandsent_to_rammap_text)
else:
messagebox.showinfo(getCurrentLanguage().erase_rammap_title, getCurrentLanguage().operation_interrupted_by_user)
self.selection35 = self.var33.get()
if self.selection35 == '1':
self.process = subprocess.getoutput('del /s /q "%localappdata%\\Google\\Chrome\\User Data\\Default\\Extension Cookies"&del /s /q "%localappdata%\\Google\\Chrome\\User Data\\Default\\Extension Cookies-journal"')
self.output_show.insert(END, f"\n {self.process}")
self.selection36 = self.var34.get()
if self.selection36 == '1':
self.CDPCCPATH_var = GetConfig['ProgConfig']['CDPCCPATH']
if self.CDPCCPATH_var == '$DEFAULT':
messagebox.showinfo(getCurrentLanguage().default_path_msgbox_title, getCurrentLanguage().default_path_winactivities_cache_text)
self.process = subprocess.getoutput(' cd /d "%localappdata%\\ConnectedDevicesPlatform"&erase /s /f /q *')
self.output_show.insert(END, f"\n {self.process}")
else:
self.process = subprocess.getoutput(rf' cd /d "%localappdata%\\ConnectedDevicesPlatform"&erase /s /f /q "{self.CDPCCPATH_var}"')
self.output_show.insert(END, f"\n {self.process}")
self.selection37 = self.var35.get()
if self.selection37 == '1':
self.conf3 = messagebox.askquestion(getCurrentLanguage().clear_icon_cache_dialog_text, getCurrentLanguage().iconcache_dialog_text)
if self.conf3 == "yes":
self.process = subprocess.getoutput('%windir%\\explorer.exe "%localappdata%"')
self.output_show.insert(END, f"\n {self.process}")
messagebox.showinfo(getCurrentLanguage().clear_icon_cache_dialog_text, getCurrentLanguage().done_text)
else:
pass
self.selection38 = self.var36.get()
if self.selection38 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Microvirt"')
self.output_show.insert(END, f"\n {self.process}")
self.selection39 = self.var37.get()
if self.selection39 == '1':
self.ADWCLRPATH_var = GetConfig['ProgConfig']['ADWCLRPath']
if self.ADWCLRPATH_var == '$DEFAULT':
messagebox.showinfo(getCurrentLanguage().default_path_msgbox_title, getCurrentLanguage().nocustom_path_foradwcleaner_text)
self.process = subprocess.getoutput(' erase /s /f /q "%systemdrive%\\AdwCleaner\\Logs"')
self.output_show.insert(END, f"\n {self.process}")
else:
self.process = subprocess.getoutput(rf' erase /s /f /q "{self.ADWCLRPATH_var}\Logs"')
self.output_show.insert(END, f"\n {self.process}")
self.selection40 = self.var38.get()
if self.selection40 == '1':
self.process = subprocess.getoutput(' %systemdrive%&cd /d \\.\\&erase /s /f /q "PerfLogs"')
self.output_show.insert(END, f"\n {self.process}")
self.selection41 = self.var39.get()
if self.selection41 == '1':
self.process = subprocess.getoutput('rmdir /s /q "%userprofile%\\.cache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection42 = self.var40.get()
if self.selection42 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\SquirrelTemp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection43 = self.var41.get()
if self.selection43 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\AppData\\LocalLow\\Temp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection44 = self.var42.get()
if self.selection44 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\ElevatedDiagnostics"')
self.output_show.insert(END, f"\n {self.process}")
self.selection45 = self.var43.get()
if self.selection45 == '1':
self.process = subprocess.getoutput('cd /d "%localappdata%\\VMware"&erase /s /f /q "vmware-download*"')
self.output_show.insert(END, f"\n {self.process}")
self.selection46 = self.var44.get()
if self.selection46 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\appdata\\roaming\\balena-etcher\\blob_storage"&erase /s /f /q "%userprofile%\\appdata\\roaming\\balena-etcher\\Code Cache"&erase /s /f /q "%userprofile%\\appdata\\roaming\\balena-etcher\\GPUCache"&erase /s /f /q "%userprofile%\\appdata\\roaming\\balena-etcher\\Local Storage"&erase /s /f /q "%userprofile%\\appdata\\roaming\\balena-etcher\\Session Storage"')
self.output_show.insert(END, f"\n {self.process}")
self.selection47 = self.var45.get()
if self.selection47 == '1':
self.process = subprocess.getoutput(' cd /d "%appdata%"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\pyinstaller"')
self.output_show.insert(END, f"\n {self.process}")
self.selection48 = self.var46.get()
if self.selection48 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Jedi"')
self.output_show.insert(END, f"\n {self.process}")
self.selection49 = self.var47.get()
if self.selection49 == '1':
self.process = subprocess.getoutput('del /s /q "%localappdata%\\recently-used.xbel"')
self.output_show.insert(END, f"\n {self.process}")
self.selection50 = self.var48.get()
if self.selection50 == '1':
self.process = subprocess.getoutput('cd /d "%localappdata%"&del /s /q "llftool.*.agreement"')
self.output_show.insert(END, f"\n {self.process}")
self.selection51 = self.var49.get()
if self.selection51 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\IdentityNexusIntegration"')
self.output_show.insert(END, f"\n {self.process}")
self.selection52 = self.var50.get()
if self.selection52 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Axolot Games\\Scrap Mechanic\\Temp\\WorkshopIcons"')
self.output_show.insert(END, f"\n {self.process}")
self.selection53 = self.var51.get()
if self.selection53 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\Roblox\\logs"')
self.output_show.insert(END, f"\n {self.process}")
self.selection54 = self.var52.get()
if self.selection54 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\AppData\\Roaming\\Code\\GPUCache"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\Code\\Code Cache"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\Code\\CachedData"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\Code\\Cache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection55 = self.var53.get()
if self.selection55 == '1':
self.process = subprocess.getoutput('del /s /q "%userprofile%\\AppData\\Roaming\\Code\\Cookies"&del /s /q "%userprofile%\\AppData\\Roaming\\Code\\Cookies-journal"')
self.output_show.insert(END, f"\n {self.process}")
self.selection56 = self.var54.get()
if self.selection56 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\AppData\\Roaming\\Code\\CachedExtensions"&erase /s /f /q "%userprofile%\\AppData\\Roaming\\Code\\CachedExtensionVSIXs"')
self.output_show.insert(END, f"\n {self.process}")
self.selection57 = self.var55.get()
if self.selection57 == '1':
self.WINXPEPATH_var = GetConfig['ProgConfig']['WINXPEPATH']
if self.WINXPEPATH_var == "$NONE":
messagebox.showinfo(getCurrentLanguage().an_error_has_occured_text, getCurrentLanguage().no_path_winxpe_text)
else:
self.process = subprocess.getoutput(rf' erase /s /f /q "{self.WINXPEPATH_var}\Temp"')
self.output_show.insert(END, f"\n {self.process}")
messagebox.showinfo(getCurrentLanguage().note_text, getCurrentLanguage().winxpe_after_clean_note_text)
self.selection58 = self.var56.get()
if self.selection58 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\ServiceHub"')
self.output_show.insert(END, f"\n {self.process}")
self.selection59 = self.var57.get()
if self.selection59 == '1':
self.process = subprocess.getoutput(' erase /s /f /q "%localappdata%\\HiSuite\\log"')
self.output_show.insert(END, f"\n {self.process}")
self.selection60 = self.var58.get()
if self.selection60 == '1':
self.process = subprocess.getoutput(' erase /s /f /q "%userprofile%\\AppData\\Roaming\\.minecraft\\webcache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection61 = self.var59.get()
if self.selection61 == '1':
self.process = subprocess.getoutput(' cd /d "%localappdata%\\Mozilla\\Firefox\\Profiles"&cd *.default-release&erase /s /f /q "cache2"&erase /s /f /q "jumpListCache"&cd /d "%userprofile%\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"&cd *.default-release&erase /s /f /q "shader-cache"')
self.output_show.insert(END, f"\n {self.process}")
self.selection62 = self.var60.get()
if self.selection62 == '1':
self.process = subprocess.getoutput(' cd /d "%userprofile%\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"&cd *.default-release&del /s /q "cookies.sqlite"')
self.output_show.insert(END, f"\n {self.process}")
self.selection63 = self.var61.get()
if self.selection63 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\VEGAS\\ErrorReport"')
self.output_show.insert(END, f"\n {self.process}")
self.selection64 = self.var62.get()
if self.selection64 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%userprofile%\\AppData\\LocalLow\\Sun\\Java\\Deployment\\tmp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection65 = self.var63.get()
if self.selection65 == '1':
self.process = subprocess.getoutput('erase /s /f /q "%localappdata%\\HiSuite\\userdata\\DropTemp"')
self.output_show.insert(END, f"\n {self.process}")
self.selection66 = self.var64.get()
self.output_show.insert(END, "\n\n\nYou may press the 'F6' button in your keyboard to clear this list.\n\n\n")
self.output_show.configure(state='disabled')
if self.selection66 == '1':
self.destroy()
raise SystemExit(0) # quitting program.
# Sleeping a bit for longer (or equal) to 5 seconds.
# time.sleep(1)
try:
# now logging after everything is done.
total_after, used_after, free_after = shutil.disk_usage(system_drive)
freed_up = (free_before - free_after)
if convert_to_str_with_units(freed_up) == "0 bytes":
messagebox.showinfo(getCurrentLanguage().freed_up_diskspace_dialog_title, getCurrentLanguage().freed_up_nothing)
else:
messagebox.showinfo(getCurrentLanguage().freed_up_diskspace_dialog_title, f"{getCurrentLanguage().freed_up_diskspace_dialog}{convert_to_str_with_units(freed_up)}")
except Exception as exception_reading_free_diskspace:
messagebox.showerror("An ERROR has occured", f"An exception has occured while Temp_Cleaner GUI was trying to fetch the current available disk space, This can happen if the program doesn't have the administrative privileges or so on\nConsider trying to do any of the following:\n1-Restart Temp_Cleaner GUI\n2-Right click on Temp_Cleaner GUI's Icon and click on Run as Administrator and try again\n3-Create a Github issue on https://github.com/insertx2k/temp_cleaner_gui with a screenshot of this messagebox and more details you think that will be useful in solving this issue.\nMore details available below:\n{exception_reading_free_diskspace}")
try:
# Ok, let's revert everything back to what it was before.
self.exec_btn.configure(text=getCurrentLanguage().execute_text)
self.exec_btn.configure(command=multiprocessing_execute_btn_function)
self.exec_btn.configure(state='normal')
except TclError as tkerr:
messagebox.showerror("An ERROR has occured", f"An ERROR has occured during the program's mainloop\nHere are some technical details if you want to reach us\n{tkerr}\nThe program can't continue and will close after you press OK")
raise SystemExit(15) # error code 15 is for an urgent mainloop exception.
return None
def multiprocessing_execute_btn_function():
threading.Thread(target=execute_theprogram).start()
pass
def empty_function():
"a function used to fix the issue when temp cleaner gui does not stop the executing button even when cleaning."
pass
def uncheck_all_options():
"""
A function to uncheck all available cleaning options in the Home Screen UI.
"""
try:
self.var0.set(0)
self.var1.set(0)
self.var2.set(0)
self.var3.set(0)
self.var4.set(0)
self.var5.set(0)
self.var6.set(0)
self.var7.set(0)
self.var8.set(0)
self.var9.set(0)
self.var10.set(0)
self.var11.set(0)
self.var12.set(0)
self.var13.set(0)
self.var14.set(0)
self.var15.set(0)
self.var16.set(0)
self.var17.set(0)
self.var18.set(0)
self.var19.set(0)
self.var20.set(0)
self.var21.set(0)
self.var22.set(0)
self.var23.set(0)
self.var24.set(0)
self.var25.set(0)
self.var26.set(0)
self.var27.set(0)
self.var28.set(0)
self.var29.set(0)
self.var30.set(0)
self.var31.set(0)
self.var32.set(0)
self.var33.set(0)
self.var34.set(0)
self.var35.set(0)
self.var36.set(0)
self.var37.set(0)
self.var38.set(0)
self.var39.set(0)
self.var40.set(0)
self.var41.set(0)
self.var42.set(0)
self.var43.set(0)
self.var44.set(0)
self.var45.set(0)
self.var46.set(0)
self.var47.set(0)
self.var48.set(0)
self.var49.set(0)
self.var50.set(0)
self.var51.set(0)
self.var52.set(0)
self.var53.set(0)
self.var54.set(0)
self.var55.set(0)
self.var56.set(0)
self.var57.set(0)
self.var58.set(0)
self.var59.set(0)
self.var60.set(0)
self.var61.set(0)
self.var62.set(0)
self.var63.set(0)
self.var64.set(0)
except Exception as unable_to_uncheck_all_exception:
print(f"Unable to execute the function uncheck_all_options() due to this exception\n{unable_to_uncheck_all_exception}")
return False
return True
def getCurrentLanguage(currentLanguageStr=GetConfig['ProgConfig']['languagesetting']):
"""
Gets the current language from the config file 'Config.ini'
Should return `en` class if the current language is set to en, and so on.
"""
try:
if str(currentLanguageStr) == "en":
return en
elif str(currentLanguageStr) == "ar":
return ar
else:
return en
except Exception as exception_reading_config_file:
messagebox.showerror("An ERROR has occured",f"Couldn't read from 'Config.ini'\nException details:\n{exception_reading_config_file}\nPress OK to close this program")
raise SystemExit(169) # Exit code 169 is for unreadable config file or untreatable getCurrentLanguage exceptions.
# This is needed to make sure the program doesn't act weirdly.
def apply_cleaning_preset(user_choice):
print(str(self.preset_chooser.get()))
if str(self.preset_chooser.get()) == getCurrentLanguage().preset_default :
try:
uncheck_all_options()
self.var0.set(1)
self.var2.set(1)
self.var9.set(1)
self.var3.set(1)
self.var4.set(1)
self.var8.set(1)
self.var23.set(1)
except Exception as exception_applying_preset:
print(exception_applying_preset)
pass
elif str(self.preset_chooser.get()) == getCurrentLanguage().preset_maximum_cleaning :
try:
uncheck_all_options()
self.var0.set(1)
self.var1.set(1)
self.var2.set(1)
self.var3.set(1)
self.var4.set(1)
self.var5.set(1)
self.var6.set(1)
self.var7.set(1)
self.var8.set(1)
self.var9.set(1)
self.var10.set(1)
self.var11.set(1)
self.var12.set(1)
self.var13.set(1)
self.var14.set(1)
self.var15.set(1)
self.var16.set(1)
self.var17.set(1)
self.var18.set(1)
self.var19.set(1)
self.var20.set(1)
self.var21.set(1)
self.var22.set(1)
self.var23.set(1)
self.var24.set(1)
self.var25.set(1)
self.var26.set(1)
self.var27.set(1)
self.var28.set(1)
self.var29.set(1)
self.var30.set(1)
self.var31.set(1)
self.var32.set(1)
self.var33.set(1)
self.var34.set(1)
self.var35.set(1)
self.var36.set(1)
self.var37.set(1)
self.var38.set(1)
self.var39.set(1)
self.var40.set(1)
self.var41.set(1)
self.var42.set(1)
self.var43.set(1)
self.var44.set(1)
self.var45.set(1)
self.var46.set(1)
self.var47.set(1)
self.var48.set(1)
self.var49.set(1)
self.var50.set(1)
self.var51.set(1)
self.var52.set(1)
self.var53.set(1)
self.var54.set(1)
self.var55.set(1)
self.var56.set(1)
self.var57.set(1)
self.var58.set(1)
self.var59.set(1)
self.var60.set(1)
self.var61.set(1)
self.var62.set(1)
self.var63.set(1)
except Exception as exception_applying_max_preset:
print(exception_applying_max_preset)
pass
elif str(self.preset_chooser.get()) == getCurrentLanguage().preset_recyclebin_cleaning :
try:
uncheck_all_options()
self.var0.set(1)
except Exception as exception_applying_recyclebin_cleaning_preset :
print(exception_applying_recyclebin_cleaning_preset)
pass
elif str(self.preset_chooser.get()) == getCurrentLanguage().preset_webbrowser_cleaning_with_cookies :
try:
uncheck_all_options()
self.var5.set(1)
self.var6.set(1)
self.var33.set(1)
self.var24.set(1)
self.var25.set(1)
self.var59.set(1)
self.var60.set(1)
self.var17.set(1)
self.var18.set(1)
self.var19.set(1)
self.var8.set(1)
except Exception as exception_applying_webbrowser_cookies_cleaning_preset:
print(exception_applying_webbrowser_cookies_cleaning_preset)
pass
elif str(self.preset_chooser.get()) == getCurrentLanguage().preset_webbrowser_cleaning :
try:
uncheck_all_options()
self.var8.set(1)
self.var5.set(1)
self.var24.set(1)
self.var59.set(1)
self.var18.set(1)
self.var19.set(1)
except Exception as exception_applying_webbrowser_cleaning_preset :
print(exception_applying_webbrowser_cleaning_preset)
pass
elif str(self.preset_chooser.get()) == getCurrentLanguage().fix_roblox_error_preset :
try:
uncheck_all_options()
self.var9.set(1)
self.var3.set(1)
self.var4.set(1)
self.var41.set(1)
self.var26.set(1)
except Exception as exception_applying_rblxfix_preset :
print(exception_applying_rblxfix_preset)
pass
else: # if none of these options are selected.
pass
return None
def startAboutWindow():
"""
Opens the new About Window.
"""
aboutWindowProcess = AboutWindow()
aboutWindowProcess.mainloop()
return None
def close_main_screen():
"""
A function to be executed when the user closes the window of the Home Screen UI.
"""
print("User has sent the command WM_DESTROY_WINDOW, will safely terminate the process of this program.")
raise SystemExit(0) # exiting python interpreter.
return None
# def getCurrentCustomCursorsMode(strCurrentCursorsMode=GetConfig["ProgConfig"]['customcursors']):
# """
# Gets the current status of Custom Cursors mode.
# Returns:
# ```py
# tuple(cursor_for_main_widgets, 2, 3)
# ```
# """
# try:
# if str(strCurrentCursorsMode) == "True":
# return ('@cursor.cur', '@Hand.cur', '@TextSelect.cur')
# else:
# return ('arrow', "hand2", "arrow")
# except Exception as exception_getting_cursors_state:
# messagebox.showerror("An ERROR has occured", f"{exception_getting_cursors_state}")
# raise SystemExit(69430210)
# raise SystemExit(69430210) # error code 69430210 is for unable to read cursors mode.
# attempts to change the current cursors mode according to the configuration in Config.ini
# try:
# self.configure(cursor=getCurrentCustomCursorsMode()[0])
# except Exception as exceptioncursor:
# print(f"{exceptioncursor}")
# messagebox.showerror("Unable to use custom Cursor", f"{exceptioncursor}")
# pass
# Defining a sample get var functionaking a new checkbox.
# Defining the ON-OFF Like variable
self.var0 = StringVar()
self.var1 = StringVar()
self.var2 = StringVar()
self.var3 = StringVar()
self.var4 = StringVar()
self.var5 = StringVar()
self.var6 = StringVar()
self.var7 = StringVar()
self.var8 = StringVar()
self.var9 = StringVar()
self.var10 = StringVar()
self.var11 = StringVar()
self.var12 = StringVar()
self.var13 = StringVar()
self.var14 = StringVar()
self.var15 = StringVar()
self.var16 = StringVar()
self.var17 = StringVar()
self.var18 = StringVar()
self.var19 = StringVar()
self.var20 = StringVar()
self.var21 = StringVar()
self.var22 = StringVar()
self.var23 = StringVar()
self.var24 = StringVar()
self.var25 = StringVar()
self.var26 = StringVar()
self.var27 = StringVar()
self.var28 = StringVar()
self.var29 = StringVar()
self.var30 = StringVar()
self.var31 = StringVar()
self.var32 = StringVar()
self.var33 = StringVar()
self.var34 = StringVar()
self.var35 = StringVar()
self.var36 = StringVar()
self.var37 = StringVar()
self.var38 = StringVar()
self.var39 = StringVar()
self.var40 = StringVar()
self.var41 = StringVar()
self.var42 = StringVar()
self.var43 = StringVar()
self.var44 = StringVar()
self.var45 = StringVar()
self.var46 = StringVar()
self.var47 = StringVar()
self.var48 = StringVar()
self.var49 = StringVar()
self.var50 = StringVar()
self.var51 = StringVar()
self.var52 = StringVar()
self.var53 = StringVar()
self.var54 = StringVar()
self.var55 = StringVar()
self.var56 = StringVar()
self.var57 = StringVar()
self.var58 = StringVar()
self.var59 = StringVar()
self.var60 = StringVar()
self.var61 = StringVar()
self.var62 = StringVar()
self.var63 = StringVar()
self.var64 = StringVar()
# ----------------------------
# a fix for 1024x768 or lower screen resolutions:
# ----------------------------
if int(self.winfo_screenwidth()) <= 1024 and int(self.winfo_screenheight()) <= 768:
font_size = 8
self.minsize(800, 600)
self.geometry('800x600')
# ----------------------------
# Defining the function used to show the user the about window of the program.
def show_about_window():
global GetConfig
messagebox.showinfo(getCurrentLanguage().about_window_title,getCurrentLanguage().about_window_txt)
return None
def runUpdaterProgram():
updater.updaterProgramUI()
return None
# ------------------------------
# getting widgets original direction according to the UI language
if str(GetConfig['ProgConfig']['languagesetting']) == 'en': # if UI lang is English.
components_direction = en.widgets_sticking_direction
elif str(GetConfig['ProgConfig']['languagesetting']) == 'ar': # if UI lang is Arabic.
components_direction = ar.widgets_sticking_direction
else: # if UI lang is not specified.
components_direction = en.widgets_sticking_direction
# ------------------------------
# defining the presets label frame.
self.presets_lblframe = ttk.LabelFrame(self.show_frame, text=getCurrentLanguage().dontknow_whattodo_presets_text)
self.preset_chooser = CTkComboBox(self.presets_lblframe, width=500, values=(getCurrentLanguage().preset_default, getCurrentLanguage().preset_maximum_cleaning, getCurrentLanguage().preset_recyclebin_cleaning, getCurrentLanguage().preset_webbrowser_cleaning, getCurrentLanguage().preset_webbrowser_cleaning_with_cookies, getCurrentLanguage().fix_roblox_error_preset), command=apply_cleaning_preset)
self.preset_chooser.set('')
# inserting values for the presets combobox.
self.preset_chooser.grid(column=0, row=1, sticky=components_direction)
self.presets_lblframe.grid(column=0, row=2, sticky=components_direction)
self.preset_chooser.bind('<<ComboboxSelected>>', apply_cleaning_preset) # binding a function that gets called whenever the value of such a combobox is changed by the user.
# ---------------------------
# Defining the checkbox buttons
# --------------------------
self.lblframe0 = ttk.Labelframe(self.show_frame, text=getCurrentLanguage().recycle_bin_text)
self.clr_recyclebin_sysdrive_btn = CTkCheckBox(self.lblframe0, text=getCurrentLanguage().windrv_recycle_bin_text, variable=self.var0, onvalue="1", offvalue="0", command=None)
self.clr_recyclebin_sysdrive_btn.grid(column=0, row=1, sticky=components_direction)
# ---------------------------
self.lblframe0.grid(column=0, row=3, sticky=components_direction)
self.lblframe1 = ttk.Labelframe(self.show_frame, text=getCurrentLanguage().dxdcache_text)
# ---------------------------
self.clr_d3dscache_localappdata_btn = CTkCheckBox(self.lblframe1, text=getCurrentLanguage().dxdcache_text_chkbox, variable=self.var2, onvalue="1", offvalue="0", command=None)
self.clr_d3dscache_localappdata_btn.grid(column=0, row=1, sticky=components_direction)
# ---------------------------
self.lblframe1.grid(column=0, row=4, sticky=components_direction)
self.lblframe2 = ttk.Labelframe(self.show_frame, text=getCurrentLanguage().sys_user_specific_text)
# ---------------------------
self.clr_prefetchw_windir_btn = CTkCheckBox(self.lblframe2, text=getCurrentLanguage().prefw_text, variable=self.var1, onvalue="1", offvalue="0", command=None)
self.clr_prefetchw_windir_btn.grid(column=0, row=1, sticky=components_direction)