mirror of
https://github.com/HACKERALERT/Picocrypt.git
synced 2025-01-04 05:38:31 +00:00
Update v2.py
This commit is contained in:
parent
5ba6a01b87
commit
dff49a8792
1 changed files with 33 additions and 13 deletions
|
@ -258,7 +258,7 @@ metadataLabel["state"] = "disabled"
|
||||||
# Frame so metadata box can fill width
|
# Frame so metadata box can fill width
|
||||||
metadataFrame = tkinter.Frame(
|
metadataFrame = tkinter.Frame(
|
||||||
tk,
|
tk,
|
||||||
width=440,
|
width=439,
|
||||||
height=99
|
height=99
|
||||||
)
|
)
|
||||||
metadataFrame.place(x=20,y=220)
|
metadataFrame.place(x=20,y=220)
|
||||||
|
@ -271,13 +271,30 @@ metadataFrame.config(bg="#e5eaf0")
|
||||||
metadataInput = tkinter.scrolledtext.ScrolledText(
|
metadataInput = tkinter.scrolledtext.ScrolledText(
|
||||||
metadataFrame,
|
metadataFrame,
|
||||||
exportselection=0,
|
exportselection=0,
|
||||||
height=5
|
height=5,
|
||||||
|
padx=5,
|
||||||
|
pady=5
|
||||||
)
|
)
|
||||||
metadataInput.config(font=("Consolas",12))
|
metadataInput.config(font=("Consolas",12))
|
||||||
metadataInput.grid(row=0,column=0,sticky="nesw",padx=1,pady=1)
|
metadataInput.grid(row=0,column=0,sticky="nesw",padx=1,pady=1)
|
||||||
metadataInput.config(borderwidth=0)
|
metadataInput.config(borderwidth=0)
|
||||||
metadataInput.config(bg="#fbfcfc")
|
metadataInput.config(bg="#fbfcfc")
|
||||||
metadataInput["state"] = "disabled"
|
metadataInput["state"] = "disabled"
|
||||||
|
metadataInput.bind(
|
||||||
|
"<FocusIn>",
|
||||||
|
lambda e:metadataBoxUI("in")
|
||||||
|
)
|
||||||
|
metadataInput.bind(
|
||||||
|
"<FocusOut>",
|
||||||
|
lambda e:metadataBoxUI("out")
|
||||||
|
)
|
||||||
|
# Tkinter's Text() boxes are ugly, so I beautify it manually
|
||||||
|
def metadataBoxUI(what):
|
||||||
|
if what=="in":
|
||||||
|
if metadataInput.cget("bg")=="#ffffff":
|
||||||
|
metadataFrame.config(bg="#78a7e5")
|
||||||
|
else:
|
||||||
|
metadataFrame.config(bg="#d8ddea")
|
||||||
|
|
||||||
# Check box for keeping corrupted or modified output
|
# Check box for keeping corrupted or modified output
|
||||||
keep = tkinter.IntVar(tk)
|
keep = tkinter.IntVar(tk)
|
||||||
|
@ -292,7 +309,6 @@ keepBtn = tkinter.ttk.Checkbutton(
|
||||||
keepBtn.place(x=18,y=329)
|
keepBtn.place(x=18,y=329)
|
||||||
keepBtn["state"] = "disabled"
|
keepBtn["state"] = "disabled"
|
||||||
|
|
||||||
|
|
||||||
# Check box for securely erasing original files
|
# Check box for securely erasing original files
|
||||||
erase = tkinter.IntVar(tk)
|
erase = tkinter.IntVar(tk)
|
||||||
eraseBtn = tkinter.ttk.Checkbutton(
|
eraseBtn = tkinter.ttk.Checkbutton(
|
||||||
|
@ -355,7 +371,7 @@ progress = tkinter.ttk.Progressbar(
|
||||||
length=440,
|
length=440,
|
||||||
mode="determinate"
|
mode="determinate"
|
||||||
)
|
)
|
||||||
progress.place(x=20,y=438)
|
progress.place(x=20,y=439)
|
||||||
|
|
||||||
# Status label
|
# Status label
|
||||||
statusString = tkinter.StringVar(tk)
|
statusString = tkinter.StringVar(tk)
|
||||||
|
@ -364,9 +380,9 @@ status = tkinter.ttk.Label(
|
||||||
tk,
|
tk,
|
||||||
textvariable=statusString
|
textvariable=statusString
|
||||||
)
|
)
|
||||||
status.place(x=20,y=450)
|
status.place(x=20,y=453)
|
||||||
|
|
||||||
# Credits :)
|
# Credits :D
|
||||||
hint = "Created by Evan Su. Click for details and source."
|
hint = "Created by Evan Su. Click for details and source."
|
||||||
creditsString = tkinter.StringVar(tk)
|
creditsString = tkinter.StringVar(tk)
|
||||||
creditsString.set(hint)
|
creditsString.set(hint)
|
||||||
|
@ -382,13 +398,13 @@ credits["state"] = "disabled"
|
||||||
|
|
||||||
# Version
|
# Version
|
||||||
versionString = tkinter.StringVar(tk)
|
versionString = tkinter.StringVar(tk)
|
||||||
versionString.set("v2.0")
|
versionString.set("v1.12")
|
||||||
version = tkinter.ttk.Label(
|
version = tkinter.ttk.Label(
|
||||||
tk,
|
tk,
|
||||||
textvariable=versionString
|
textvariable=versionString
|
||||||
)
|
)
|
||||||
version["state"] = "disabled"
|
version["state"] = "disabled"
|
||||||
version.place(x=435,y=480)
|
version.place(x=430,y=480)
|
||||||
|
|
||||||
# Files have been dragged
|
# Files have been dragged
|
||||||
def filesDragged(draggedFiles):
|
def filesDragged(draggedFiles):
|
||||||
|
@ -879,6 +895,7 @@ def resetUI():
|
||||||
cPasswordInput["state"] = "disabled"
|
cPasswordInput["state"] = "disabled"
|
||||||
metadataFrame.config(bg="#e5eaf0")
|
metadataFrame.config(bg="#e5eaf0")
|
||||||
metadataInput.config(bg="#fbfcfc")
|
metadataInput.config(bg="#fbfcfc")
|
||||||
|
metadataInput.config(fg="#000000")
|
||||||
metadataString.set(strings[0])
|
metadataString.set(strings[0])
|
||||||
metadataLabel["state"] = "disabled"
|
metadataLabel["state"] = "disabled"
|
||||||
metadataInput["state"] = "normal"
|
metadataInput["state"] = "normal"
|
||||||
|
@ -907,8 +924,9 @@ def setEncryptionUI():
|
||||||
cPasswordLabel["state"] = "normal"
|
cPasswordLabel["state"] = "normal"
|
||||||
cPasswordString.set("Confirm password:")
|
cPasswordString.set("Confirm password:")
|
||||||
cPasswordInput["state"] = "normal"
|
cPasswordInput["state"] = "normal"
|
||||||
metadataFrame.config(bg="#dfe4ee")
|
metadataFrame.config(bg="#d8ddea")
|
||||||
metadataInput.config(background="#ffffff")
|
metadataInput.config(bg="#ffffff")
|
||||||
|
metadataInput.config(fg="#000000")
|
||||||
metadataLabel["state"] = "normal"
|
metadataLabel["state"] = "normal"
|
||||||
metadataInput["state"] = "normal"
|
metadataInput["state"] = "normal"
|
||||||
eraseBtn["state"] = "normal"
|
eraseBtn["state"] = "normal"
|
||||||
|
@ -926,8 +944,9 @@ def setDecryptionUI():
|
||||||
passwordLabel["state"] = "normal"
|
passwordLabel["state"] = "normal"
|
||||||
passwordInput["state"] = "normal"
|
passwordInput["state"] = "normal"
|
||||||
cPasswordString.set("Confirm password (N/A):")
|
cPasswordString.set("Confirm password (N/A):")
|
||||||
metadataFrame.config(bg="#959aa0")
|
metadataFrame.config(bg="#e5eaf0")
|
||||||
metadataInput.config(background="#fbfcfc")
|
metadataInput.config(bg="#fbfcfc")
|
||||||
|
metadataInput.config(fg="#666666")
|
||||||
metadataString.set(strings[19])
|
metadataString.set(strings[19])
|
||||||
metadataInput["state"] = "disabled"
|
metadataInput["state"] = "disabled"
|
||||||
keepBtn["state"] = "normal"
|
keepBtn["state"] = "normal"
|
||||||
|
@ -944,7 +963,8 @@ def disableAllInputs():
|
||||||
cPasswordInput["state"] = "disabled"
|
cPasswordInput["state"] = "disabled"
|
||||||
cPasswordString.set("Confirm password:")
|
cPasswordString.set("Confirm password:")
|
||||||
metadataFrame.config(bg="#e5eaf0")
|
metadataFrame.config(bg="#e5eaf0")
|
||||||
metadataInput.config(background="#fbfcfc")
|
metadataInput.config(bg="#fbfcfc")
|
||||||
|
metadataInput.config(fg="#666666")
|
||||||
metadataInput["state"] = "disabled"
|
metadataInput["state"] = "disabled"
|
||||||
startBtn["state"] = "disabled"
|
startBtn["state"] = "disabled"
|
||||||
eraseBtn["state"] = "disabled"
|
eraseBtn["state"] = "disabled"
|
||||||
|
|
Loading…
Reference in a new issue