From 2d004fbe63bdabcaa87d581243fde9ec5e95c30a Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 24 Oct 2023 05:29:52 -0500 Subject: [PATCH] Allow user to change and save output directory within the Gui --- resources/app/gui/lang/en.json | 2 +- source/gui/bottom.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/app/gui/lang/en.json b/resources/app/gui/lang/en.json index 66aefd98..8a6a0212 100644 --- a/resources/app/gui/lang/en.json +++ b/resources/app/gui/lang/en.json @@ -391,7 +391,7 @@ "bottom.content.dialog.error": "Error while creating seed", "bottom.content.dialog.success": "Success", "bottom.content.dialog.success.message": "Rom created successfully.", - "bottom.content.outputdir": "Open Output Directory", + "bottom.content.outputdir": "Select Destination", "bottom.content.docs": "Open Documentation" } } diff --git a/source/gui/bottom.py b/source/gui/bottom.py index beb77a1f..4c21621e 100644 --- a/source/gui/bottom.py +++ b/source/gui/bottom.py @@ -154,6 +154,12 @@ def bottom_frame(self, parent, args=None): open_file(output_path('.')) + def select_output(): + from tkinter import filedialog + folder_selected = filedialog.askdirectory() + if folder_selected is not None: + args.outputpath = parent.settings["outputpath"] = folder_selected + ## Output Button # widget ID widget = "outputdir" @@ -168,7 +174,7 @@ def bottom_frame(self, parent, args=None): # button self.widgets[widget].type = "button" - self.widgets[widget].pieces["button"] = Button(self, text='Open Output Directory', command=open_output) + self.widgets[widget].pieces["button"] = Button(self, text='Open Output Directory', command=select_output) # button: pack self.widgets[widget].pieces["button"].pack(side=RIGHT)