| 74 | #endif |
| 75 | |
| 76 | STATIC BOOLEAN AddToolEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, |
| 77 | IN REFIT_VOLUME *Volume, const XIcon& Image, |
| 78 | IN CHAR16 ShortcutLetter, IN CONST XString8Array& Options) |
| 79 | { |
| 80 | REFIT_MENU_ENTRY_LOADER_TOOL *Entry; |
| 81 | // Check the loader exists |
| 82 | if ((LoaderPath.isEmpty()) || (Volume == NULL) || (Volume->RootDir == NULL) || |
| 83 | !FileExists(Volume->RootDir, LoaderPath)) { |
| 84 | return FALSE; |
| 85 | } |
| 86 | // Allocate the entry |
| 87 | Entry = new REFIT_MENU_ENTRY_LOADER_TOOL(); |
| 88 | if (Entry == NULL) { |
| 89 | return FALSE; |
| 90 | } |
| 91 | |
| 92 | if (FullTitle) { |
| 93 | Entry->Title.takeValueFrom(FullTitle); |
| 94 | } else { |
| 95 | Entry->Title.SWPrintf("Start %ls", LoaderTitle); |
| 96 | } |
| 97 | // Entry->Tag = TAG_TOOL; |
| 98 | Entry->Row = 1; |
| 99 | Entry->ShortcutLetter = ShortcutLetter; |
| 100 | Entry->Image = Image; |
| 101 | // Entry->ImageHover = ImageHover; |
| 102 | Entry->LoaderPath = LoaderPath; |
| 103 | Entry->DevicePath = FileDevicePath(Volume->DeviceHandle, Entry->LoaderPath); |
| 104 | Entry->DevicePathString = FileDevicePathToXStringW(Entry->DevicePath); |
| 105 | Entry->LoadOptions = Options; |
| 106 | //actions |
| 107 | Entry->AtClick = ActionSelect; |
| 108 | Entry->AtDoubleClick = ActionEnter; |
| 109 | Entry->AtRightClick = ActionHelp; |
| 110 | |
| 111 | DBG("found tool %ls\n", LoaderPath.s()); |
| 112 | MainMenu.AddMenuEntry(Entry, true); |
| 113 | return TRUE; |
| 114 | } |
| 115 | |
| 116 | STATIC VOID AddCloverEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume) |
| 117 | { |
no test coverage detected