Fix the panic alert hack for windows and osx. The macro needed to be defined after HAVE_WX is defined. That explains why windows accepted the string concatenation that I thought it wouldn't.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6829 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2011-01-12 18:09:16 +00:00
parent d5b7c5802e
commit fcd72bdba9
22 changed files with 669 additions and 676 deletions

View File

@ -117,6 +117,14 @@ private:
#include "config.h" // SCons autoconfiguration defines
#endif
#if defined(HAVE_WX) && HAVE_WX
// This should be used to mark c strings as translatable in PanicAlerts but only in
// wxWidgets portions of the code.
#define _wxt(a) (std::string(wxString(wxGetTranslation(wxT(a))).To8BitData()).c_str())
#else
#define _wxt(a) a
#endif
// Windows compatibility
#ifndef _WIN32
#include <limits.h>

View File

@ -122,14 +122,6 @@ inline T max(const T& a, const T& b) {return a > b ? a : b;}
// Defined in Misc.cpp.
const char* GetLastErrorMsg();
#if defined(HAVE_WX) && HAVE_WX
// This should be used to mark c strings as translatable in PanicAlerts but only in
// wxWidgets portions of the code.
#define _wxt(a) (std::string(wxString(wxGetTranslation(wxT(a))).To8BitData()).c_str())
#else
#define _wxt(a) a
#endif
namespace Common
{
inline u8 swap8(u8 _data) {return _data;}

View File

@ -998,8 +998,7 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
}
else
{
PanicAlert("%s", _wxt("Cannot use that file as a memory card.\n"
"Are you trying to use the same file in both slots?"));
PanicAlert("%s", _wxt("Cannot use that file as a memory card.\nAre you trying to use the same file in both slots?"));
}
}
}

View File

@ -182,9 +182,7 @@ bool DolphinApp::OnInit()
// TODO: if First Boot
if (!cpu_info.bSSE2)
{
PanicAlert("%s", _wxt("Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
"Sayonara!\n"));
PanicAlert("%s", _wxt("Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\nUnfortunately your CPU does not support them, so Dolphin will not run.\n\nSayonara!\n"));
return false;
}

View File

@ -475,8 +475,7 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
PanicAlert(E_SAVEFAILED);
break;
case DELETE_FAIL:
PanicAlert("%s", _wxt("Order of files in the File Directory do not match the block order\n"
"Right click and export all of the saves,\nand import the the saves to a new memcard\n"));
PanicAlert("%s", _wxt("Order of files in the File Directory do not match the block order\nRight click and export all of the saves,\nand import the the saves to a new memcard\n"));
break;
default:
PanicAlert(E_UNK);
@ -587,9 +586,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
SplitPath(mpath, &path1, &path2, NULL);
path1 += path2;
File::CreateDir(path1.c_str());
if(PanicYesNo(_wxt("Warning: This will overwrite any existing saves "
"that are in the folder:\n%s\nand have the same name"
" as a file on your memcard\nContinue?"), path1.c_str()))
if(PanicYesNo(_wxt("Warning: This will overwrite any existing saves that are in the folder:\n%s\nand have the same name as a file on your memcard\nContinue?"), path1.c_str()))
for (int i = 0; i < DIRLEN; i++)
{
CopyDeleteSwitch(memoryCard[slot]->ExportGci(i, ".", &path1), -1);

View File

@ -115,8 +115,7 @@ void WiimoteConfigDiag::PairUpRealWiimotes(wxCommandEvent&)
UpdateGUI();
}
else if (paired < 0)
PanicAlert("%s", _wxt("A supported bluetooth device was not found!\n"
"(Only the Microsoft bluetooth stack is supported.)"));
PanicAlert("%s", _wxt("A supported bluetooth device was not found!\n(Only the Microsoft bluetooth stack is supported.)"));
}
#endif