MGR: Reset everybody's language selection back to the default OS UI locale, in the future use the ISO language code to determine which locale to use for the manager.

This commit is contained in:
Rom Walton 2014-06-18 11:14:29 -04:00
parent dccde203bc
commit 77ad8427d2
5 changed files with 15 additions and 16 deletions

View File

@ -75,7 +75,6 @@ CBOINCBaseFrame::CBOINCBaseFrame(wxWindow* parent, const wxWindowID id, const wx
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::CBOINCBaseFrame - Function Begin"));
// Configuration Settings
m_iSelectedLanguage = 0;
m_iReminderFrequency = 0;
m_strNetworkDialupConnectionName = wxEmptyString;
m_aSelectedComputerMRU.Clear();
@ -771,9 +770,7 @@ bool CBOINCBaseFrame::SaveState() {
//
pConfig->SetPath(strBaseConfigLocation);
pConfig->Write(wxT("Language"), m_iSelectedLanguage);
pConfig->Write(wxT("ReminderFrequencyV3"), m_iReminderFrequency);
pConfig->Write(wxT("NetworkDialupConnectionName"), m_strNetworkDialupConnectionName);
@ -828,9 +825,7 @@ bool CBOINCBaseFrame::RestoreState() {
//
pConfig->SetPath(strBaseConfigLocation);
pConfig->Read(wxT("Language"), &m_iSelectedLanguage, 0L);
pConfig->Read(wxT("ReminderFrequencyV3"), &m_iReminderFrequency, 360L);
pConfig->Read(wxT("NetworkDialupConnectionName"), &m_strNetworkDialupConnectionName, wxEmptyString);

View File

@ -69,8 +69,6 @@ public:
CBOINCDialUpManager* GetDialupManager() { return m_pDialupManager; }
int GetReminderFrequency() { return m_iReminderFrequency; }
void SetReminderFrequency(int val) { m_iReminderFrequency = val; }
int GetSelectedLanguage() { return m_iSelectedLanguage; }
void SetSelectedLanguage(int val) { m_iSelectedLanguage = val; }
void FireInitialize();
void FireRefreshView();
@ -111,7 +109,6 @@ protected:
wxTimer* m_pAlertPollTimer;
wxTimer* m_pPeriodicRPCTimer;
int m_iSelectedLanguage;
int m_iReminderFrequency;
int m_iFrameRefreshRate;

View File

@ -154,7 +154,6 @@ bool CBOINCGUIApp::OnInit() {
// Initialize local variables
int iErrorCode = 0;
int iSelectedLanguage = 0;
bool bOpenEventLog = false;
wxString strDesiredSkinName = wxEmptyString;
wxString strDialogMessage = wxEmptyString;
@ -212,7 +211,7 @@ bool CBOINCGUIApp::OnInit() {
m_pConfig->Read(wxT("AutomaticallyShutdownClient"), &m_iShutdownCoreClient, 0L);
m_pConfig->Read(wxT("DisplayShutdownClientDialog"), &m_iDisplayExitDialog, 1L);
m_pConfig->Read(wxT("DisableAutoStart"), &m_iBOINCMGRDisableAutoStart, 0L);
m_pConfig->Read(wxT("Language"), &iSelectedLanguage, 0L);
m_pConfig->Read(wxT("LanguageISO"), &m_strISOLanguageCode, wxT(""));
m_pConfig->Read(wxT("GUISelection"), &m_iGUISelected, BOINC_SIMPLEGUI);
m_pConfig->Read(wxT("EventLogOpen"), &bOpenEventLog);
@ -276,9 +275,16 @@ bool CBOINCGUIApp::OnInit() {
m_pLocale = new wxLocale();
wxASSERT(m_pLocale);
//
if (m_strISOLanguageCode.IsEmpty()) {
m_pLocale->Init(wxLANGUAGE_DEFAULT);
m_strISOLanguageCode = m_pLocale->GetCanonicalName();
} else {
m_pLocale->Init(wxLocale::FindLanguageInfo(m_strISOLanguageCode)->Language);
}
// Look for the localization files by absolute and relative locations.
// preference given to the absolute location.
m_pLocale->Init(iSelectedLanguage);
if (!m_strBOINCMGRRootDirectory.IsEmpty()) {
m_pLocale->AddCatalogLookupPathPrefix(
wxString(m_strBOINCMGRRootDirectory + wxT("locale"))
@ -291,8 +297,6 @@ bool CBOINCGUIApp::OnInit() {
InitSupportedLanguages();
m_strISOLanguageCode = m_pLocale->GetCanonicalName();
// Note: JAWS for Windows will only speak the context-sensitive
// help if you use this help provider:
wxHelpProvider::Set(new wxHelpControllerHelpProvider());
@ -604,6 +608,7 @@ void CBOINCGUIApp::SaveState() {
if (m_pSkinManager) {
m_pConfig->Write(wxT("Skin"), m_pSkinManager->GetSelectedSkin());
}
m_pConfig->Write(wxT("LanguageISO"), m_strISOLanguageCode);
m_pConfig->Write(wxT("AutomaticallyShutdownClient"), m_iShutdownCoreClient);
m_pConfig->Write(wxT("DisplayShutdownClientDialog"), m_iDisplayExitDialog);
m_pConfig->Write(wxT("DisableAutoStart"), m_iBOINCMGRDisableAutoStart);

View File

@ -158,6 +158,8 @@ public:
wxArrayString& GetSupportedLanguages() { return m_astrLanguages; }
wxString GetISOLanguageCode() { return m_strISOLanguageCode; }
void SetISOLanguageCode(wxString strISOLanguageCode)
{ m_strISOLanguageCode = strISOLanguageCode; }
void DisplayEventLog(bool bShowWindow = true);
void OnEventLogClose();

View File

@ -584,7 +584,7 @@ bool CDlgOptions::ReadSettings() {
// General Tab
m_LanguageSelectionCtrl->Append(wxGetApp().GetSupportedLanguages());
m_LanguageSelectionCtrl->SetSelection(pFrame->GetSelectedLanguage());
m_LanguageSelectionCtrl->SetSelection(wxLocale::FindLanguageInfo(wxGetApp().GetISOLanguageCode())->Language);
m_ReminderFrequencyCtrl->Append(_("always"));
m_ReminderFrequencyCtrl->Append(_("1 hour"));
@ -681,7 +681,7 @@ bool CDlgOptions::SaveSettings() {
// General Tab
if (pFrame->GetSelectedLanguage() != m_LanguageSelectionCtrl->GetSelection()) {
if (wxLocale::FindLanguageInfo(wxGetApp().GetISOLanguageCode())->Language != m_LanguageSelectionCtrl->GetSelection()) {
wxString strDialogTitle;
wxString strDialogMessage;
@ -707,7 +707,7 @@ bool CDlgOptions::SaveSettings() {
);
}
pFrame->SetSelectedLanguage(m_LanguageSelectionCtrl->GetSelection());
wxGetApp().SetISOLanguageCode(wxLocale::GetLanguageInfo(m_LanguageSelectionCtrl->GetSelection())->CanonicalName);
switch(m_ReminderFrequencyCtrl->GetSelection()) {
case 0: