From 58ee82334dcac915ed48f3634f947e75dbcd84f7 Mon Sep 17 00:00:00 2001 From: avihal Date: Tue, 14 Aug 2012 08:35:30 +0000 Subject: [PATCH] New: Allow changing the language at any time. Added menu item (always in English): Misc -> Change Language. Displays a message that the first time wizard will be displayed after pcsx2 is restarted, and requests the user to restart. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5370 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/App.h | 2 ++ pcsx2/gui/AppUserMode.cpp | 11 +++++++++++ pcsx2/gui/MainFrame.cpp | 6 ++++++ pcsx2/gui/MainFrame.h | 2 ++ pcsx2/gui/MainMenuClicks.cpp | 13 +++++++++++++ 5 files changed, 34 insertions(+) diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 6b4ce59f92..54c85a1893 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -151,6 +151,7 @@ enum MenuIdentifiers MenuId_Website, // Visit our awesome website! MenuId_Profiler, // Enable profiler MenuId_Console, // Enable console + MenuId_ChangeLang, // Change language (resets first time wizard to show on next start) MenuId_Console_Stdio, // Enable Stdio // Debug Subsection @@ -545,6 +546,7 @@ public: void WipeUserModeSettings(); bool TestUserPermissionsRights( const wxDirName& testFolder, wxString& createFailedStr, wxString& accessFailedStr ); void EstablishAppUserMode(); + void ForceFirstTimeWizardOnNextRun(); wxConfigBase* OpenInstallSettingsFile(); wxConfigBase* TestForPortableInstall(); diff --git a/pcsx2/gui/AppUserMode.cpp b/pcsx2/gui/AppUserMode.cpp index 446b5c1a1f..dede1c21b0 100644 --- a/pcsx2/gui/AppUserMode.cpp +++ b/pcsx2/gui/AppUserMode.cpp @@ -262,6 +262,17 @@ wxConfigBase* Pcsx2App::OpenInstallSettingsFile() } +void Pcsx2App::ForceFirstTimeWizardOnNextRun() +{ + ScopedPtr conf_install; + + conf_install = TestForPortableInstall(); + if (!conf_install) + conf_install = OpenInstallSettingsFile(); + + conf_install->Write( L"RunWizard", true ); +} + void Pcsx2App::EstablishAppUserMode() { ScopedPtr conf_install; diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index c053f68a72..52ea9dc2bd 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -235,6 +235,7 @@ void MainEmuFrame::ConnectMenus() ConnectMenu( MenuId_Debug_Logging, Menu_Debug_Logging_Click ); ConnectMenu( MenuId_Console, Menu_ShowConsole ); + ConnectMenu( MenuId_ChangeLang, Menu_ChangeLang ); ConnectMenu( MenuId_Console_Stdio, Menu_ShowConsole_Stdio ); ConnectMenu( MenuId_About, Menu_ShowAboutBox ); @@ -322,6 +323,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) , m_SaveStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Save01 ) ) , m_MenuItem_Console( *new wxMenuItem( &m_menuMisc, MenuId_Console, _("Show Console"), wxEmptyString, wxITEM_CHECK ) ) + , m_MenuItem_ChangeLang( *new wxMenuItem( &m_menuMisc, MenuId_ChangeLang, L"Change Language", wxEmptyString, wxITEM_CHECK ) ) // Always in English , m_MenuItem_Console_Stdio( *new wxMenuItem( &m_menuMisc, MenuId_Console_Stdio, _("Console to Stdio"), wxEmptyString, wxITEM_CHECK ) ) { @@ -502,6 +504,10 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) //m_menuMisc.Append(MenuId_Website, _("Visit Website..."), // _("Opens your web-browser to our favorite website.")); m_menuMisc.Append(MenuId_About, _("About...") ); + + m_menuMisc.AppendSeparator(); + m_menuMisc.Append( &m_MenuItem_ChangeLang ); + #ifdef PCSX2_DEVBUILD //m_menuDebug.Append(MenuId_Debug_Open, _("Open Debug Window..."), wxEmptyString); //m_menuDebug.Append(MenuId_Debug_MemoryDump, _("Memory Dump..."), wxEmptyString); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index 4e9ece5693..bce87bb335 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -126,6 +126,7 @@ protected: wxMenu& m_SaveStatesSubmenu; wxMenuItem& m_MenuItem_Console; + wxMenuItem& m_MenuItem_ChangeLang; wxMenuItem& m_MenuItem_Console_Stdio; PerPluginMenuInfo m_PluginMenuPacks[PluginId_Count]; @@ -203,6 +204,7 @@ protected: void Menu_Debug_Logging_Click(wxCommandEvent &event); void Menu_ShowConsole(wxCommandEvent &event); + void Menu_ChangeLang(wxCommandEvent &event); void Menu_ShowConsole_Stdio(wxCommandEvent &event); void Menu_ShowAboutBox(wxCommandEvent &event); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index a1e8c48424..6b95b5d088 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -568,6 +568,19 @@ void MainEmuFrame::Menu_ShowConsole(wxCommandEvent &event) wxGetApp().ProgramLog_PostEvent( evt ); } +void MainEmuFrame::Menu_ChangeLang(wxCommandEvent &event) // Always in English +{ + Msgbox::Alert ( L"Please restart PCSX2.\n" + L"\n" + L"First-Time-Wizard will then appear, where you can change the language.\n" + L"\n" + L"(You can keep other settings by choosing 'Import' when prompted)" + ); + + wxGetApp().ForceFirstTimeWizardOnNextRun(); +} + + void MainEmuFrame::Menu_ShowConsole_Stdio(wxCommandEvent &event) { g_Conf->EmuOptions.ConsoleToStdio = GetMenuBar()->IsChecked( MenuId_Console_Stdio );