From c0f0cc8ab931bbd038f8b9478e79a6d3fa8d4dd0 Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Wed, 31 Mar 2021 17:10:49 -0400 Subject: [PATCH] Update v1.12.py --- src/unstable/v1.12.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/unstable/v1.12.py b/src/unstable/v1.12.py index 2ec4c88..097d31a 100644 --- a/src/unstable/v1.12.py +++ b/src/unstable/v1.12.py @@ -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)"