Browse Source

run.py RestoreLastBackLightBrightness bug fix

cuu 4 years ago
parent
commit
42fd86bce6
3 changed files with 26 additions and 13 deletions
  1. 22 5
      Menu/GameShell/21_Warehouse/__init__.py
  2. 2 2
      sys.py/UI/title_bar.py
  3. 2 6
      sys.py/run.py

+ 22 - 5
Menu/GameShell/21_Warehouse/__init__.py

@@ -817,7 +817,7 @@ class GameStorePage(Page):
             self._FootMsg[2] = "Remove"
             self._FootMsg[1] = "UpdateWare"
         else:
-            self._FootMsg[2] = "Up"
+            self._FootMsg[2] = ""
             self._FootMsg[1] = ""
 
         self.SyncList()
@@ -831,9 +831,24 @@ class GameStorePage(Page):
         """
     def KeyDown(self,event):
         if IsKeyMenuOrB(event.key):
-            self.ReturnToUpLevelPage()
-            self._Screen.Draw()
-            self._Screen.SwapAndShow()
+
+            if self._MyStack.Length() > 1:
+               self._MyStack.Pop()
+               if self._MyStack.Length() == 1:
+                   self._FootMsg[2] = "Remove"
+                   self._FootMsg[1] = "UpdateWare"
+               else:
+                   self._FootMsg[2] = ""
+                   self._FootMsg[1] = "Preview"
+
+               self.SyncList()
+               self._Screen.Draw()
+               self._Screen.SwapAndShow()
+
+            elif self._MyStack.Length() == 1:
+                self.ReturnToUpLevelPage()
+                self._Screen.Draw()
+                self._Screen.SwapAndShow()
 
         if IsKeyStartOrA(event.key):
             self.Click()
@@ -842,7 +857,7 @@ class GameStorePage(Page):
                 self._FootMsg[2] = "Remove"
                 self._FootMsg[1] = "UpdateWare"
             else:
-                self._FootMsg[2] = "Up"
+                self._FootMsg[2] = ""
                 self._FootMsg[1] = "Preview"
 
             self._Screen.Draw()
@@ -858,6 +873,7 @@ class GameStorePage(Page):
                 self._Screen.SwapAndShow()
                 return 
 
+            """
             if self._MyStack.Length() > 1:
                self._MyStack.Pop()
                if self._MyStack.Length() == 1:
@@ -866,6 +882,7 @@ class GameStorePage(Page):
                else:
                    self._FootMsg[2] = "Up"
                    self._FootMsg[1] = "Preview"
+            """
 
             self.SyncList()
             self._Screen.Draw()

+ 2 - 2
sys.py/UI/title_bar.py

@@ -183,11 +183,11 @@ class TitleBar(Widget):
                     self._Icons["battery_charging"]._IconIndex = cap_ge
                     self._Icons["battery"] = self._Icons["battery_charging"]
             
-                    print("Charging %d" % cap_ge)
+                    #print("Charging %d" % cap_ge)
                 else:
                     self._Icons["battery_discharging"]._IconIndex = cap_ge
                     self._Icons["battery"] = self._Icons["battery_discharging"]
-                    print("Discharging %d" % cap_ge)
+                    #print("Discharging %d" % cap_ge)
                     
                 
         return True

+ 2 - 6
sys.py/run.py

@@ -163,11 +163,9 @@ def RestoreLastBackLightBrightness(main_screen):
                 f.seek(0)
                 f.write(str( last_brt ))
                 f.truncate()
-                f.close()
-                last_brt = -1
-            else:                
-                f.close()
 
+            f.close() 
+            last_brt = -1
     try:
         f = open("/proc/driver/led1","w")
     except IOError:
@@ -198,7 +196,6 @@ def InspectionTeam(main_screen):
     
     if cur_time - everytime_keydown > time_1 and passout_time_stage == 0:
         print("timeout, dim screen %d" % int(cur_time - everytime_keydown))
-
         try:
             f = open(config.BackLight,"r+")
         except IOError:
@@ -226,7 +223,6 @@ def InspectionTeam(main_screen):
     
     elif cur_time - everytime_keydown > time_2 and passout_time_stage == 1:
         print("timeout, close screen %d" % int(cur_time - everytime_keydown))
-        
         try:
             f = open(config.BackLight,"r+")
         except IOError: