1
0
Fork 0
mirror of https://github.com/HACKERALERT/Picocrypt.git synced 2024-09-20 09:46: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) orLabel.place(x=360,y=68)
def saveAs(): def saveAs():
global mode global mode,onlyFiles,onlyFolders
dummy.focus() dummy.focus()
encryptTypes = (("Picocrypt Volume","*.pcv"),("All Files","*.*")) if inputFile:
decryptTypes = (("All Files","*.*"),("Picocrypt Volume","*.pcv")) saveDir = dirname(inputFile)
elif onlyFiles:
saveDir = dirname(onlyFiles[0])
else:
saveDir = Path(onlyFolders[0]).parent.absolute()
tmp = asksaveasfilename( tmp = asksaveasfilename(
initialdir=expanduser("~"), initialdir=saveDir,
initialfile=( 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.delete(0,tkinter.END)
outputInput.insert(0,tmp) outputInput.insert(0,(tmp if mode=="decrypt" else tmp[:-4]))
saveAsBtn = tkinter.ttk.Button( saveAsBtn = tkinter.ttk.Button(
tk, tk,
text="Save as", text="Save as",
@ -671,6 +675,7 @@ def filesDragged(draggedFiles):
tmp = Path(onlyFolders[0]).parent.absolute() tmp = Path(onlyFolders[0]).parent.absolute()
tmp = pathJoin(tmp,"Encrypted.zip") tmp = pathJoin(tmp,"Encrypted.zip")
tmp = tmp.replace("\\","/") tmp = tmp.replace("\\","/")
inputFile = tmp
outputInput.insert(0,tmp) outputInput.insert(0,tmp)
suffix = " (will encrypt)" suffix = " (will encrypt)"