pygui: changes to allow adding directory paths that do not exist within gui for customizing services
This commit is contained in:
parent
eb1a9e2fe4
commit
8d303bdc2a
1 changed files with 5 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tkinter import filedialog, ttk
|
from tkinter import filedialog, messagebox, ttk
|
||||||
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple
|
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple
|
||||||
|
|
||||||
import grpc
|
import grpc
|
||||||
|
@ -576,12 +576,13 @@ class ServiceConfigDialog(Dialog):
|
||||||
self.directory_entry.insert("end", d)
|
self.directory_entry.insert("end", d)
|
||||||
|
|
||||||
def add_directory(self) -> None:
|
def add_directory(self) -> None:
|
||||||
directory = self.directory_entry.get()
|
directory = Path(self.directory_entry.get())
|
||||||
directory = Path(directory)
|
if directory.is_absolute():
|
||||||
if directory.is_dir():
|
|
||||||
if str(directory) not in self.temp_directories:
|
if str(directory) not in self.temp_directories:
|
||||||
self.dir_list.listbox.insert("end", directory)
|
self.dir_list.listbox.insert("end", directory)
|
||||||
self.temp_directories.append(str(directory))
|
self.temp_directories.append(str(directory))
|
||||||
|
else:
|
||||||
|
messagebox.showerror("Add Directory", "Path must be absolute!", parent=self)
|
||||||
|
|
||||||
def remove_directory(self) -> None:
|
def remove_directory(self) -> None:
|
||||||
d = self.directory_entry.get()
|
d = self.directory_entry.get()
|
||||||
|
|
Loading…
Reference in a new issue