Fix save as issue

This commit is contained in:
bmaltais 2022-12-19 09:47:35 -05:00
parent c9a62dd038
commit 61a9481903
2 changed files with 8 additions and 3 deletions

View File

@ -84,7 +84,7 @@ def save_configuration(
# )
file_path = get_saveasfile_path(file_path)
if file_path == None:
if file_path == None or file_path == '':
return original_file_path # In case a file_path was provided and the user decide to cancel the open action
# Return the values of the variables as a dictionary

View File

@ -44,11 +44,16 @@ def get_saveasfile_path(file_path='', defaultextension='.json'):
root = Tk()
root.wm_attributes('-topmost', 1)
root.withdraw()
file_path = filedialog.asksaveasfile(filetypes = (("Config files", "*.json"), ("All files", "*")), defaultextension=defaultextension)
save_file_path = filedialog.asksaveasfile(filetypes = (("Config files", "*.json"), ("All files", "*")), defaultextension=defaultextension)
root.destroy()
file_path = file_path.name
# file_path = file_path.name
if file_path == '':
file_path = current_file_path
else:
print(save_file_path.name)
file_path = save_file_path.name
print(file_path)
return file_path