-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
60 lines (45 loc) · 2.13 KB
/
main.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
from tkinter import filedialog
import tkinter.font as font
from tkinter import *
from packages.deletecopies import *
def browse_button():
# Allow user to select a directory and store it in global var
# called folder_path
filename = filedialog.askdirectory()
if filename != "":
folder_path.set(filename)
finished_statement.set("Click the button to start cleaning")
root = Tk()
root.geometry("500x250")
root.resizable(False, False)
root.title("Duplicates Deleter")
root.configure(bg="#303444")
root.iconphoto(False, PhotoImage(file='assets/icon/logo.png'))
folder_path = StringVar(value="Please select a folder")
finished_statement = StringVar(value="Click the button to start cleaning")
# Styling
titleFont = font.Font(size=18, weight=font.BOLD)
showLabelFont = font.Font(family="Helvetica")
finishedFont = font.Font(family="Helvetica", size=8)
browseButtonFont = font.Font(family="Arial", size=10, weight=font.BOLD)
deleteButtonFont = font.Font(family="Arial", size=12, weight=font.BOLD)
primary = "#303444"
secondary = "#3E4458"
white = "#fff"
middle = 0.5
titleLabel = Label(master=root, text="Duplicates Deleter", bg=primary, fg=white,anchor='w', height=2)
titleLabel.place(relx=middle, rely=0.18, anchor=CENTER)
titleLabel['font'] = titleFont
showLabel = Label(master=root,textvariable=folder_path, bg=secondary, fg=white,anchor='w', height=2)
showLabel.pack(fill='x', padx=30, pady=92)
showLabel['font'] = showLabelFont
selectButton = Button(text="SELECT", command=browse_button, bg=primary, fg=white, height=1)
selectButton.place(relx=0.86, rely=0.45, anchor=CENTER)
selectButton['font'] = browseButtonFont
deleteButton = Button(text="CLEAN", command=lambda:check_for_duplicates([folder_path.get()], finished_statement), bg=white, fg=primary, height=2, width=12)
deleteButton.place(relx=middle, rely=0.76, anchor=CENTER)
deleteButton['font'] = deleteButtonFont
finishedLabel = Label(master=root,textvariable=finished_statement, bg=primary, fg=white,anchor='w')
finishedLabel.place(relx=middle, rely=0.93, anchor=CENTER)
finishedLabel['font'] = finishedFont
mainloop()