| 114 | } |
| 115 | |
| 116 | STATIC VOID AddCloverEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume) |
| 117 | { |
| 118 | REFIT_MENU_ENTRY_CLOVER *Entry; |
| 119 | REFIT_MENU_ENTRY_CLOVER *SubEntry; |
| 120 | REFIT_MENU_SCREEN *SubScreen; |
| 121 | // EFI_STATUS Status; |
| 122 | |
| 123 | // prepare the menu entry |
| 124 | Entry = new REFIT_MENU_ENTRY_CLOVER(); |
| 125 | Entry->Title.takeValueFrom(LoaderTitle); |
| 126 | // Entry->Tag = TAG_CLOVER; |
| 127 | Entry->Row = 1; |
| 128 | Entry->ShortcutLetter = 'C'; |
| 129 | Entry->Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_CLOVER); |
| 130 | Entry->Volume = Volume; |
| 131 | Entry->LoaderPath = LoaderPath; |
| 132 | Entry->VolName = Volume->VolName; |
| 133 | Entry->DevicePath = FileDevicePath(Volume->DeviceHandle, Entry->LoaderPath); |
| 134 | Entry->DevicePathString = FileDevicePathToXStringW(Entry->DevicePath); |
| 135 | Entry->Flags = 0; |
| 136 | Entry->LoadOptions.setEmpty(); |
| 137 | // Entry->LoaderType = OSTYPE_OTHER; |
| 138 | |
| 139 | //actions |
| 140 | Entry->AtClick = ActionEnter; |
| 141 | Entry->AtDoubleClick = ActionDetails; |
| 142 | Entry->AtRightClick = ActionDetails; |
| 143 | |
| 144 | // create the submenu |
| 145 | SubScreen = new REFIT_MENU_SCREEN; |
| 146 | |
| 147 | SubScreen->Title.takeValueFrom(LoaderTitle); |
| 148 | |
| 149 | SubScreen->TitleImage = Entry->Image; |
| 150 | SubScreen->ID = SCREEN_BOOT; |
| 151 | SubScreen->GetAnime(); |
| 152 | SubScreen->AddMenuInfoLine_f("%ls", FileDevicePathToXStringW(Volume->DevicePath).wc_str()); |
| 153 | |
| 154 | if (gEmuVariableControl != NULL) { |
| 155 | gEmuVariableControl->UninstallEmulation(gEmuVariableControl); |
| 156 | } |
| 157 | |
| 158 | //always add and always remove menu entries |
| 159 | SubEntry = Entry->getPartiallyDuplicatedEntry(); |
| 160 | if (SubEntry) { |
| 161 | SubEntry->Title.SWPrintf("Add Clover boot options for all entries"); |
| 162 | SubEntry->LoadOptions.setEmpty(); |
| 163 | SubEntry->LoadOptions.Add("BO-ADD"); |
| 164 | SubScreen->AddMenuEntry(SubEntry, true); |
| 165 | } |
| 166 | |
| 167 | SubEntry = Entry->getPartiallyDuplicatedEntry(); |
| 168 | if (SubEntry) { |
| 169 | SubEntry->Title.SWPrintf("Remove all Clover boot options"); |
| 170 | SubEntry->LoadOptions.setEmpty(); |
| 171 | SubEntry->LoadOptions.Add("BO-REMOVE"); |
| 172 | SubScreen->AddMenuEntry(SubEntry, true); |
| 173 | } |
no test coverage detected