Compare commits
2 Commits
91a0eabc1e
...
fc3feba657
| Author | SHA1 | Date | |
|---|---|---|---|
| fc3feba657 | |||
| 034cb8059d |
@ -213,8 +213,16 @@ with col1:
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
root.wm_attributes('-topmost', 1)
|
||||
path = filedialog.askdirectory(title="Select Source Directory")
|
||||
if path:
|
||||
root.after(10) # Add a small delay
|
||||
# Create and run the main loop in a way that doesn't block
|
||||
path_holder = []
|
||||
def select_dir():
|
||||
path = filedialog.askdirectory(title="Select Source Directory")
|
||||
path_holder.append(path)
|
||||
root.quit()
|
||||
root.after(20, select_dir)
|
||||
root.mainloop()
|
||||
if path_holder and path_holder[0]:
|
||||
st.session_state['source_dir_selected'] = path
|
||||
st.rerun()
|
||||
root.destroy()
|
||||
@ -262,8 +270,16 @@ with col1:
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
root.wm_attributes('-topmost', 1)
|
||||
path = filedialog.askdirectory(title="Select Destination Directory")
|
||||
if path:
|
||||
root.after(10) # Add a small delay
|
||||
# Create and run the main loop in a way that doesn't block
|
||||
path_holder = []
|
||||
def select_dir():
|
||||
path = filedialog.askdirectory(title="Select Destination Directory")
|
||||
path_holder.append(path)
|
||||
root.quit()
|
||||
root.after(20, select_dir)
|
||||
root.mainloop()
|
||||
if path_holder and path_holder[0]:
|
||||
st.session_state['dest_dir_selected'] = path
|
||||
st.rerun()
|
||||
root.destroy()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user