- Fixed bug that caused tools (shell, etc.) to launch when they were
highlighted and F2 or Insert was pressed.
+- Added "editor" option to the "hideui" token in refind.conf, which
+ disables the boot options editor.
+
- Added hints text to rEFInd main menu and sub-menus. This can be disabled
by setting the new "hints" option to the "hideui" token in refind.conf.
</tr>
<tr>
<td><tt>hideui</tt></td>
- <td><tt>banner</tt>, <tt>label</tt>, <tt>singleuser</tt>, <tt>hwtest</tt>, <tt>arrows</tt>, or <tt>all</tt></td>
- <td>Removes the specified user interface features. <tt>banner</tt> removes the banner graphic, <tt>label</tt> removes the text description of each tag and the countdown timer, <tt>singleuser</tt> removes the single-user option from the Mac OS sub-menu, <tt>hwtest</tt> removes the Mac OS hardware test option, <tt>arrows</tt> removes the arrows to the right or left of the OS tags when rEFInd finds too many OSes to display simultaneously, and <tt>all</tt> removes all of these options. You can specify multiple parameters with this option. The default is to set none of these values.</td>
+ <td><tt>banner</tt>, <tt>label</tt>, <tt>singleuser</tt>, <tt>hwtest</tt>, <tt>arrows</tt>, <tt>hints</tt>, <tt>editor</tt>, or <tt>all</tt></td>
+ <td>Removes the specified user interface features. <tt>banner</tt> removes the banner graphic, <tt>label</tt> removes the text description of each tag and the countdown timer, <tt>singleuser</tt> removes the single-user option from the Mac OS sub-menu, <tt>hwtest</tt> removes the Mac OS hardware test option, <tt>arrows</tt> removes the arrows to the right or left of the OS tags when rEFInd finds too many OSes to display simultaneously, <tt>hints</tt> removes the brief description of what basic keypressed do, <tt>editor</tt> disables the options editor, and <tt>all</tt> removes all of these options. You can specify multiple parameters with this option. The default is to set none of these values.</td>
</tr>
<tr>
<td><tt>icons_dir</tt></td>
PauseForKey();
SwitchToGraphics();
} // if()
+
} else if (UgaDraw != NULL) { // UGA mode (EFI 1.x)
// Try to use current color depth & refresh rate for new mode. Maybe not the best choice
// in all cases, but I don't know how to probe for alternatives....
if (!egHasGraphics)
return;
- FillColor.Red = Color->r;
- FillColor.Green = Color->g;
- FillColor.Blue = Color->b;
+ if (Color != NULL) {
+ FillColor.Red = Color->r;
+ FillColor.Green = Color->g;
+ FillColor.Blue = Color->b;
+ } else {
+ FillColor.Red = 0x0;
+ FillColor.Green = 0x0;
+ FillColor.Blue = 0x0;
+ }
FillColor.Reserved = 0;
if (GraphicsOutput != NULL) {
// layout, and the header from TianoCore actually defines them
// to be the same type.
refit_call10_wrapper(GraphicsOutput->Blt, GraphicsOutput, (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)&FillColor, EfiBltVideoFill,
- 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
+ 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
} else if (UgaDraw != NULL) {
- refit_call10_wrapper(UgaDraw->Blt, UgaDraw, &FillColor, EfiUgaVideoFill,
- 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
+ refit_call10_wrapper(UgaDraw->Blt, UgaDraw, &FillColor, EfiUgaVideoFill, 0, 0, 0, 0, egScreenWidth, egScreenHeight, 0);
}
}
# hwtest - the submenu option to run Apple's hardware test
# arrows - scroll arrows on the OS selection tag line
# hints - brief command summary in the menu
+# editor - the options editor (+, F2, or Insert on boot options menu)
# all - all of the above
+# Default is none of these (all elements active)
#
#hideui singleuser
#hideui all
} else if (StriCmp(FlagName, L"label") == 0) {
GlobalConfig.HideUIFlags |= HIDEUI_FLAG_LABEL;
} else if (StriCmp(FlagName, L"singleuser") == 0) {
- GlobalConfig.HideUIFlags |= HIDEUI_FLAG_SINGLEUSER;
+ GlobalConfig.HideUIFlags |= HIDEUI_FLAG_SINGLEUSER;
} else if (StriCmp(FlagName, L"hwtest") == 0) {
- GlobalConfig.HideUIFlags |= HIDEUI_FLAG_HWTEST;
+ GlobalConfig.HideUIFlags |= HIDEUI_FLAG_HWTEST;
} else if (StriCmp(FlagName, L"arrows") == 0) {
GlobalConfig.HideUIFlags |= HIDEUI_FLAG_ARROWS;
} else if (StriCmp(FlagName, L"hints") == 0) {
GlobalConfig.HideUIFlags |= HIDEUI_FLAG_HINTS;
+ } else if (StriCmp(FlagName, L"editor") == 0) {
+ GlobalConfig.HideUIFlags |= HIDEUI_FLAG_EDITOR;
} else if (StriCmp(FlagName, L"all") == 0) {
- GlobalConfig.HideUIFlags = HIDEUI_ALL;
+ GlobalConfig.HideUIFlags = HIDEUI_FLAG_ALL;
} else {
Print(L" unknown hideui flag: '%s'\n", FlagName);
}
CHAR16 *End16Ptr;
} REFIT_FILE;
+#define HIDEUI_FLAG_NONE (0x0000)
#define HIDEUI_FLAG_BANNER (0x0001)
#define HIDEUI_FLAG_LABEL (0x0002)
#define HIDEUI_FLAG_SINGLEUSER (0x0004)
#define HIDEUI_FLAG_HWTEST (0x0008)
#define HIDEUI_FLAG_ARROWS (0x0010)
#define HIDEUI_FLAG_HINTS (0x0020)
-#define HIDEUI_ALL ((0xffff))
+#define HIDEUI_FLAG_EDITOR (0x0040)
+#define HIDEUI_FLAG_ALL ((0xffff))
#define CONFIG_FILE_NAME L"refind.conf"
#define DONT_SCAN_FILES L"shim.efi,MokManager.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi"
// TODO: Track down the cause of this error and fix it, if possible.
// ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex],
// ImageData, ImageSize, &ChildImageHandle);
- ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex],
- NULL, 0, &ChildImageHandle);
+ ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex],
+ NULL, 0, &ChildImageHandle);
if ((Status == EFI_ACCESS_DENIED) && (ShimLoaded())) {
FindVolumeAndFilename(DevicePaths[DevicePathIndex], &DeviceVolume, &loader);
if (DeviceVolume != NULL) {
//
// generic menu function
//
-static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC StyleFunc, IN INTN DefaultEntryIndex, OUT REFIT_MENU_ENTRY **ChosenEntry)
+static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC StyleFunc, IN OUT INTN *DefaultEntryIndex,
+ OUT REFIT_MENU_ENTRY **ChosenEntry)
{
SCROLL_STATE State;
EFI_STATUS Status;
StyleFunc(Screen, &State, MENU_FUNCTION_INIT, NULL);
IdentifyRows(&State, Screen);
// override the starting selection with the default index, if any
- if (DefaultEntryIndex >= 0 && DefaultEntryIndex <= State.MaxIndex) {
- State.CurrentSelection = DefaultEntryIndex;
+ if (*DefaultEntryIndex >= 0 && *DefaultEntryIndex <= State.MaxIndex) {
+ State.CurrentSelection = *DefaultEntryIndex;
UpdateScroll(&State, SCROLL_NONE);
}
State.PaintAll = TRUE;
if (ChosenEntry)
*ChosenEntry = Screen->Entries[State.CurrentSelection];
+ *DefaultEntryIndex = State.CurrentSelection;
return MenuExit;
} /* static UINTN RunGenericMenu() */
if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_HINTS)) {
refit_call3_wrapper(ST->ConOut->SetCursorPosition, ST->ConOut, 0, ConHeight - 1);
refit_call2_wrapper(ST->ConOut->OutputString, ST->ConOut,
- L"arrow keys to move cursor; Enter to boot; Insert or F2 for more options");
+ L"Use arrow keys to move cursor; Enter to boot; Insert or F2 for more options");
}
break;
EntriesPosX, EntriesPosY + i * TEXT_LINE_HEIGHT);
}
if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_HINTS)) {
- DrawMenuText(L"arrow keys to move cursor; Enter to boot;", 0,
- (UGAWidth - (41 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 3));
- DrawMenuText(L"Insert or F2 to edit options", 0,
- (UGAWidth - (28 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 2));
- }
+ if (GlobalConfig.HideUIFlags & HIDEUI_FLAG_EDITOR) {
+ DrawMenuText(L"Use arrow keys to move cursor; Enter to boot", 0,
+ (UGAWidth - (45 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 3));
+ } else {
+ DrawMenuText(L"Use arrow keys to move cursor; Enter to boot;", 0,
+ (UGAWidth - (45 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 3));
+ DrawMenuText(L"Insert or F2 to edit options", 0,
+ (UGAWidth - (28 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 2));
+ } // if/else
+ } // if
break;
case MENU_FUNCTION_PAINT_SELECTION:
(UGAWidth - LAYOUT_TEXT_WIDTH) >> 1, textPosY);
if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_HINTS)) {
- DrawMainMenuText(L"arrow keys to move cursor; Enter to boot;",
+ DrawMainMenuText(L"Use arrow keys to move cursor; Enter to boot;",
(UGAWidth - LAYOUT_TEXT_WIDTH) / 2, UGAHeight - (FONT_CELL_HEIGHT * 3));
DrawMainMenuText(L"Insert or F2 for more options",
(UGAWidth - LAYOUT_TEXT_WIDTH) / 2, UGAHeight - (FONT_CELL_HEIGHT * 2));
CHAR16 *EditedOptions;
BOOLEAN retval = FALSE;
+ if (GlobalConfig.HideUIFlags & HIDEUI_FLAG_EDITOR) {
+ return FALSE;
+ }
+
refit_call4_wrapper(ST->ConOut->QueryMode, ST->ConOut, ST->ConOut->Mode->Mode, &x_max, &y_max);
if (!GlobalConfig.TextOnly)
UINTN RunMenu(IN REFIT_MENU_SCREEN *Screen, OUT REFIT_MENU_ENTRY **ChosenEntry)
{
+ INTN DefaultEntry = -1;
MENU_STYLE_FUNC Style = TextMenuStyle;
if (AllowGraphicsMode)
Style = GraphicsMenuStyle;
- return RunGenericMenu(Screen, Style, -1, ChosenEntry);
+ return RunGenericMenu(Screen, Style, &DefaultEntry, ChosenEntry);
}
UINTN RunMainMenu(IN REFIT_MENU_SCREEN *Screen, IN CHAR16* DefaultSelection, OUT REFIT_MENU_ENTRY **ChosenEntry)
MENU_STYLE_FUNC MainStyle = TextMenuStyle;
REFIT_MENU_ENTRY *TempChosenEntry;
UINTN MenuExit = 0;
- UINTN DefaultEntryIndex = -1;
+ INTN DefaultEntryIndex = -1;
+ INTN DefaultSubmenuIndex = -1;
if (DefaultSelection != NULL) {
// Find a menu entry that includes *DefaultSelection as a substring
DefaultEntryIndex = FindMenuShortcutEntry(Screen, DefaultSelection);
- // If that didn't work, should we scan more characters? For now, no.
}
if (AllowGraphicsMode) {
}
while (!MenuExit) {
- MenuExit = RunGenericMenu(Screen, MainStyle, DefaultEntryIndex, &TempChosenEntry);
+ MenuExit = RunGenericMenu(Screen, MainStyle, &DefaultEntryIndex, &TempChosenEntry);
Screen->TimeoutSeconds = 0;
if (MenuExit == MENU_EXIT_DETAILS) {
if (TempChosenEntry->SubScreen != NULL) {
- MenuExit = RunGenericMenu(TempChosenEntry->SubScreen, Style, -1, &TempChosenEntry);
+ MenuExit = RunGenericMenu(TempChosenEntry->SubScreen, Style, &DefaultSubmenuIndex, &TempChosenEntry);
if (MenuExit == MENU_EXIT_ESCAPE || TempChosenEntry->Tag == TAG_RETURN)
MenuExit = 0;
if (MenuExit == MENU_EXIT_DETAILS) {
EG_PIXEL StdBackgroundPixel = { 0xbf, 0xbf, 0xbf, 0 };
EG_PIXEL MenuBackgroundPixel = { 0xbf, 0xbf, 0xbf, 0 };
+EG_PIXEL DarkBackgroundPixel = { 0x0, 0x0, 0x0, 0 };
static BOOLEAN GraphicsScreenDirty;
VOID BeginExternalScreen(IN BOOLEAN UseGraphicsMode, IN CHAR16 *Title)
{
- EG_PIXEL DarkBackgroundPixel = { 0x0, 0x0, 0x0, 0 };
-
if (!AllowGraphicsMode)
UseGraphicsMode = FALSE;
UINTN y;
// clear to black background
+ egClearScreen(&DarkBackgroundPixel); // first clear in graphics mode
refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_BASIC);
- refit_call1_wrapper(ST->ConOut->ClearScreen, ST->ConOut);
+ refit_call1_wrapper(ST->ConOut->ClearScreen, ST->ConOut); // then clear in text mode
// paint header background
refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_BANNER);