boot loader: MenuItem: Add SetLabel()

This commit is contained in:
Ingo Weinhold 2013-11-30 19:39:57 +01:00
parent 2a368f9b0e
commit cbfc38c62d
2 changed files with 11 additions and 0 deletions

View File

@ -57,6 +57,7 @@ public:
char Shortcut() const { return fShortcut; }
const char* Label() const { return fLabel; }
void SetLabel(const char* label);
Menu* Submenu() const { return fSubMenu; }
void SetSubmenu(Menu* subMenu);

View File

@ -180,6 +180,16 @@ MenuItem::SetShortcut(char key)
}
void
MenuItem::SetLabel(const char* label)
{
if (char* newLabel = strdup(label)) {
free(const_cast<char*>(fLabel));
fLabel = newLabel;
}
}
void
MenuItem::SetSubmenu(Menu* subMenu)
{