pygui added error dialog for duplicate observer names and cleared out values on success
This commit is contained in:
parent
039cf2a3b9
commit
6fe2845051
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue