diff --git a/src/pydiode/gui/main.py b/src/pydiode/gui/main.py index c76c515..e6445fb 100644 --- a/src/pydiode/gui/main.py +++ b/src/pydiode/gui/main.py @@ -1,6 +1,5 @@ import configparser -import os -import pathlib +from pathlib import Path import sys from tkinter import BooleanVar, IntVar, Listbox, StringVar, Tk, ttk @@ -16,7 +15,7 @@ import pydiode.tar # Save the configuration file in the user's home folder -CONFIG = pathlib.Path().home() / ".pydiode.ini" +CONFIG = Path("~/.pydiode.ini").expanduser() def gui_main(): @@ -118,7 +117,9 @@ def gui_main(): ttk.Entry(rx_inner, textvariable=target).grid(column=0, row=1, sticky="EW") rx_inner.columnconfigure(0, weight=1) rx_inner.rowconfigure(1, weight=1) - target.set(config["pydiode"].get("target", os.getcwd())) + target.set( + config["pydiode"].get("target", Path("~/Downloads").expanduser()) + ) ttk.Button( rx_inner, text="Browse...", diff --git a/src/pydiode/gui/send.py b/src/pydiode/gui/send.py index 113b9fe..21a9703 100644 --- a/src/pydiode/gui/send.py +++ b/src/pydiode/gui/send.py @@ -1,4 +1,5 @@ import os +from pathlib import Path import subprocess import sys from tkinter.filedialog import askopenfilenames @@ -26,8 +27,8 @@ def add_source_files(sources_var, sources_list): :param sources_list: A list of the source files currently in the Listbox """ # If files have been added, the dialogue will remember the directory. - # If no files have been added, start at the current working directory. - initialdir = None if sources_list else os.getcwd() + # If no files have been added, start in the Downloads folder. + initialdir = None if sources_list else Path("~/Downloads").expanduser() selected_sources = askopenfilenames(initialdir=initialdir) new_sources = set(selected_sources) - set(sources_list) if new_sources: