From 06fbb06b301f4db2a72fc108671fc90f9bee4780 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Sat, 22 Jan 2011 21:21:31 +0000 Subject: [PATCH] i18n: Fix assertion crash of my previous commit. I recreate all logics for the folder option to avoid issue with jNO_DEFAULT Note: now it will be easy to add a folder selection in the appearance panel (if still exists, it does not appear on my system) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4252 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/AppConfig.cpp | 11 +++++++++++ pcsx2/gui/AppConfig.h | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 19bf613f0e..20a62dfdb6 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -221,6 +221,7 @@ wxDirName& AppConfig::FolderOptions::operator[]( FoldersEnum_t folderidx ) case FolderId_Savestates: return Savestates; case FolderId_MemoryCards: return MemoryCards; case FolderId_Logs: return Logs; + case FolderId_Langs: return Langs; case FolderId_Documents: return CustomDocumentsFolder; @@ -246,6 +247,7 @@ bool AppConfig::FolderOptions::IsDefault( FoldersEnum_t folderidx ) const case FolderId_Savestates: return UseDefaultSavestates; case FolderId_MemoryCards: return UseDefaultMemoryCards; case FolderId_Logs: return UseDefaultLogs; + case FolderId_Langs: return UseDefaultLangs; case FolderId_Documents: return false; @@ -298,6 +300,11 @@ void AppConfig::FolderOptions::Set( FoldersEnum_t folderidx, const wxString& src UseDefaultLogs = useDefault; break; + case FolderId_Langs: + Langs = src; + UseDefaultLangs = useDefault; + break; + case FolderId_Documents: CustomDocumentsFolder = src; break; @@ -576,6 +583,7 @@ void AppConfig::FolderOptions::ApplyDefaults() if( UseDefaultSavestates ) Savestates = PathDefs::GetSavestates(); if( UseDefaultMemoryCards ) MemoryCards = PathDefs::GetMemoryCards(); if( UseDefaultLogs ) Logs = PathDefs::GetLogs(); + if( UseDefaultLangs ) Langs = PathDefs::GetLangs(); } // ------------------------------------------------------------------------ @@ -584,6 +592,7 @@ AppConfig::FolderOptions::FolderOptions() , Snapshots ( PathDefs::GetSnapshots() ) , Savestates ( PathDefs::GetSavestates() ) , MemoryCards ( PathDefs::GetMemoryCards() ) + , Langs ( PathDefs::GetLangs() ) , Logs ( PathDefs::GetLogs() ) , RunIso( PathDefs::GetDocuments() ) // raw default is always the Documents folder. @@ -606,12 +615,14 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini ) IniBitBool( UseDefaultSavestates ); IniBitBool( UseDefaultMemoryCards ); IniBitBool( UseDefaultLogs ); + IniBitBool( UseDefaultLangs ); IniEntry( Bios ); IniEntry( Snapshots ); IniEntry( Savestates ); IniEntry( MemoryCards ); IniEntry( Logs ); + IniEntry( Langs ); IniEntry( RunIso ); IniEntry( RunELF ); diff --git a/pcsx2/gui/AppConfig.h b/pcsx2/gui/AppConfig.h index 17b746cafa..1749029336 100644 --- a/pcsx2/gui/AppConfig.h +++ b/pcsx2/gui/AppConfig.h @@ -127,7 +127,8 @@ public: UseDefaultSnapshots:1, UseDefaultSavestates:1, UseDefaultMemoryCards:1, - UseDefaultLogs:1; + UseDefaultLogs:1, + UseDefaultLangs:1; BITFIELD_END wxDirName @@ -135,6 +136,7 @@ public: Snapshots, Savestates, MemoryCards, + Langs, Logs; wxDirName RunIso; // last used location for Iso loading.