]> code.delx.au - refind/commitdiff
Various changes, esp. to "disabled", "hideui", & "showtools"
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 5 Apr 2012 00:03:48 +0000 (20:03 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 5 Apr 2012 00:03:48 +0000 (20:03 -0400)
refind.conf options

NEWS.txt
refind.conf-sample
refind/config.c
refind/config.h
refind/global.h
refind/icns.c
refind/icns.h
refind/main.c
refind/menu.c
refind/screen.c

index e6132fae6fcbb4efece288a8e787ac5736198eae..9896a58d38b87ff480ed97e459a8070d247303fc 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,25 @@
 0.2.4 (?/??/2012):
 ------------------
 
+- Created new refind.conf entry: "showtools". This entry takes options of
+  "shell", "gptsync", "about", "exit", "reboot", and "shutdown". This
+  option is in some respects an affirmative version of portions of the old
+  "disable" and "hideui" options; however, it enables users to specify the
+  order in which these options appear on the screen. Also, the "exit"
+  option is new; it terminates the program. The effect is usually to return
+  to whatever tool launched it or to launch a default OS; however, this is
+  somewhat unpredictable. The default therefore omits the "exit" option, as
+  well as "gptsync", which has always been dangerous (but necessary on most
+  MacOS/Windows dual-boot setups on Macs). As part of this reconfiguration,
+  I've eliminated the "rescue Linux" option, which always seemed pointless
+  to me.
+
+- Folded "disable" and "hideui" refind.conf entries into one ("disable"),
+  and reduced the number of options to six: "banner", "label",
+  "singleuser", "hwtest", "arrows", and "all". ("arrows" is new and
+  disables the scroll arrows when a system has too many tags to display
+  simultaneously.)
+
 - Added max_tags option to the refind.conf file, enabling users to reduce
   the maximum number of OS loader tags that can be displayed at once.
 
index 336a11c72c3b351776a94af7e9ef510383c09f6d..c5c054a34d6ee9f6dc660418a9e88b81689a49a8 100644 (file)
@@ -8,18 +8,17 @@
 #
 timeout 20
 
-# Disable menu options for increased security. These are intended for a lab
-# environment where the administrator doesn't want users to mess with the
-# operating system. List the names for the options you want to hide from
-# the boot menu. Currently supported:
-#  shell       - remove the EFI shell
-#  tools       - remove all EFI tools (shell and gptsync)
+# Disable user interface elements for personal preference or to increase
+# security:
+#  banner      - the rEFInd title banner
+#  label       - text label in the menu
 #  singleuser  - remove the submenu options to boot Mac OS X in single-user
-#                 or verbose modes
-#  hwtest      - remove the submenu option to run Apple Hardware Test
+#                or verbose modes
+#  hwtest      - the submenu option to run Apple's hardware test
+#  arrows      - scroll arrows on the OS selection tag line
 #  all         - all of the above
 #
-#disable shell singleuser
+#disable singleuser
 #disable all
 
 # Use a custom title banner instead of the rEFInd icon and name. The file
@@ -42,30 +41,23 @@ timeout 20
 #selection_big   selection-big.bmp
 #selection_small selection-small.bmp
 
-# Hide various user interface elements. Here you can list the names of
-# interface elements to hide. Currently supported:
-#  banner    - the rEFInd title banner
-#  shell     - the EFI shell icon
-#  tools     - all EFI tools (shell and gptsync)
-#  funcs     - built-in functions (about, restart)
-#    ('tools' and 'funcs' together hide the complete second row of icons.)
-#  label     - text label in the menu
-#  badges    - all volume badges (same as 'hidebadges all'); this setting
-#               is not recommended because it won't let you distinguish
-#               installed OSes and bootable CDs/DVDs.
-#  all       - all of the above, except for 'badges'
-#
-# Note: The 'shell' and 'tools' options are equivalent to the 'disable'
-# options with the same names.
-#
-#hideui tools funcs hdbadges
-#hideui all
-
 # Use text mode only. When enabled, this option forces rEFInd into text mode.
 #
 #textonly
 
-# Which types of boot loaders to search:
+# Which non-bootloader tools to show on the tools line, and in what
+# order to display them:
+#  shell     - the EFI shell
+#  gptsync   - the (dangerous) gptsync.efi utility
+#  about     - an "about this program" option
+#  exit      - a tag to exit from rEFInd
+#  shutdown  - shuts down the computer (a bug causes this to reboot EFI
+#              systems)
+#  reboot    - a tag to reboot the computer
+# Default is shell,about,shutdown,reboot
+#showtools shell, about, reboot
+
+# Which types of boot loaders to search, and in what order to display them:
 #  internal      - internal EFI disk-based boot loaders
 #  external      - external EFI disk-based boot loaders
 #  optical       - EFI optical discs (CD, DVD, etc.)
@@ -169,4 +161,3 @@ menuentry "Windows 7" {
        disabled
 }
 
-# EOF
index 2100a91b2606ff3263b184628bde810189f709d8..c2f6ba446aed8cea08dbf5b742a33793984fe5f3 100644 (file)
@@ -325,18 +325,24 @@ VOID ReadConfig(VOID)
         
         if (StriCmp(TokenList[0], L"timeout") == 0) {
             HandleInt(TokenList, TokenCount, &(GlobalConfig.Timeout));
-            
-        } else if (StriCmp(TokenList[0], L"disable") == 0) {
+
+        // Note: I'm using "hideui" as equivalent to "disable" for the moment (as of rEFInd 0.2.4)
+        // because I've folded two options into one and removed some values, so I want to catch
+        // existing configurations as much as possible. The "hideui" equivalency to "disable" will
+        // be removed sooner or later....
+        } else if ((StriCmp(TokenList[0], L"disable") == 0) || (StriCmp(TokenList[0], L"hideui") == 0)) {
             for (i = 1; i < TokenCount; i++) {
                 FlagName = TokenList[i];
-                if (StriCmp(FlagName, L"shell") == 0) {
-                    GlobalConfig.DisableFlags |= DISABLE_FLAG_SHELL;
-                } else if (StriCmp(FlagName, L"tools") == 0) {
-                    GlobalConfig.DisableFlags |= DISABLE_FLAG_TOOLS;
+                if (StriCmp(FlagName, L"banner") == 0) {
+                   GlobalConfig.DisableFlags |= DISABLE_FLAG_BANNER;
+                } else if (StriCmp(FlagName, L"label") == 0) {
+                   GlobalConfig.DisableFlags |= DISABLE_FLAG_LABEL;
                 } else if (StriCmp(FlagName, L"singleuser") == 0) {
                     GlobalConfig.DisableFlags |= DISABLE_FLAG_SINGLEUSER;
                 } else if (StriCmp(FlagName, L"hwtest") == 0) {
                     GlobalConfig.DisableFlags |= DISABLE_FLAG_HWTEST;
+                } else if (StriCmp(FlagName, L"arrows") == 0) {
+                   GlobalConfig.DisableFlags |= DISABLE_FLAG_ARROWS;
                 } else if (StriCmp(FlagName, L"all") == 0) {
                     GlobalConfig.DisableFlags = DISABLE_ALL;
                 } else {
@@ -351,27 +357,27 @@ VOID ReadConfig(VOID)
               else
                  GlobalConfig.ScanFor[i] = ' ';
            }
-        } else if (StriCmp(TokenList[0], L"hideui") == 0) {
-            for (i = 1; i < TokenCount; i++) {
+        } else if (StriCmp(TokenList[0], L"showtools") == 0) {
+            SetMem(GlobalConfig.ShowTools, NUM_TOOLS * sizeof(UINTN), 0);
+            for (i = 1; (i < TokenCount) && (i < NUM_TOOLS); i++) {
                 FlagName = TokenList[i];
-                if (StriCmp(FlagName, L"banner") == 0) {
-                    GlobalConfig.HideUIFlags |= HIDEUI_FLAG_BANNER;
-                } else if (StriCmp(FlagName, L"shell") == 0) {
-                    GlobalConfig.DisableFlags |= DISABLE_FLAG_SHELL;
-                } else if (StriCmp(FlagName, L"tools") == 0) {
-                    GlobalConfig.DisableFlags |= DISABLE_FLAG_TOOLS;
-                } else if (StriCmp(FlagName, L"funcs") == 0) {
-                    GlobalConfig.HideUIFlags |= HIDEUI_FLAG_FUNCS;
-                } else if (StriCmp(FlagName, L"label") == 0) {
-                    GlobalConfig.HideUIFlags |= HIDEUI_FLAG_LABEL;
-                } else if (StriCmp(FlagName, L"all") == 0) {
-                    GlobalConfig.HideUIFlags = HIDEUI_ALL;
-                    GlobalConfig.DisableFlags |= DISABLE_FLAG_SHELL | DISABLE_FLAG_TOOLS;
+                if (StriCmp(FlagName, L"shell") == 0) {
+                    GlobalConfig.ShowTools[i - 1] = TAG_SHELL;
+                } else if (StriCmp(FlagName, L"gptsync") == 0) {
+                    GlobalConfig.ShowTools[i - 1] = TAG_GPTSYNC;
+                } else if (StriCmp(FlagName, L"about") == 0) {
+                   GlobalConfig.ShowTools[i - 1] = TAG_ABOUT;
+                } else if (StriCmp(FlagName, L"exit") == 0) {
+                   GlobalConfig.ShowTools[i - 1] = TAG_EXIT;
+                } else if (StriCmp(FlagName, L"reboot") == 0) {
+                   GlobalConfig.ShowTools[i - 1] = TAG_REBOOT;
+                } else if (StriCmp(FlagName, L"shutdown") == 0) {
+                   GlobalConfig.ShowTools[i - 1] = TAG_SHUTDOWN;
                 } else {
-                    Print(L" unknown hideui flag: '%s'\n", FlagName);
+                    Print(L" unknown showtools flag: '%s'\n", FlagName);
                 }
-            }
-            
+            } // showtools options
+
         } else if (StriCmp(TokenList[0], L"banner") == 0) {
             HandleString(TokenList, TokenCount, &(GlobalConfig.BannerFileName));
 
@@ -396,7 +402,6 @@ VOID ReadConfig(VOID)
 
         FreeTokenLine(&TokenList, &TokenCount);
     }
-
     FreePool(File.Buffer);
 } /* VOID ReadConfig() */
 
index 6e32ea8c5471f1f9e6c33bf4dc980a3280ed4ff8..62d233b483055e7388109bedb2b18ab1c9a64859 100644 (file)
@@ -63,17 +63,13 @@ typedef struct {
     CHAR16  *End16Ptr;
 } REFIT_FILE;
 
-#define DISABLE_FLAG_SHELL      (0x0001)
-#define DISABLE_FLAG_TOOLS      (0x0002)
+#define DISABLE_FLAG_BANNER     (0x0001)
+#define DISABLE_FLAG_LABEL      (0x0002)
 #define DISABLE_FLAG_SINGLEUSER (0x0004)
 #define DISABLE_FLAG_HWTEST     (0x0008)
+#define DISABLE_FLAG_ARROWS     (0x0010)
 #define DISABLE_ALL             ((0xffff))
 
-#define HIDEUI_FLAG_BANNER      (0x0001)
-#define HIDEUI_FLAG_FUNCS       (0x0002)
-#define HIDEUI_FLAG_LABEL       (0x0004)
-#define HIDEUI_ALL              (0xffff)
-
 VOID ReadConfig(VOID);
 VOID ScanUserConfigured(VOID);
 UINTN ReadTokenLine(IN REFIT_FILE *File, OUT CHAR16 ***TokenList);
index 2c0d681d358eeb406fc81ff9ed038fe2bcc00492..0bcc13cf16f7d2d3ec5634960423dd61435ce951 100644 (file)
 
 #define REFIT_DEBUG (0)
 
+// Tag classifications; used in various ways.
 #define TAG_ABOUT    (1)
-#define TAG_RESET    (2)
+#define TAG_REBOOT   (2)
 #define TAG_SHUTDOWN (3)
 #define TAG_TOOL     (4)
 #define TAG_LOADER   (5)
 #define TAG_LEGACY   (6)
+#define TAG_EXIT     (7)
+#define TAG_SHELL    (8)
+#define TAG_GPTSYNC  (9)
+#define NUM_TOOLS    (9)
 
 #define NUM_SCAN_OPTIONS 10
 
+
 //
 // global definitions
 //
@@ -146,12 +152,12 @@ typedef struct {
    BOOLEAN     TextOnly;
    UINTN       Timeout;
    UINTN       DisableFlags;
-   UINTN       HideUIFlags;
-   UINTN       MaxTags;     // max. number of entries to show simultaneously in graphics mode
+   UINTN       MaxTags;     // max. number of OS entries to show simultaneously in graphics mode
    CHAR16      *BannerFileName;
    CHAR16      *SelectionSmallFileName;
    CHAR16      *SelectionBigFileName;
    CHAR16      *DefaultSelection;
+   UINTN       ShowTools[NUM_TOOLS];
    CHAR8       ScanFor[NUM_SCAN_OPTIONS]; // codes of types of loaders for which to scan
 } REFIT_CONFIG;
 
index 46e22bc25886b9af434d624484796c6b6736ede3..09f28cffabf6adf699f1a87a0ca75b25e1712d95 100644 (file)
@@ -53,6 +53,7 @@ BUILTIN_ICON BuiltinIconTable[BUILTIN_ICON_COUNT] = {
     { NULL, L"icons\\func_about.icns", 48 },
     { NULL, L"icons\\func_reset.icns", 48 },
     { NULL, L"icons\\func_shutdown.icns", 48 },
+    { NULL, L"icons\\func_exit.icns", 48 },
     { NULL, L"icons\\tool_shell.icns", 48 },
     { NULL, L"icons\\tool_part.icns", 48 },
     { NULL, L"icons\\tool_rescue.icns", 48 },
index eb3370c25856e745b5d66cd08c18b1fe4cbabe5b..c4aff8a645e3a07455d19003e9c2b66a837d2921 100644 (file)
@@ -60,13 +60,14 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id);
 #define BUILTIN_ICON_FUNC_ABOUT     (0)
 #define BUILTIN_ICON_FUNC_RESET     (1)
 #define BUILTIN_ICON_FUNC_SHUTDOWN  (2)
-#define BUILTIN_ICON_TOOL_SHELL     (3)
-#define BUILTIN_ICON_TOOL_PART      (4)
-#define BUILTIN_ICON_TOOL_RESCUE    (5)
-#define BUILTIN_ICON_VOL_INTERNAL   (6)
-#define BUILTIN_ICON_VOL_EXTERNAL   (7)
-#define BUILTIN_ICON_VOL_OPTICAL    (8)
-#define BUILTIN_ICON_COUNT          (9)
+#define BUILTIN_ICON_FUNC_EXIT      (3)
+#define BUILTIN_ICON_TOOL_SHELL     (4)
+#define BUILTIN_ICON_TOOL_PART      (5)
+#define BUILTIN_ICON_TOOL_RESCUE    (6)
+#define BUILTIN_ICON_VOL_INTERNAL   (7)
+#define BUILTIN_ICON_VOL_EXTERNAL   (8)
+#define BUILTIN_ICON_VOL_OPTICAL    (9)
+#define BUILTIN_ICON_COUNT          (10)
 
 #endif
 
index afb4213fba5b9c9457f26439fafb1ea698797365..702f0b780a7f25a58df6b990414f49e22015483a 100644 (file)
 #endif
 
 static REFIT_MENU_ENTRY MenuEntryAbout    = { L"About rEFInd", TAG_ABOUT, 1, 0, 'A', NULL, NULL, NULL };
-static REFIT_MENU_ENTRY MenuEntryReset    = { L"Restart Computer", TAG_RESET, 1, 0, 'R', NULL, NULL, NULL };
+static REFIT_MENU_ENTRY MenuEntryReset    = { L"Reboot Computer", TAG_REBOOT, 1, 0, 'R', NULL, NULL, NULL };
 static REFIT_MENU_ENTRY MenuEntryShutdown = { L"Shut Down Computer", TAG_SHUTDOWN, 1, 0, 'U', NULL, NULL, NULL };
 static REFIT_MENU_ENTRY MenuEntryReturn   = { L"Return to Main Menu", TAG_RETURN, 0, 0, 0, NULL, NULL, NULL };
+static REFIT_MENU_ENTRY MenuEntryExit     = { L"Exit rEFInd", TAG_EXIT, 1, 0, 0, NULL, NULL, NULL };
 
 static REFIT_MENU_SCREEN MainMenu       = { L"Main Menu", NULL, 0, NULL, 0, NULL, 0, L"Automatic boot" };
 static REFIT_MENU_SCREEN AboutMenu      = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL };
 
-REFIT_CONFIG        GlobalConfig = { FALSE, 20, 0, 0, 0, NULL, NULL, NULL, NULL };
+REFIT_CONFIG GlobalConfig = { FALSE, 20, 0, 0, NULL, NULL, NULL, NULL,
+                              {TAG_SHELL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, 0, 0, 0, 0, 0 }};
 
 //
 // misc functions
@@ -81,7 +83,7 @@ static VOID AboutrEFInd(VOID)
 {
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.3.3");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.3.4");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
@@ -1069,50 +1071,6 @@ static LOADER_ENTRY * AddToolEntry(IN CHAR16 *LoaderPath, IN CHAR16 *LoaderTitle
     return Entry;
 } /* static LOADER_ENTRY * AddToolEntry() */
 
-// Check the disk for add-on tools -- an EFI shell, the dangerous gptsync.efi, and a rescue Linux
-// installation.
-static VOID ScanTool(VOID)
-{
-    CHAR16                  *FileName;
-    LOADER_ENTRY            *Entry;
-    UINTN                   i = 0;
-
-    if (GlobalConfig.DisableFlags & DISABLE_FLAG_TOOLS)
-        return;
-
-    // look for the EFI shell
-    while (((FileName = FindCommaDelimited(SHELL_NAMES, i++)) != NULL) && (!(GlobalConfig.DisableFlags & DISABLE_FLAG_SHELL))) {
-       if (FileExists(SelfRootDir, FileName)) {
-          AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
-       }
-       FreePool(FileName);
-       FileName = NULL;
-    } // while
-
-    // look for the GPT/MBR sync tool
-    MergeStrings(&FileName, L"\\efi\\tools\\gptsync.efi", 0);
-    if (FileExists(SelfRootDir, FileName)) {
-        AddToolEntry(FileName, L"Make Hybrid MBR", BuiltinIcon(BUILTIN_ICON_TOOL_PART), 'P', FALSE);
-    }
-    FreePool(FileName);
-    FileName = NULL;
-
-    // look for rescue Linux
-    MergeStrings(&FileName, L"\\efi\\rescue\\elilo.efi", 0);
-    if (SelfVolume != NULL && FileExists(SelfRootDir, FileName)) {
-        Entry = AddToolEntry(FileName, L"Rescue Linux", BuiltinIcon(BUILTIN_ICON_TOOL_RESCUE), '0', FALSE);
-        
-        if (UGAWidth == 1440 && UGAHeight == 900)
-            Entry->LoadOptions = L"-d 0 i17";
-        else if (UGAWidth == 1680 && UGAHeight == 1050)
-            Entry->LoadOptions = L"-d 0 i20";
-        else
-            Entry->LoadOptions = L"-d 0 mini";
-    }
-    FreePool(FileName);
-} /* VOID ScanTool() */
-
-
 #ifdef DEBIAN_ENABLE_EFI110
 //
 // pre-boot driver functions
@@ -1291,20 +1249,7 @@ static VOID ScanForBootloaders(VOID) {
             break;
       } // switch()
    } // for
-   ScanTool();
 
-   // fixed other menu entries
-   if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_FUNCS)) {
-      MenuEntryAbout.Image = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-      AddMenuEntry(&MainMenu, &MenuEntryAbout);
-   }
-   if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_FUNCS) || MainMenu.EntryCount == 0) {
-      MenuEntryShutdown.Image = BuiltinIcon(BUILTIN_ICON_FUNC_SHUTDOWN);
-      AddMenuEntry(&MainMenu, &MenuEntryShutdown);
-      MenuEntryReset.Image = BuiltinIcon(BUILTIN_ICON_FUNC_RESET);
-      AddMenuEntry(&MainMenu, &MenuEntryReset);
-   }
-   
    // assign shortcut keys
    for (i = 0; i < MainMenu.EntryCount && MainMenu.Entries[i]->Row == 0 && i < 9; i++)
       MainMenu.Entries[i]->ShortcutDigit = (CHAR16)('1' + i);
@@ -1313,6 +1258,53 @@ static VOID ScanForBootloaders(VOID) {
    FinishTextScreen(FALSE);
 } // static VOID ScanForBootloaders()
 
+// Add the second-row tags containing built-in and external tools (EFI shell,
+// reboot, etc.)
+static VOID ScanForTools(VOID) {
+   CHAR16 *FileName = NULL;
+   UINTN i, j;
+
+   for (i = 0; i < NUM_TOOLS; i++) {
+      switch(GlobalConfig.ShowTools[i]) {
+         case TAG_SHUTDOWN:
+            MenuEntryShutdown.Image = BuiltinIcon(BUILTIN_ICON_FUNC_SHUTDOWN);
+            AddMenuEntry(&MainMenu, &MenuEntryShutdown);
+            break;
+         case TAG_REBOOT:
+            MenuEntryReset.Image = BuiltinIcon(BUILTIN_ICON_FUNC_RESET);
+            AddMenuEntry(&MainMenu, &MenuEntryReset);
+            break;
+         case TAG_ABOUT:
+            Print(L"Adding menu entry for the 'about' tag....\n");
+            MenuEntryAbout.Image = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
+            AddMenuEntry(&MainMenu, &MenuEntryAbout);
+            break;
+         case TAG_EXIT:
+            MenuEntryExit.Image = BuiltinIcon(BUILTIN_ICON_FUNC_EXIT);
+            AddMenuEntry(&MainMenu, &MenuEntryExit);
+            break;
+         case TAG_SHELL:
+            j = 0;
+            while ((FileName = FindCommaDelimited(SHELL_NAMES, j++)) != NULL) {
+               if (FileExists(SelfRootDir, FileName)) {
+                  AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
+               }
+            } // while
+            break;
+         case TAG_GPTSYNC:
+            MergeStrings(&FileName, L"\\efi\\tools\\gptsync.efi", 0);
+            if (FileExists(SelfRootDir, FileName)) {
+               AddToolEntry(FileName, L"Make Hybrid MBR", BuiltinIcon(BUILTIN_ICON_TOOL_PART), 'P', FALSE);
+            }
+            break;
+      } // switch()
+      if (FileName != NULL) {
+         FreePool(FileName);
+         FileName = NULL;
+      }
+   } // for
+} // static VOID ScanForTools
+
 //
 // main entry point
 //
@@ -1347,6 +1339,7 @@ efi_main (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
     LoadDrivers();
 #endif /* DEBIAN_ENABLE_EFI110 */
     ScanForBootloaders();
+    ScanForTools();
 
     while (MainLoopRunning) {
         MenuExit = RunMainMenu(&MainMenu, GlobalConfig.DefaultSelection, &ChosenEntry);
@@ -1363,8 +1356,8 @@ efi_main (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
         }
         
         switch (ChosenEntry->Tag) {
-            
-            case TAG_RESET:    // Restart
+
+            case TAG_REBOOT:    // Reboot
                 TerminateScreen();
                 refit_call4_wrapper(RT->ResetSystem, EfiResetCold, EFI_SUCCESS, 0, NULL);
                 MainLoopRunning = FALSE;   // just in case we get this far
@@ -1391,6 +1384,11 @@ efi_main (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
             case TAG_TOOL:     // Start a EFI tool
                 StartTool((LOADER_ENTRY *)ChosenEntry);
                 break;
+
+            case TAG_EXIT:    // Terminate rEFInd
+                BeginTextScreen(L" ");
+                return EFI_SUCCESS;
+                break;
                 
         }
     }
index a1120ba289f5d67ec41738113ca40129029ab5d4..194fcb29edbfd4424b58a23aa3caaa603a3c60ae 100644 (file)
@@ -673,7 +673,7 @@ static VOID PaintAll(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN
                            itemPosX[i], row1PosY);
       }
    }
-   if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL))
+   if (!(GlobalConfig.DisableFlags & DISABLE_FLAG_LABEL))
       DrawMainMenuText(Screen->Entries[State->CurrentSelection]->Title,
                        (UGAWidth - LAYOUT_TEXT_WIDTH) >> 1, textPosY);
 } // static VOID PaintAll()
@@ -688,7 +688,7 @@ static VOID PaintSelection(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State,
       DrawMainMenuEntry(Screen->Entries[State->CurrentSelection], TRUE,
                         itemPosX[State->CurrentSelection - State->FirstVisible],
                         (Screen->Entries[State->CurrentSelection]->Row == 0) ? row0PosY : row1PosY);
-      if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL))
+      if (!(GlobalConfig.DisableFlags & DISABLE_FLAG_LABEL))
          DrawMainMenuText(Screen->Entries[State->CurrentSelection]->Title,
                           (UGAWidth - LAYOUT_TEXT_WIDTH) >> 1, textPosY);
    } else {
@@ -779,10 +779,10 @@ VOID MainMenuStyle(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, IN UINT
             // For PaintIcon() calls, the starting Y position is moved to the midpoint
             // of the surrounding row; PaintIcon() adjusts this back up by half the
             // icon's height to properly center it.
-            if (State->FirstVisible > 0)
+            if ((State->FirstVisible > 0) && (!(GlobalConfig.DisableFlags & DISABLE_FLAG_ARROWS)))
                PaintIcon(&egemb_arrow_left, L"icons\\arrow_left.icns", row0PosX - TILE_XSPACING,
                          row0PosY + (ROW0_TILESIZE / 2), ALIGN_RIGHT);
-            if (State->LastVisible < (row0Loaders - 1))
+            if ((State->LastVisible < (row0Loaders - 1)) && (!(GlobalConfig.DisableFlags & DISABLE_FLAG_ARROWS)))
                PaintIcon(&egemb_arrow_right, L"icons\\arrow_right.icns",
                          (UGAWidth + (ROW0_TILESIZE + TILE_XSPACING) * State->MaxVisible) / 2 + TILE_XSPACING,
                          row0PosY + (ROW0_TILESIZE / 2), ALIGN_LEFT);
@@ -793,7 +793,7 @@ VOID MainMenuStyle(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, IN UINT
             break;
             
         case MENU_FUNCTION_PAINT_TIMEOUT:
-            if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL))
+            if (!(GlobalConfig.DisableFlags & DISABLE_FLAG_LABEL))
                 DrawMainMenuText(ParamText, (UGAWidth - LAYOUT_TEXT_WIDTH) >> 1, textPosY + TEXT_LINE_HEIGHT);
             break;
             
index fe57a23dca8597ef0a97208b41e5194e05592c5f..bb4a71744a0463b7cc62e58306ce0ad45b6fef14 100644 (file)
@@ -341,7 +341,7 @@ VOID BltClearScreen(IN BOOLEAN ShowBanner)
 {
     static EG_IMAGE *Banner = NULL;
 
-    if (ShowBanner && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_BANNER)) {
+    if (ShowBanner && !(GlobalConfig.DisableFlags & DISABLE_FLAG_BANNER)) {
         // load banner on first call
         if (Banner == NULL) {
             if (GlobalConfig.BannerFileName == NULL)