Skip to content

Commit f3eef5c

Browse files
committed
✨ improve folder dialog for PythonPath, set str explicitly for Windows
- On windows the Path set by the user globally are probably seen (it seems) - check if a path is set for directory dialog, if not start at home directory
1 parent f300e1a commit f3eef5c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

gui/app.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def inner():
127127
[
128128
quarto_bin_path,
129129
quarto_share_path,
130-
python_dir_entry.get(),
130+
str(
131+
Path(python_dir_entry.get())
132+
), # ! check if this return WindowsPaths on Windows
131133
_PATH,
132134
]
133135
)
@@ -183,7 +185,10 @@ def radio_button_callback():
183185

184186
def create_select_directory(string_var):
185187
def select_directory():
186-
directory = filedialog.askdirectory(initialdir=string_var.get())
188+
inital_dir = string_var.get()
189+
if not inital_dir:
190+
inital_dir = Path.home()
191+
directory = filedialog.askdirectory(initialdir=inital_dir)
187192
string_var.set(directory)
188193

189194
return select_directory

0 commit comments

Comments
 (0)