Allow user to change and save output directory within the Gui

This commit is contained in:
codemann8
2023-10-24 05:29:52 -05:00
parent c04040cb3e
commit 2d004fbe63
2 changed files with 8 additions and 2 deletions

View File

@@ -391,7 +391,7 @@
"bottom.content.dialog.error": "Error while creating seed", "bottom.content.dialog.error": "Error while creating seed",
"bottom.content.dialog.success": "Success", "bottom.content.dialog.success": "Success",
"bottom.content.dialog.success.message": "Rom created successfully.", "bottom.content.dialog.success.message": "Rom created successfully.",
"bottom.content.outputdir": "Open Output Directory", "bottom.content.outputdir": "Select Destination",
"bottom.content.docs": "Open Documentation" "bottom.content.docs": "Open Documentation"
} }
} }

View File

@@ -154,6 +154,12 @@ def bottom_frame(self, parent, args=None):
open_file(output_path('.')) 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 ## Output Button
# widget ID # widget ID
widget = "outputdir" widget = "outputdir"
@@ -168,7 +174,7 @@ def bottom_frame(self, parent, args=None):
# button # button
self.widgets[widget].type = "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 # button: pack
self.widgets[widget].pieces["button"].pack(side=RIGHT) self.widgets[widget].pieces["button"].pack(side=RIGHT)