From 65947ae5ae53be36ecd9b9190c632e1fcb6a20f8 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 30 Nov 2013 19:58:41 +0100 Subject: [PATCH] boot loader: blacklist menu: Set different title when disabled When booting from CD (or when no boot volume has been selected) blacklisting isn't supported. In that case let the menu title indicated that. --- src/system/boot/loader/menu.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/system/boot/loader/menu.cpp b/src/system/boot/loader/menu.cpp index 96fbbeccb1..400b8e4148 100644 --- a/src/system/boot/loader/menu.cpp +++ b/src/system/boot/loader/menu.cpp @@ -608,7 +608,7 @@ class BlacklistMenu : public Menu { public: BlacklistMenu() : - Menu(STANDARD_MENU, "Mark the entries to blacklist"), + Menu(STANDARD_MENU, kDefaultMenuTitle), fDirectory(NULL) { } @@ -706,9 +706,16 @@ private: private: Directory* fDirectory; + +protected: + static const char* const kDefaultMenuTitle; }; +const char* const BlacklistMenu::kDefaultMenuTitle + = "Mark the entries to blacklist"; + + class BlacklistRootMenu : public BlacklistMenu { public: BlacklistRootMenu() @@ -724,8 +731,13 @@ public: if (sBootVolume != NULL && sBootVolume->IsValid() && sBootVolume->IsPackaged()) { SetDirectory(sBootVolume->SystemDirectory()); - } else + SetTitle(kDefaultMenuTitle); + } else { SetDirectory(NULL); + SetTitle(sBootVolume != NULL && sBootVolume->IsValid() + ? "The selected boot volume doesn't support blacklisting!" + : "No boot volume selected!"); + } BlacklistMenu::Entered();