* ReadOnlyBootPrompt finally saves the locale settings again, so at first bot the system will be in the right language.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37863 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -177,51 +177,31 @@ BootPromptWindow::MessageReceived(BMessage* message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
void ForceUnloadCatalog();
|
void ForceUnloadCatalog();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BootPromptWindow::_InitCatalog(bool saveSettings)
|
BootPromptWindow::_InitCatalog(bool saveSettings)
|
||||||
{
|
{
|
||||||
// Initilialize the Locale Kit
|
// Initilialize the Locale Kit
|
||||||
BPrivate::ForceUnloadCatalog();
|
BPrivate::ForceUnloadCatalog();
|
||||||
|
|
||||||
// Generate a settings file
|
|
||||||
// TODO: This should not be necessary.
|
|
||||||
// be_locale_roster->SetPreferredLanguages() should take care of things
|
|
||||||
if (!saveSettings)
|
if (!saveSettings)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
|
||||||
BPath path;
|
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) != B_OK
|
|
||||||
|| path.Append("Locale settings") != B_OK) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BMessage settings;
|
BMessage settings;
|
||||||
|
|
||||||
BFile file;
|
|
||||||
if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK)
|
|
||||||
settings.Unflatten(&file);
|
|
||||||
|
|
||||||
BString language;
|
BString language;
|
||||||
if (fCatalog->GetLanguage(&language) == B_OK) {
|
if (be_locale_roster->GetCatalog()->GetLanguage(&language) == B_OK) {
|
||||||
settings.RemoveName("language");
|
|
||||||
settings.AddString("language", language.String());
|
settings.AddString("language", language.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.RemoveName("country");
|
mutable_locale_roster->SetPreferredLanguages(&settings);
|
||||||
BCountry country(language.String(), language.ToUpper());
|
|
||||||
settings.AddString("country", country.Code());
|
|
||||||
|
|
||||||
if (file.SetTo(path.Path(), B_CREATE_FILE | B_ERASE_FILE | B_WRITE_ONLY)
|
BCountry country(language.String(), language.ToUpper());
|
||||||
!= B_OK
|
mutable_locale_roster->SetDefaultCountry(country);
|
||||||
|| settings.Flatten(&file) != B_OK) {
|
|
||||||
fprintf(stderr, "Failed to write Local Kit settings!\n");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ BCatalog::SetCatalog(const char* signature, uint32 fingerprint)
|
|||||||
{
|
{
|
||||||
// This is not thread safe. It is used only in ReadOnlyBootPrompt and should
|
// This is not thread safe. It is used only in ReadOnlyBootPrompt and should
|
||||||
// not do harm there, but not sure what to do about it…
|
// not do harm there, but not sure what to do about it…
|
||||||
delete fCatalog;
|
mutable_locale_roster->UnloadCatalog(fCatalog);
|
||||||
fCatalog = mutable_locale_roster->LoadCatalog(signature, NULL, fingerprint);
|
fCatalog = mutable_locale_roster->LoadCatalog(signature, NULL, fingerprint);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user