[FREELDR]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 26 Dec 2012 02:14:46 +0000 (02:14 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 26 Dec 2012 02:14:46 +0000 (02:14 +0000)
Improve the way we are doing the timing: When the timeout is > 0, we refresh its display. When it becomes == 0, we exit the waiting-loop and do the right action (start the default OS, ...). However, when we press a key, it is set to -1 by convention, that means, no timeout. The timeout display is then cleared ONLY ONCE since there is no need to refresh it each time we do a waiting-loop-turn when the timeout is == -1.

svn path=/trunk/; revision=58010

reactos/boot/freeldr/freeldr/ui/directui.c
reactos/boot/freeldr/freeldr/ui/tuimenu.c

index 9a54e1c..19f9b08 100644 (file)
@@ -560,7 +560,7 @@ UiDisplayMenu(IN PCSTR MenuHeader,
         if (CanEscape && KeyPress == KEY_ESC) return FALSE;
 
         /* Check if there is a countdown */
-        if (MenuInformation.MenuTimeRemaining)
+        if (MenuInformation.MenuTimeRemaining > 0)
         {
             /* Get the updated time, seconds only */
             CurrentClockSecond = ArcGetTime()->Second;
@@ -576,7 +576,7 @@ UiDisplayMenu(IN PCSTR MenuHeader,
                 UiDrawMenuBox(&MenuInformation);
             }
         }
-        else
+        else if (MenuInformation.MenuTimeRemaining == 0)
         {
             /* A time out occurred, exit this loop and return default OS */
             break;
index ee43f38..ad7822e 100644 (file)
@@ -93,7 +93,7 @@ TuiDisplayMenu(PCSTR MenuHeader,
         //
         // Check if there is a countdown
         //
-        if (MenuInformation.MenuTimeRemaining)
+        if (MenuInformation.MenuTimeRemaining > 0)
         {
             //
             // Get the updated time, seconds only
@@ -118,7 +118,7 @@ TuiDisplayMenu(PCSTR MenuHeader,
                 VideoCopyOffScreenBufferToVRAM();
             }
         }
-        else
+        else if (MenuInformation.MenuTimeRemaining == 0)
         {
             //
             // A time out occurred, exit this loop and return default OS