Browse Source

fix: RESTART ... PRO,EASY,RESTART,ctl+c

micha 3 months ago
parent
commit
03fc2f543b
6 changed files with 21 additions and 11 deletions
  1. 4 0
      _LibreLightDesk.py
  2. 2 0
      lib/libtk.py
  3. 2 2
      lib/tkevent.py
  4. 7 6
      tkgui/EXEC-BTN.py
  5. 1 1
      tkgui/GUI.py
  6. 5 2
      tkray/dmx.py

+ 4 - 0
_LibreLightDesk.py

@@ -2678,6 +2678,10 @@ if __run_main:
             cprint(" - EXIT -",color="red")
             BASE_PATH = "/opt/LibreLight/Xdesk/"
             movewin.process_kill(BASE_PATH+"tksdl/")
+            modes.val("EXIT",1) # set MODES EXIT 
+            time.sleep(2)
+            del modes.modes["EXIT"] #val("EXIT",0) # set MODES EXIT 
+            time.sleep(1)
             master.exit()
             sys.exit()
 

+ 2 - 0
lib/libtk.py

@@ -419,6 +419,8 @@ def tk_keyboard_callback(event,data={}):#value=255):
                 b.blink()
             if str(event.keysym) == "c":
                 if MAIN.save_show():
+                    MAIN.modes.val("RESTART C",1)
+                    time.sleep(1)
                     MAIN.LOAD_SHOW_AND_RESTART("").cb(force=1)
 
             return

+ 2 - 2
lib/tkevent.py

@@ -130,14 +130,14 @@ class tk_event():
         elif self.attr == "PRO\nMODE":
             MAIN.save_show()
             MAIN.modes.val(self.attr,1)
-
+            time.sleep(1)
             import lib.restart as restart
             restart.pro()
 
         elif self.attr == "EASY\nMODE":
             MAIN.save_show()
             MAIN.modes.val(self.attr,1)
-
+            time.sleep(1)
             import lib.restart as restart
             restart.easy()
         else:

+ 7 - 6
tkgui/EXEC-BTN.py

@@ -545,12 +545,13 @@ def _refr_loop2():
                     _global_short_key = 1
 
             for k in data:
-                print("title",k)
-                if "RESTART" in k or "PRO" in k or "EAYS" in k:
-                    print("RESTART !!!")
-                    time.sleep(0.5)
-                    root.quit()
-                    #sys.exit()
+                #print("title",k)
+                for kk in ["RESTART","PRO","EASY","EXIT"]:
+                    if kk in str(k):
+                        print("RESTART !!! EXIT !!")
+                        time.sleep(0.1)
+                        root.quit()
+                        #sys.exit()
 
         except Exception as e:
             print("  ER7R mc...",e)

+ 1 - 1
tkgui/GUI.py

@@ -1263,7 +1263,7 @@ class GUI_menu():
         for rows in BUF:
             h=2
             for b in rows:
-                print("b",type(b))
+                #print("b",type(b))
                 text=""
                 if r > 6:
                     h=1

+ 5 - 2
tkray/dmx.py

@@ -329,8 +329,11 @@ while not pyray.window_should_close():
             modes_time = time.time()
             modes_data = mc.get("MODES")
             pyray.set_window_title("RAY-DMX "+str(modes_data))
-            if "RESTART" in str(modes_data) or "PRO" in str(modes_data) or "EASY" in str(modes_data):
-                pyray.close_window()
+            for k in ["RESTART","PRO","EASY","EXIT"]:
+                if k in str(modes_data):
+                    pyray.close_window()
+                    exit()
+
     except Exception as e:# KeyInterupt
         print("err",e)
         import traceback