pygui added error dialog for duplicate observer names and cleared out values on success

This commit is contained in:
Blake Harnden 2020-04-22 11:41:09 -07:00
parent 039cf2a3b9
commit 6fe2845051

View file

@ -1,5 +1,5 @@
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox, ttk
from typing import TYPE_CHECKING
from core.gui.coreclient import Observer
@ -104,7 +104,11 @@ class ObserverDialog(Dialog):
observer = Observer(name, cmd)
self.app.core.custom_observers[name] = observer
self.observers.insert(tk.END, name)
self.name.set("")
self.cmd.set("")
self.app.menubar.draw_custom_observers()
else:
messagebox.showerror("Observer Error", f"{name} already exists")
def click_save(self):
name = self.name.get()