From 9ee9a77f12f1c7bfd4b7e5c9172f79d2cca1400e Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:25:37 +0800 Subject: [PATCH] warn outdated GUI (+1 squashed commits) Squashed commits: [15aec3d] spelling error --- koboldcpp.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/koboldcpp.py b/koboldcpp.py index b088b87db5031..da1283b2dd8f7 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -997,10 +997,18 @@ def switch_old_gui(): time.sleep(2) sys.exit(2) +def show_gui_warning(): + from tkinter import messagebox + import tkinter as tk + root = tk.Tk() + root.attributes("-alpha", 0) + messagebox.showerror(title="New GUI failed, using Old GUI", message="The new GUI failed to load.\n\nTo use new GUI, please install the customtkinter python module.") + root.destroy() def show_old_gui(): import tkinter as tk from tkinter.filedialog import askopenfilename + from tkinter import messagebox if len(sys.argv) == 1: #no args passed at all. Show nooby gui @@ -1078,7 +1086,7 @@ def onDropdownChange(event): # Create button, it will change label text tk.Button(root , text = "Launch", font = ("Impact", 18), bg='#54FA9B', command = guilaunch ).grid(row=6,column=0) - tk.Label(root, text = "(Please use the Command Line for more advanced options)", + tk.Label(root, text = "(Please use the Command Line for more advanced options)\nThis GUI is deprecated. Please install customtkinter.", font = ("Arial", 9)).grid(row=7,column=0) root.mainloop() @@ -1166,9 +1174,11 @@ def main(args): show_new_gui() except Exception as ex: print("Failed to use new GUI. Reason: " + str(ex)) - print("Attempting to us old GUI...") + print("Make sure customtkinter is installed!!!") + print("Attempting to use old GUI...") if not args.model_param: try: + show_gui_warning() show_old_gui() except Exception as ex2: print("File selection GUI unsupported. Please check command line: script.py --help")