MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / AddCloverEntry

Function AddCloverEntry

rEFIt_UEFI/entry_scan/tool.cpp:116–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116STATIC 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 }

Callers 1

ScanToolFunction · 0.85

Calls 10

FileDevicePathToXStringWFunction · 0.85
GetAnimeMethod · 0.80
AddMenuInfoLine_fMethod · 0.80
SWPrintfMethod · 0.80
AddMenuEntryMethod · 0.80
FileDevicePathFunction · 0.50
setEmptyMethod · 0.45
wc_strMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected