From 43fea75b7290cdcbfafa8e159dc3832581352755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 31 Jul 2014 11:33:39 +0200 Subject: [PATCH] beos: Disable non-working menu entries So at lest people won't expect too much. --- beos/scaffolding.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp index 0f87420a5..45815fa1a 100644 --- a/beos/scaffolding.cpp +++ b/beos/scaffolding.cpp @@ -1496,7 +1496,7 @@ void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view) } -static BMenuItem *make_menu_item(const char *name, BMessage *message) +static BMenuItem *make_menu_item(const char *name, BMessage *message, bool enabled=false) { BMenuItem *item; BString label(messages_get(name)); @@ -1546,6 +1546,8 @@ static BMenuItem *make_menu_item(const char *name, BMessage *message) item = new BMenuItem(label.String(), message, key, mods); + item->SetEnabled(enabled); + return item; } @@ -1730,7 +1732,7 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel) menu->AddItem(item); message = new BMessage(APPLICATION_QUIT); - item = make_menu_item("Quit", message); + item = make_menu_item("Quit", message, true); menu->AddItem(item); // Page menu @@ -1778,11 +1780,11 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel) menu->AddItem(item); message = new BMessage(BROWSER_NEW_WINDOW); - item = make_menu_item("NewWindow", message); + item = make_menu_item("NewWindow", message, true); menu->AddItem(item); message = new BMessage(BROWSER_VIEW_SOURCE); - item = make_menu_item("ViewSrc", message); + item = make_menu_item("ViewSrc", message, true); menu->AddItem(item); // Object menu @@ -1809,15 +1811,15 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel) g->menu_bar->AddItem(menu); message = new BMessage(BROWSER_NAVIGATE_HOME); - item = make_menu_item("Home", message); + item = make_menu_item("Home", message, true); menu->AddItem(item); message = new BMessage(BROWSER_NAVIGATE_BACK); - item = make_menu_item("Back", message); + item = make_menu_item("Back", message, true); menu->AddItem(item); message = new BMessage(BROWSER_NAVIGATE_FORWARD); - item = make_menu_item("Forward", message); + item = make_menu_item("Forward", message, true); menu->AddItem(item); message = new BMessage(BROWSER_NAVIGATE_UP); @@ -1825,11 +1827,11 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel) menu->AddItem(item); message = new BMessage(BROWSER_NAVIGATE_RELOAD); - item = make_menu_item("Reload", message); + item = make_menu_item("Reload", message, true); menu->AddItem(item); message = new BMessage(BROWSER_NAVIGATE_STOP); - item = make_menu_item("Stop", message); + item = make_menu_item("Stop", message, true); menu->AddItem(item); // View menu