1
0
Fork 0
mirror of https://github.com/HACKERALERT/Picocrypt.git synced 2024-12-29 19:02:43 +00:00

Update v1.12.py

This commit is contained in:
Evan Su 2021-03-31 17:10:49 -04:00 committed by GitHub
parent 3fa104b028
commit c0f0cc8ab9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,19 +213,23 @@ orLabel = tkinter.ttk.Label(
orLabel.place(x=360,y=68)
def saveAs():
global mode
global mode,onlyFiles,onlyFolders
dummy.focus()
encryptTypes = (("Picocrypt Volume","*.pcv"),("All Files","*.*"))
decryptTypes = (("All Files","*.*"),("Picocrypt Volume","*.pcv"))
if inputFile:
saveDir = dirname(inputFile)
elif onlyFiles:
saveDir = dirname(onlyFiles[0])
else:
saveDir = Path(onlyFolders[0]).parent.absolute()
tmp = asksaveasfilename(
initialdir=expanduser("~"),
initialdir=saveDir,
initialfile=(
basename(inputFile)[:-4] if mode=="decrypt" else basename(inputFile)
basename(inputFile)[:-4] if mode=="decrypt" else basename(inputFile)+".pcv"
),
filetypes=((encryptTypes) if mode=="encrypt" else (decryptTypes))
confirmoverwrite=True
)
outputInput.delete(0,tkinter.END)
outputInput.insert(0,tmp)
outputInput.insert(0,(tmp if mode=="decrypt" else tmp[:-4]))
saveAsBtn = tkinter.ttk.Button(
tk,
text="Save as",
@ -671,6 +675,7 @@ def filesDragged(draggedFiles):
tmp = Path(onlyFolders[0]).parent.absolute()
tmp = pathJoin(tmp,"Encrypted.zip")
tmp = tmp.replace("\\","/")
inputFile = tmp
outputInput.insert(0,tmp)
suffix = " (will encrypt)"