hrev54044 adds 1 changeset to branch 'master'
old head: 4b918abdb02a26a770d898594eaaccc6f1726e9b
new head: c3fcf05777ba064c185be24da98067f860bb9366
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=c3fcf05777ba+%5E4b918abdb02a
----------------------------------------------------------------------------
c3fcf05777ba: Firstbootprompt: Localize keymap list
Fixes #15522
Change-Id: I8909f70c0f7abe1fa23ea7c145220b95a3e06395
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1718
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
[ Murai Takashi <tmurai01@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev54044
Commit: c3fcf05777ba064c185be24da98067f860bb9366
URL: https://git.haiku-os.org/haiku/commit/?id=c3fcf05777ba
Author: Murai Takashi <tmurai01@xxxxxxxxx>
Date: Wed Aug 14 08:00:37 2019 UTC
Committer: Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Commit-Date: Mon Apr 13 15:49:26 2020 UTC
Ticket: https://dev.haiku-os.org/ticket/15522
----------------------------------------------------------------------------
3 files changed, 31 insertions(+), 1 deletion(-)
src/apps/firstbootprompt/BootPromptWindow.cpp | 28 ++++++++++++++++++++++-
src/apps/firstbootprompt/BootPromptWindow.h | 1 +
src/apps/firstbootprompt/Jamfile | 3 +++
----------------------------------------------------------------------------
diff --git a/src/apps/firstbootprompt/BootPromptWindow.cpp
b/src/apps/firstbootprompt/BootPromptWindow.cpp
index 7708f69f14..9195a5781c 100644
--- a/src/apps/firstbootprompt/BootPromptWindow.cpp
+++ b/src/apps/firstbootprompt/BootPromptWindow.cpp
@@ -38,6 +38,7 @@
#include "BootPrompt.h"
#include "Keymap.h"
+#include "KeymapNames.h"
using BPrivate::MutableLocaleRoster;
@@ -255,6 +256,7 @@ BootPromptWindow::MessageReceived(BMessage* message)
MutableLocaleRoster::Default()->SetPreferredLanguages(
&preferredLanguages);
_InitCatalog(true);
+ _UpdateKeymapsMenu();
// Select default keymap by language
BLanguage language(item->Language());
@@ -403,6 +405,28 @@ BootPromptWindow::_PopulateLanguages()
}
+void
+BootPromptWindow::_UpdateKeymapsMenu()
+{
+ BMenu *menu = fKeymapsMenuField->Menu();
+ BMenuItem* item;
+ BList itemsList;
+
+ // Recreate keymapmenu items list, since BMenu could not sort its items.
+ while ((item = menu->ItemAt(0)) != NULL) {
+ BMessage* message = item->Message();
+ entry_ref ref;
+ message->FindRef("ref", &ref);
+ item-> SetLabel(B_TRANSLATE_NOCOLLECT_ALL((ref.name),
+ "KeymapNames", NULL));
+ itemsList.AddItem(item);
+ menu->RemoveItem(0);
+ }
+ itemsList.SortItems(compare_void_menu_items);
+ fKeymapsMenuField->Menu()->AddList(&itemsList, 0);
+}
+
+
void
BootPromptWindow::_PopulateKeymaps()
{
@@ -434,7 +458,9 @@ BootPromptWindow::_PopulateKeymaps()
while (directory.GetNextRef(&ref) == B_OK) {
BMessage* message = new BMessage(MSG_KEYMAP_SELECTED);
message->AddRef("ref", &ref);
- BMenuItem* item = new BMenuItem(ref.name, message);
+ BMenuItem* item =
+ new
BMenuItem(B_TRANSLATE_NOCOLLECT_ALL((ref.name),
+ "KeymapNames", NULL), message);
itemsList.AddItem(item);
if (currentName == ref.name)
item->SetMarked(true);
diff --git a/src/apps/firstbootprompt/BootPromptWindow.h
b/src/apps/firstbootprompt/BootPromptWindow.h
index cc6a120b5e..255ee49acb 100644
--- a/src/apps/firstbootprompt/BootPromptWindow.h
+++ b/src/apps/firstbootprompt/BootPromptWindow.h
@@ -27,6 +27,7 @@ public:
private:
void _InitCatalog(bool
saveSettings);
void _UpdateStrings();
+ void _UpdateKeymapsMenu();
void _PopulateLanguages();
void _PopulateKeymaps();
void _ActivateKeymap(const
BMessage* message) const;
diff --git a/src/apps/firstbootprompt/Jamfile b/src/apps/firstbootprompt/Jamfile
index 615cbe2829..00ed4c0d61 100644
--- a/src/apps/firstbootprompt/Jamfile
+++ b/src/apps/firstbootprompt/Jamfile
@@ -1,7 +1,10 @@
SubDir HAIKU_TOP src apps firstbootprompt ;
+UseHeaders [ FDirName $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) data keymaps ] ;
UsePrivateHeaders app interface locale shared ;
+Includes [ FGristFiles BootPromptWindow.cpp ] : <keymap-locale>KeymapNames.h ;
+
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src preferences keymap ] ;
Application FirstBootPrompt :