bugfix can't cancel dir find in config
This commit is contained in:
@@ -32,11 +32,11 @@ class SettingsWindow(tk.Toplevel):
|
||||
|
||||
tk.Label(path_frame, text="Datenpfad JSON Datei").grid(row=0, column=0)
|
||||
tk.Entry(path_frame, textvariable=self.json_file, width=50).grid(row=1, column=0)
|
||||
tk.Button(path_frame, text="Pfad", command=self.set_json_path).grid(row=1, column=1)
|
||||
tk.Button(path_frame, text="Pfad", command=lambda: self.set_json_path(self.json_file.get())).grid(row=1, column=1)
|
||||
|
||||
tk.Label(path_frame, text="Datenpfad CSV Export Datei").grid(row=2, column=0)
|
||||
tk.Entry(path_frame, textvariable=self.csv_file, width=50).grid(row=3, column=0)
|
||||
tk.Button(path_frame, text="Pfad", command=self.set_csv_path).grid(row=3, column=1)
|
||||
tk.Button(path_frame, text="Pfad", command=lambda: self.set_csv_path(self.csv_file.get())).grid(row=3, column=1)
|
||||
|
||||
bottom_frame = tk.Frame(self)
|
||||
bottom_frame.pack()
|
||||
@@ -45,11 +45,17 @@ class SettingsWindow(tk.Toplevel):
|
||||
|
||||
self.load_config()
|
||||
|
||||
def set_json_path(self):
|
||||
self.json_file.set(filedialog.askdirectory(initialdir="~/", title="Datenpfad JSON Datei"))
|
||||
def set_json_path(self, initial_dir: str = ""):
|
||||
initial_dir = "~/" if initial_dir == "" else initial_dir
|
||||
new_path = filedialog.askdirectory(initialdir=initial_dir, title="Datenpfad JSON Datei")
|
||||
new_path = initial_dir if len(new_path) == 0 else new_path
|
||||
self.json_file.set(new_path)
|
||||
|
||||
def set_csv_path(self):
|
||||
self.csv_file.set(filedialog.askdirectory(initialdir="~/", title="Datenpfad CSV Datei"))
|
||||
def set_csv_path(self, initial_dir: str = ""):
|
||||
initial_dir = "~/" if initial_dir == "" else initial_dir
|
||||
new_path = filedialog.askdirectory(initialdir=initial_dir, title="Datenpfad CSV Datei")
|
||||
new_path = initial_dir if len(new_path) == 0 else new_path
|
||||
self.csv_file.set(new_path)
|
||||
|
||||
def load_config(self):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user