* Provided a way to define language keymap mappings, and used them to solve
bug #7765, ie. don't use the Dutch keymap but prefer US-International. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42404 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3191427a6e
commit
72031f525f
|
@ -47,6 +47,7 @@ enum {
|
|||
MSG_KEYMAP_SELECTED = 'kmps'
|
||||
};
|
||||
|
||||
|
||||
#undef B_TRANSLATE_CONTEXT
|
||||
#define B_TRANSLATE_CONTEXT "BootPromptWindow"
|
||||
|
||||
|
@ -56,6 +57,15 @@ namespace BPrivate {
|
|||
};
|
||||
|
||||
|
||||
static const char* kLanguageKeymapMappings[] = {
|
||||
// While there is a "Dutch" keymap, it apparently has not been widely
|
||||
// adopted, and the US-International keymap is common
|
||||
"Dutch", "US-International"
|
||||
};
|
||||
static const size_t kLanguageKeymapMappingsSize
|
||||
= sizeof(kLanguageKeymapMappings) / sizeof(kLanguageKeymapMappings[0]);
|
||||
|
||||
|
||||
class LanguageItem : public BStringItem {
|
||||
public:
|
||||
LanguageItem(const char* label, const char* language)
|
||||
|
@ -453,6 +463,14 @@ BootPromptWindow::_KeymapItemForLanguage(BLanguage& language) const
|
|||
if (language.GetName(name, &english) != B_OK)
|
||||
return fDefaultKeymapItem;
|
||||
|
||||
// Check special mappings first
|
||||
for (size_t i = 0; i < kLanguageKeymapMappingsSize; i += 2) {
|
||||
if (!strcmp(name, kLanguageKeymapMappings[i])) {
|
||||
name = kLanguageKeymapMappings[i + 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BMenu* menu = fKeymapsMenuField->Menu();
|
||||
for (int32 i = 0; i < menu->CountItems(); i++) {
|
||||
BMenuItem* item = menu->ItemAt(i);
|
||||
|
|
Loading…
Reference in New Issue