-
Notifications
You must be signed in to change notification settings - Fork 1
/
gui.py
54 lines (51 loc) · 2.56 KB
/
gui.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
#simplt gui for archiver
import tkinter as tk
import main as archiver
from tkinter import messagebox
def get_files_count(archive_name, password):
messagebox.showinfo("Files Count", "Files Count: " + str(archiver.get_files_count(archive_name, password)))
def interface():
root = tk.Tk()
root.title("Archiver")
root.geometry("300x580")
root.resizable(False, False)
root.configure(background='#f0f0f0')
Title = tk.Label(root, text="Archiver", font=("Helvetica", 16), bg='#f0f0f0')
Title.pack(pady=10)
input_folder = tk.StringVar()
input_folder.set("Input Folder")
input_folder_label = tk.Label(root, textvariable=input_folder, bg='#f0f0f0')
input_folder_label.pack(pady=10)
input_folder_entry = tk.Entry(root, width=30)
input_folder_entry.pack(pady=10)
output_folder = tk.StringVar()
output_folder.set("Output Folder")
output_folder_label = tk.Label(root, textvariable=output_folder, bg='#f0f0f0')
output_folder_label.pack(pady=10)
output_folder_entry = tk.Entry(root, width=30)
output_folder_entry.pack(pady=10)
password = tk.StringVar()
password.set("Password")
password_label = tk.Label(root, textvariable=password, bg='#f0f0f0')
password_label.pack(pady=10)
password_entry = tk.Entry(root, width=30)
password_entry.pack(pady=10)
archive_name = tk.StringVar()
archive_name.set("Archive Name")
archive_name_label = tk.Label(root, textvariable=archive_name, bg='#f0f0f0')
archive_name_label.pack(pady=10)
archive_name_entry = tk.Entry(root, width=30)
archive_name_entry.pack(pady=10)
kmeans_check = tk.IntVar()
kmeans_check.set(0)
kmeans_check_button = tk.Checkbutton(root, text="K-Means", variable=kmeans_check, bg='#f0f0f0')
kmeans_check_button.pack(pady=10)
make_archive_button = tk.Button(root, text="Make Archive", command=lambda: archiver.make_archive(archive_name_entry.get(), input_folder_entry.get(), password_entry.get(), output_folder_entry.get(), kmeans_check.get()), bg='#f0f0f0')
make_archive_button.pack(pady=10)
open_archive_button = tk.Button(root, text="Open Archive", command=lambda: archiver.open_archive(archive_name_entry.get(), output_folder_entry.get(), password_entry.get()))
open_archive_button.pack(pady=10)
get_files_count_button = tk.Button(root, text="Get Files Count", command=lambda: get_files_count(archive_name_entry.get(), password_entry.get()), bg='#f0f0f0')
get_files_count_button.pack(pady=10)
root.mainloop()
if __name__ == "__main__":
interface()