mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
Removed my previous PanicAlert translation hack. Fixed with a better method suggested by BhaaL. The translation is done by a callback in the MsgHandler routine that is set at program start. Added macros PanicAlertT, SuccessAlertT, PanicYesNoT, and AskYesNoT that are identical to the non T versions except those strings will be added by gettext to the po files to be translated. These can and should be used anywhere in the code for strings that should be translated.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6838 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -151,7 +151,7 @@ bool BootCore(const std::string& _rFilename)
|
||||
// Init the core
|
||||
if (!Core::Init())
|
||||
{
|
||||
PanicAlert("%s", _wxt("Couldn't init the core.\nCheck your configuration."));
|
||||
PanicAlertT("Couldn't init the core.\nCheck your configuration.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ void CheatSearchTab::StartNewSearch(wxCommandEvent& WXUNUSED (event))
|
||||
const u8* const memptr = Memory::GetPointer(0);
|
||||
if (NULL == memptr)
|
||||
{
|
||||
PanicAlert("%s", _wxt("A game is not currently running."));
|
||||
PanicAlertT("A game is not currently running.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -376,7 +376,7 @@ void CheatSearchTab::FilterCheatSearchResults(wxCommandEvent&)
|
||||
const u8* const memptr = Memory::GetPointer(0);
|
||||
if (NULL == memptr)
|
||||
{
|
||||
PanicAlert("%s", _wxt("A game is not currently running."));
|
||||
PanicAlertT("A game is not currently running.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -431,7 +431,7 @@ void CheatSearchTab::FilterCheatSearchResults(wxCommandEvent&)
|
||||
|
||||
if (!x_val.ToLong(&parsed_x_val, val_base))
|
||||
{
|
||||
PanicAlert("%s", _wxt("You must enter a valid decimal or hex value."));
|
||||
PanicAlertT("You must enter a valid decimal or hex value.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -598,14 +598,14 @@ void CreateCodeDialog::PressOK(wxCommandEvent&)
|
||||
const wxString code_name = textctrl_name->GetValue();
|
||||
if (code_name.empty())
|
||||
{
|
||||
PanicAlert("%s", _wxt("You must enter a name!"));
|
||||
PanicAlertT("You must enter a name!");
|
||||
return;
|
||||
}
|
||||
|
||||
long code_value;
|
||||
if (!textctrl_value->GetValue().ToLong(&code_value, 10 + checkbox_use_hex->GetValue()*6))
|
||||
{
|
||||
PanicAlert("%s", _wxt("Invalid Value!"));
|
||||
PanicAlertT("Invalid Value!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -917,7 +917,7 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event)
|
||||
break;
|
||||
case ID_INTERFACE_LANG:
|
||||
if (SConfig::GetInstance().m_InterfaceLanguage != langIds[InterfaceLang->GetSelection()])
|
||||
SuccessAlert("%s", _wxt("You must restart Dolphin in order for the change to take effect."));
|
||||
SuccessAlertT("You must restart Dolphin in order for the change to take effect.");
|
||||
SConfig::GetInstance().m_InterfaceLanguage = langIds[InterfaceLang->GetSelection()];
|
||||
break;
|
||||
case ID_HOTKEY_CONFIG:
|
||||
@ -1000,7 +1000,8 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlert("%s", _wxt("Cannot use that file as a memory card.\nAre you trying to use the same file in both slots?"));
|
||||
PanicAlertT("Cannot use that file as a memory card.\n"
|
||||
"Are you trying to use the same file in both slots?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ void CFrame::InitBitmaps()
|
||||
}
|
||||
break;
|
||||
|
||||
default: PanicAlert("%s", _wxt("Theme selection went wrong"));
|
||||
default: PanicAlertT("Theme selection went wrong");
|
||||
}
|
||||
|
||||
// Update in case the bitmap has been updated
|
||||
@ -597,7 +597,7 @@ void CFrame::DoOpen(bool Boot)
|
||||
|
||||
if (currentDir != currentDir2)
|
||||
{
|
||||
PanicAlert(_wxt("Current dir changed from %s to %s after wxFileSelector!"),
|
||||
PanicAlertT("Current dir changed from %s to %s after wxFileSelector!",
|
||||
currentDir.c_str(), currentDir2.c_str());
|
||||
File::SetCurrentDir(currentDir.c_str());
|
||||
}
|
||||
|
@ -276,17 +276,17 @@ void CodeConfigPanel::DownloadCodes(wxCommandEvent&)
|
||||
}
|
||||
}
|
||||
|
||||
PanicAlert(_wxt("Downloaded %lu codes. (added %lu)"),
|
||||
PanicAlertT("Downloaded %lu codes. (added %lu)",
|
||||
(unsigned long)gcodes.size(), added_count);
|
||||
|
||||
// refresh the list
|
||||
UpdateCodeList();
|
||||
}
|
||||
else
|
||||
PanicAlert("%s", _wxt("File contained no codes."));
|
||||
PanicAlertT("File contained no codes.");
|
||||
}
|
||||
else
|
||||
PanicAlert("%s", _wxt("Failed to download codes."));
|
||||
PanicAlertT("Failed to download codes.");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ void CISOProperties::CreateGUIControls(bool IsWad)
|
||||
void CISOProperties::OnClose(wxCloseEvent& WXUNUSED (event))
|
||||
{
|
||||
if (!SaveGameConfig())
|
||||
PanicAlert(_wxt("Could not save %s"), GameIniFile.c_str());
|
||||
PanicAlertT("Could not save %s", GameIniFile.c_str());
|
||||
|
||||
EndModal(bRefreshList ? wxID_OK : wxID_CANCEL);
|
||||
}
|
||||
@ -801,7 +801,7 @@ void CISOProperties::OnExtractDataFromHeader(wxCommandEvent& event)
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
PanicAlert(_wxt("Failed to extract to %s!"), (const char *)Path.mb_str());
|
||||
PanicAlertT("Failed to extract to %s!", (const char *)Path.mb_str());
|
||||
}
|
||||
|
||||
void CISOProperties::SetRefresh(wxCommandEvent& event)
|
||||
@ -1052,17 +1052,17 @@ void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
|
||||
filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_T("text/plain"));
|
||||
if(filetype == NULL) // MIME type failed, aborting mission
|
||||
{
|
||||
PanicAlert("%s", _wxt("Filetype 'ini' is unknown! Will not open!"));
|
||||
PanicAlertT("Filetype 'ini' is unknown! Will not open!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
wxString OpenCommand;
|
||||
OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(GameIniFile.c_str()));
|
||||
if(OpenCommand.IsEmpty())
|
||||
PanicAlert("%s", _wxt("Couldn't find open command for extension 'ini'!"));
|
||||
PanicAlertT("Couldn't find open command for extension 'ini'!");
|
||||
else
|
||||
if(wxExecute(OpenCommand, wxEXEC_SYNC) == -1)
|
||||
PanicAlert("%s", _wxt("wxExecute returned -1 on application run!"));
|
||||
PanicAlertT("wxExecute returned -1 on application run!");
|
||||
|
||||
GameIni.Load(GameIniFile.c_str());
|
||||
LoadGameConfig();
|
||||
|
@ -623,7 +623,7 @@ void GamepadPage::SaveProfile(wxCommandEvent&)
|
||||
m_config_dialog->UpdateProfileComboBox();
|
||||
}
|
||||
else
|
||||
PanicAlert("%s", _wxt("You must enter a valid profile name."));
|
||||
PanicAlertT("You must enter a valid profile name.");
|
||||
}
|
||||
|
||||
void GamepadPage::DeleteProfile(wxCommandEvent&)
|
||||
@ -634,7 +634,7 @@ void GamepadPage::DeleteProfile(wxCommandEvent&)
|
||||
const char* const fnamecstr = fname.c_str();
|
||||
|
||||
if (File::Exists(fnamecstr) &&
|
||||
AskYesNo(_wxt("Are you sure you want to delete \"%s\"?"),
|
||||
AskYesNoT("Are you sure you want to delete \"%s\"?",
|
||||
STR_FROM_WXSTR(profile_cbox->GetValue()).c_str()))
|
||||
{
|
||||
File::Delete(fnamecstr);
|
||||
|
@ -56,6 +56,7 @@ END_EVENT_TABLE()
|
||||
|
||||
#include <wx/stdpaths.h>
|
||||
bool wxMsgAlert(const char*, const char*, bool, int);
|
||||
const char *wxStringTranslator(const char *);
|
||||
|
||||
CFrame* main_frame = NULL;
|
||||
|
||||
@ -170,6 +171,7 @@ bool DolphinApp::OnInit()
|
||||
#ifndef _WIN32
|
||||
RegisterMsgAlertHandler(&wxMsgAlert);
|
||||
#endif
|
||||
RegisterStringTranslator(&wxStringTranslator);
|
||||
|
||||
// "ExtendedTrace" looks freakin dangerous!!!
|
||||
#ifdef _WIN32
|
||||
@ -182,7 +184,9 @@ 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.\nUnfortunately your CPU does not support them, so Dolphin will not run.\n\nSayonara!\n"));
|
||||
PanicAlertT("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");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -200,12 +204,12 @@ bool DolphinApp::OnInit()
|
||||
FILE* workingDir = fopen(tmp, "r");
|
||||
if (!workingDir)
|
||||
{
|
||||
if (PanicYesNo("Dolphin has not been configured with an install location,\nKeep Dolphin portable?"))
|
||||
if (PanicYesNoT("Dolphin has not been configured with an install location,\nKeep Dolphin portable?"))
|
||||
{
|
||||
FILE* portable = fopen((std::string(File::GetUserPath(D_CONFIG_IDX)) + "portable").c_str(), "w");
|
||||
if (!portable)
|
||||
{
|
||||
PanicAlert("Portable Setting could not be saved\n Are you running Dolphin from read only media or from a directory that dolphin is not located in?");
|
||||
PanicAlertT("Portable Setting could not be saved\n Are you running Dolphin from read only media or from a directory that dolphin is not located in?");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -216,11 +220,11 @@ bool DolphinApp::OnInit()
|
||||
{
|
||||
char CWD[1024];
|
||||
sprintf(CWD, "%s", (const char*)wxGetCwd().mb_str());
|
||||
if (PanicYesNo("Set install location to:\n %s ?", CWD))
|
||||
if (PanicYesNoT("Set install location to:\n %s ?", CWD))
|
||||
{
|
||||
FILE* workingDirF = fopen(tmp, "w");
|
||||
if (!workingDirF)
|
||||
PanicAlert("Install directory could not be saved");
|
||||
PanicAlertT("Install directory could not be saved");
|
||||
else
|
||||
{
|
||||
fwrite(CWD, ((std::string)CWD).size()+1, 1, workingDirF);
|
||||
@ -229,7 +233,7 @@ bool DolphinApp::OnInit()
|
||||
}
|
||||
}
|
||||
else
|
||||
PanicAlert("Relaunch Dolphin from the install directory and save from there");
|
||||
PanicAlertT("Relaunch Dolphin from the install directory and save from there");
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -390,14 +394,14 @@ void DolphinApp::InitLanguageSupport()
|
||||
|
||||
if(!m_locale->IsOk())
|
||||
{
|
||||
PanicAlert("Error loading selected language. Falling back to system default.\n");
|
||||
PanicAlertT("Error loading selected language. Falling back to system default.\n");
|
||||
delete m_locale;
|
||||
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlert("The selected language is not supported by your system. Falling back to system default.\n");
|
||||
PanicAlertT("The selected language is not supported by your system. Falling back to system default.\n");
|
||||
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
|
||||
}
|
||||
}
|
||||
@ -469,6 +473,12 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *wxStringTranslator(const char *text)
|
||||
{
|
||||
printf("passing through here\n");
|
||||
return std::string(wxString(wxGetTranslation(wxString::From8BitData(text))).To8BitData()).c_str();
|
||||
}
|
||||
|
||||
// Accessor for the main window class
|
||||
CFrame* DolphinApp::GetCFrame()
|
||||
{
|
||||
|
@ -294,7 +294,7 @@ void CMemcardManager::ChangePath(int slot)
|
||||
if (!strcasecmp(m_MemcardPath[slot2]->GetPath().mb_str(), m_MemcardPath[slot]->GetPath().mb_str()))
|
||||
{
|
||||
if(m_MemcardPath[slot]->GetPath().length())
|
||||
PanicAlert("%s", _wxt("Memcard already opened"));
|
||||
PanicAlertT("Memcard already opened");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -420,7 +420,7 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
|
||||
switch (error)
|
||||
{
|
||||
case GCS:
|
||||
SuccessAlert("%s", _wxt("File converted to .gci"));
|
||||
SuccessAlertT("File converted to .gci");
|
||||
break;
|
||||
case SUCCESS:
|
||||
if (slot != -1)
|
||||
@ -432,10 +432,10 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
|
||||
}
|
||||
break;
|
||||
case NOMEMCARD:
|
||||
PanicAlert("%s", _wxt("File is not recognized as a memcard"));
|
||||
PanicAlertT("File is not recognized as a memcard");
|
||||
break;
|
||||
case OPENFAIL:
|
||||
PanicAlert("%s", _wxt("File could not be opened\nor does not have a valid extension"));
|
||||
PanicAlertT("File could not be opened\nor does not have a valid extension");
|
||||
break;
|
||||
case OUTOFBLOCKS:
|
||||
if (slot == -1)
|
||||
@ -443,39 +443,40 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
|
||||
PanicAlert(E_UNK);
|
||||
break;
|
||||
}
|
||||
PanicAlert(_wxt("Only %d blocks available"), memoryCard[slot]->GetFreeBlocks());
|
||||
PanicAlertT("Only %d blocks available", memoryCard[slot]->GetFreeBlocks());
|
||||
break;
|
||||
case OUTOFDIRENTRIES:
|
||||
PanicAlert("%s", _wxt("No free dir index entries"));
|
||||
PanicAlertT("No free dir index entries");
|
||||
break;
|
||||
case LENGTHFAIL:
|
||||
PanicAlert("%s", _wxt("Imported file has invalid length"));
|
||||
PanicAlertT("Imported file has invalid length");
|
||||
break;
|
||||
case INVALIDFILESIZE:
|
||||
PanicAlert("%s", _wxt("The save you are trying to copy has an invalid file size"));
|
||||
PanicAlertT("The save you are trying to copy has an invalid file size");
|
||||
break;
|
||||
case TITLEPRESENT:
|
||||
PanicAlert("%s", _wxt("Memcard already has a save for this title"));
|
||||
PanicAlertT("Memcard already has a save for this title");
|
||||
break;
|
||||
case SAVFAIL:
|
||||
PanicAlert("%s", _wxt("Imported file has sav extension\nbut does not have a correct header"));
|
||||
PanicAlertT("Imported file has sav extension\nbut does not have a correct header");
|
||||
break;
|
||||
case GCSFAIL:
|
||||
PanicAlert("%s", _wxt("Imported file has gsc extension\nbut does not have a correct header"));
|
||||
PanicAlertT("Imported file has gsc extension\nbut does not have a correct header");
|
||||
break;
|
||||
case FAIL:
|
||||
if (slot == -1)
|
||||
{
|
||||
PanicAlert("%s", _wxt("Export Failed"));
|
||||
PanicAlertT("Export Failed");
|
||||
return false;
|
||||
}
|
||||
PanicAlert("%s", _wxt("Invalid bat.map or dir entry"));
|
||||
PanicAlertT("Invalid bat.map or dir entry");
|
||||
break;
|
||||
case WRITEFAIL:
|
||||
PanicAlert(E_SAVEFAILED);
|
||||
break;
|
||||
case DELETE_FAIL:
|
||||
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"));
|
||||
PanicAlertT("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");
|
||||
break;
|
||||
default:
|
||||
PanicAlert(E_UNK);
|
||||
@ -513,7 +514,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
|
||||
case ID_FIXCHECKSUM_B:
|
||||
if (memoryCard[slot]->FixChecksums() && memoryCard[slot]->Save())
|
||||
{
|
||||
SuccessAlert("%s", _wxt("The checksum was successfully fixed"));
|
||||
SuccessAlertT("The checksum was successfully fixed");
|
||||
}
|
||||
else PanicAlert(E_SAVEFAILED);
|
||||
break;
|
||||
@ -586,7 +587,8 @@ 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(PanicYesNoT("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);
|
||||
|
@ -71,7 +71,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
fail = false;
|
||||
if (!mcd)
|
||||
{
|
||||
if (!AskYesNo("\"%s\" does not exist.\n Create a new 16MB Memcard?", filename))
|
||||
if (!AskYesNoT("\"%s\" does not exist.\n Create a new 16MB Memcard?", filename))
|
||||
{
|
||||
fail = true;
|
||||
return;
|
||||
@ -83,7 +83,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
return;
|
||||
}
|
||||
mcdFile = mcd;
|
||||
Format(!AskYesNo("Format as ascii (NTSC\\PAL)?\nChoose no for sjis (NTSC-J)"));
|
||||
Format(!AskYesNoT("Format as ascii (NTSC\\PAL)?\nChoose no for sjis (NTSC-J)"));
|
||||
fclose(mcd);
|
||||
mcd = fopen(filename, "r+b");
|
||||
}
|
||||
@ -95,7 +95,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
if (strcasecmp(fileType.c_str(), ".raw") && strcasecmp(fileType.c_str(), ".gcp"))
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("File has the extension \"%s\"\nvalid extensions are (.raw/.gcp)", fileType.c_str());
|
||||
PanicAlertT("File has the extension \"%s\"\nvalid extensions are (.raw/.gcp)", fileType.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -104,31 +104,31 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
if (fread(&hdr, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read header correctly\n(0x0000-0x1FFF)");
|
||||
PanicAlertT("Failed to read header correctly\n(0x0000-0x1FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&dir, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read directory correctly\n(0x2000-0x3FFF)");
|
||||
PanicAlertT("Failed to read directory correctly\n(0x2000-0x3FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&dir_backup, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read directory backup correctly\n(0x4000-0x5FFF)");
|
||||
PanicAlertT("Failed to read directory backup correctly\n(0x4000-0x5FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&bat, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read block allocation table correctly\n(0x6000-0x7FFF)");
|
||||
PanicAlertT("Failed to read block allocation table correctly\n(0x6000-0x7FFF)");
|
||||
return;
|
||||
}
|
||||
if (fread(&bat_backup, 1, BLOCK_SIZE, mcd) != BLOCK_SIZE)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read block allocation table backup correctly\n(0x8000-0x9FFF)");
|
||||
PanicAlertT("Failed to read block allocation table backup correctly\n(0x8000-0x9FFF)");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
// header checksum error!
|
||||
// invalid files do not always get here
|
||||
fail = true;
|
||||
PanicAlert("Header checksum failed");
|
||||
PanicAlertT("Header checksum failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
{
|
||||
// backup is also wrong!
|
||||
fail = true;
|
||||
PanicAlert("Directory checksum failed\n and Directory backup checksum failed");
|
||||
PanicAlertT("Directory checksum failed\n and Directory backup checksum failed");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -169,7 +169,7 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
{
|
||||
// backup is also wrong!
|
||||
fail = true;
|
||||
PanicAlert("Block Allocation Table checksum failed");
|
||||
PanicAlertT("Block Allocation Table checksum failed");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -211,13 +211,13 @@ GCMemcard::GCMemcard(const char *filename)
|
||||
if (mc_data_size != read)
|
||||
{
|
||||
fail = true;
|
||||
PanicAlert("Failed to read save data\n(0xA000-)\nMemcard may be truncated");
|
||||
PanicAlertT("Failed to read save data\n(0xA000-)\nMemcard may be truncated");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
fail = true;
|
||||
PanicAlert("Memcard failed to load\n Card size is invalid (%04X)", sizeMb);
|
||||
PanicAlertT("Memcard failed to load\n Card size is invalid (%04X)", sizeMb);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,10 @@ CWiiSaveCrypted::CWiiSaveCrypted(const char* FileName, u64 title)
|
||||
// TODO: check_sig()
|
||||
if (b_valid)
|
||||
{
|
||||
SuccessAlert("Successfully imported save files");
|
||||
SuccessAlertT("Successfully imported save files");
|
||||
b_tryAgain = false;
|
||||
}
|
||||
else b_tryAgain = AskYesNo("Import failed, try again?");
|
||||
else b_tryAgain = AskYesNoT("Import failed, try again?");
|
||||
}while(b_tryAgain);
|
||||
}
|
||||
else
|
||||
@ -75,10 +75,10 @@ CWiiSaveCrypted::CWiiSaveCrypted(const char* FileName, u64 title)
|
||||
do_sig();
|
||||
if (b_valid)
|
||||
{
|
||||
SuccessAlert("Successfully exported file to %s", pathData_bin);
|
||||
SuccessAlertT("Successfully exported file to %s", pathData_bin);
|
||||
b_tryAgain = false;
|
||||
}
|
||||
else b_tryAgain = AskYesNo("Export failed, try again?");
|
||||
else b_tryAgain = AskYesNoT("Export failed, try again?");
|
||||
}while(b_tryAgain);
|
||||
}
|
||||
}
|
||||
@ -89,13 +89,13 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
fpData_bin = fopen(pathData_bin, "rb");
|
||||
if (!fpData_bin)
|
||||
{
|
||||
PanicAlert("Cannot open %s", pathData_bin);
|
||||
PanicAlertT("Cannot open %s", pathData_bin);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
if (fread(&_encryptedHeader, HEADER_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("failed to read header");
|
||||
PanicAlertT("failed to read header");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -106,7 +106,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
if ((_bannerSize < FULL_BNR_MIN) || (_bannerSize > FULL_BNR_MAX) ||
|
||||
(((_bannerSize - BNR_SZ) % ICON_SZ) != 0))
|
||||
{
|
||||
PanicAlert("not a wii save or read failure for file header size %x", _bannerSize);
|
||||
PanicAlertT("not a wii save or read failure for file header size %x", _bannerSize);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -117,7 +117,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
md5((u8*)&_header, HEADER_SZ, md5_calc);
|
||||
if (memcmp(md5_file, md5_calc, 0x10))
|
||||
{
|
||||
PanicAlert("MD5 mismatch\n %016llx%016llx != %016llx%016llx", Common::swap64(md5_file),Common::swap64(md5_file+8), Common::swap64(md5_calc), Common::swap64(md5_calc+8));
|
||||
PanicAlertT("MD5 mismatch\n %016llx%016llx != %016llx%016llx", Common::swap64(md5_file),Common::swap64(md5_file+8), Common::swap64(md5_calc), Common::swap64(md5_calc+8));
|
||||
b_valid= false;
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ void CWiiSaveCrypted::ReadHDR()
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
if (!File::Exists(pathBanner_bin) || AskYesNo("%s already exists, overwrite?", pathBanner_bin))
|
||||
if (!File::Exists(pathBanner_bin) || AskYesNoT("%s already exists, overwrite?", pathBanner_bin))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "creating file %s", pathBanner_bin);
|
||||
fpBanner_bin = fopen(pathBanner_bin, "wb");
|
||||
@ -154,7 +154,7 @@ void CWiiSaveCrypted::WriteHDR()
|
||||
{
|
||||
if (fread(_header.BNR, Common::swap32(_header.hdr.BannerSize), 1, fpBanner_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to read banner.bin");
|
||||
PanicAlertT("Failed to read banner.bin");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -170,7 +170,7 @@ void CWiiSaveCrypted::WriteHDR()
|
||||
{
|
||||
if (fwrite(&_encryptedHeader, HEADER_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to write header for %s", pathData_bin);
|
||||
PanicAlertT("Failed to write header for %s", pathData_bin);
|
||||
b_valid = false;
|
||||
}
|
||||
fclose(fpData_bin);
|
||||
@ -186,14 +186,14 @@ void CWiiSaveCrypted::ReadBKHDR()
|
||||
fpData_bin = fopen(pathData_bin, "rb");
|
||||
if (!fpData_bin)
|
||||
{
|
||||
PanicAlert("Cannot open %s", pathData_bin);
|
||||
PanicAlertT("Cannot open %s", pathData_bin);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
fseeko(fpData_bin, HEADER_SZ, SEEK_SET);
|
||||
if (fread(&bkhdr, BK_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("failed to read bk header");
|
||||
PanicAlertT("failed to read bk header");
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -202,7 +202,7 @@ void CWiiSaveCrypted::ReadBKHDR()
|
||||
if (bkhdr.size != Common::swap32(BK_LISTED_SZ) ||
|
||||
bkhdr.magic != Common::swap32(BK_HDR_MAGIC))
|
||||
{
|
||||
PanicAlert("Invalid Size(%x) or Magic word (%x)", bkhdr.size, bkhdr.magic);
|
||||
PanicAlertT("Invalid Size(%x) or Magic word (%x)", bkhdr.size, bkhdr.magic);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -246,7 +246,7 @@ void CWiiSaveCrypted::WriteBKHDR()
|
||||
{
|
||||
if (fwrite(&bkhdr, BK_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to write bkhdr");
|
||||
PanicAlertT("Failed to write bkhdr");
|
||||
b_valid = false;
|
||||
}
|
||||
fclose(fpData_bin);
|
||||
@ -260,7 +260,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
fpData_bin = fopen(pathData_bin, "rb");
|
||||
if (!fpData_bin)
|
||||
{
|
||||
PanicAlert("Cannot open %s", pathData_bin);
|
||||
PanicAlertT("Cannot open %s", pathData_bin);
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -279,14 +279,14 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
|
||||
if (fread(&_tmpFileHDR, FILE_HDR_SZ, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to write header for file %d", i);
|
||||
PanicAlertT("Failed to write header for file %d", i);
|
||||
b_valid = false;
|
||||
}
|
||||
|
||||
lastpos += FILE_HDR_SZ;
|
||||
if(Common::swap32(_tmpFileHDR.magic) != FILE_HDR_MAGIC)
|
||||
{
|
||||
PanicAlert("Bad File Header");
|
||||
PanicAlertT("Bad File Header");
|
||||
break;
|
||||
}
|
||||
else
|
||||
@ -308,7 +308,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
_data = new u8[_fileSize];
|
||||
if (fread(_encryptedData, _fileSize, 1, fpData_bin) != 1)
|
||||
{
|
||||
PanicAlert("Failed to read data from file %d", i);
|
||||
PanicAlertT("Failed to read data from file %d", i);
|
||||
b_valid = false;
|
||||
break;
|
||||
}
|
||||
@ -318,7 +318,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
|
||||
AES_cbc_encrypt((const unsigned char *)_encryptedData, _data, _fileSize, &m_AES_KEY, IV, AES_DECRYPT);
|
||||
delete []_encryptedData;
|
||||
|
||||
if (!File::Exists(pathRawSave) || AskYesNo("%s already exists, overwrite?", pathRawSave))
|
||||
if (!File::Exists(pathRawSave) || AskYesNoT("%s already exists, overwrite?", pathRawSave))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "creating file %s", pathRawSave);
|
||||
|
||||
@ -375,7 +375,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
|
||||
if (__name.length() > 0x44)
|
||||
{
|
||||
PanicAlert("%s is too long for the filename, max chars is 45", __name.c_str());
|
||||
PanicAlertT("%s is too long for the filename, max chars is 45", __name.c_str());
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -392,14 +392,14 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
{
|
||||
if (_fileSize == 0)
|
||||
{
|
||||
PanicAlert("%s is a 0 byte file", FilesList.at(i).c_str());
|
||||
PanicAlertT("%s is a 0 byte file", FilesList.at(i).c_str());
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
fpRawSaveFile = fopen(FilesList.at(i).c_str(), "rb");
|
||||
if (!fpRawSaveFile)
|
||||
{
|
||||
PanicAlert("%s failed to open", FilesList.at(i).c_str());
|
||||
PanicAlertT("%s failed to open", FilesList.at(i).c_str());
|
||||
b_valid = false;
|
||||
}
|
||||
__data = new u8[_roundedfileSize];
|
||||
@ -407,7 +407,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
memset(__data, 0, _roundedfileSize);
|
||||
if (fread(__data, _fileSize, 1, fpRawSaveFile) != 1)
|
||||
{
|
||||
PanicAlert("failed to read data from file: %s", FilesList.at(i).c_str());
|
||||
PanicAlertT("failed to read data from file: %s", FilesList.at(i).c_str());
|
||||
b_valid = false;
|
||||
}
|
||||
fclose(fpRawSaveFile);
|
||||
@ -530,14 +530,14 @@ bool CWiiSaveCrypted::getPaths(bool forExport)
|
||||
if(!File::IsDirectory(pathSavedir))
|
||||
{
|
||||
b_valid = false;
|
||||
PanicAlert("No save folder found for title %s", _saveGameString);
|
||||
PanicAlertT("No save folder found for title %s", _saveGameString);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!File::Exists(pathBanner_bin))
|
||||
{
|
||||
b_valid = false;
|
||||
PanicAlert("No banner file found for title %s", _saveGameString);
|
||||
PanicAlertT("No banner file found for title %s", _saveGameString);
|
||||
return false;
|
||||
}
|
||||
if (strlen(pathData_bin) == 0)
|
||||
@ -548,7 +548,7 @@ bool CWiiSaveCrypted::getPaths(bool forExport)
|
||||
else
|
||||
{
|
||||
File::CreateFullPath(pathSavedir);
|
||||
if (!AskYesNo("Warning! it is advised to backup all files in the folder:\n%s\nDo you wish to continue?", pathSavedir))
|
||||
if (!AskYesNoT("Warning! it is advised to backup all files in the folder:\n%s\nDo you wish to continue?", pathSavedir))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -258,7 +258,7 @@ bool NetPlay::StartGame(const std::string &path)
|
||||
{
|
||||
if (m_is_running)
|
||||
{
|
||||
PanicAlert("%s", _wxt("Game is already running!"));
|
||||
PanicAlertT("Game is already running!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -288,7 +288,7 @@ bool NetPlay::StopGame()
|
||||
|
||||
if (false == m_is_running)
|
||||
{
|
||||
PanicAlert("%s", _wxt("Game isn't running!"));
|
||||
PanicAlertT("Game isn't running!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -40,16 +40,16 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, const s
|
||||
switch (error)
|
||||
{
|
||||
case CON_ERR_SERVER_FULL :
|
||||
PanicAlert("%s", _wxt("The server is full!"));
|
||||
PanicAlertT("The server is full!");
|
||||
break;
|
||||
case CON_ERR_VERSION_MISMATCH :
|
||||
PanicAlert("%s", _wxt("The server and client's NetPlay versions are incompatible!"));
|
||||
PanicAlertT("The server and client's NetPlay versions are incompatible!");
|
||||
break;
|
||||
case CON_ERR_GAME_RUNNING :
|
||||
PanicAlert("%s", _wxt("The server responded: the game is currently running!"));
|
||||
PanicAlertT("The server responded: the game is currently running!");
|
||||
break;
|
||||
default :
|
||||
PanicAlert("%s", _wxt("The server sent an unknown error message!"));
|
||||
PanicAlertT("The server sent an unknown error message!");
|
||||
break;
|
||||
}
|
||||
m_socket.Close();
|
||||
@ -69,7 +69,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, const s
|
||||
|
||||
UpdateGUI();
|
||||
|
||||
//PanicAlert("Connection successful: assigned player id: %d", m_pid);
|
||||
//PanicAlertT("Connection successful: assigned player id: %d", m_pid);
|
||||
is_connected = true;
|
||||
|
||||
m_selector.Add(m_socket);
|
||||
@ -77,7 +77,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, const s
|
||||
}
|
||||
}
|
||||
else
|
||||
PanicAlert("%s", _wxt("Failed to Connect!"));
|
||||
PanicAlertT("Failed to Connect!");
|
||||
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||
|
||||
case NP_MSG_DISABLE_GAME :
|
||||
{
|
||||
PanicAlert("%s", _wxt("Other client disconnected while game is running!! NetPlay is disabled. You manually stop the game."));
|
||||
PanicAlertT("Other client disconnected while game is running!! NetPlay is disabled. You manually stop the game.");
|
||||
CritLocker game_lock(m_crit.game); // lock game state
|
||||
m_is_running = false;
|
||||
NetPlay_Disable();
|
||||
@ -229,7 +229,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||
break;
|
||||
|
||||
default :
|
||||
PanicAlert(_wxt("Unknown message received with id : %d"), mid);
|
||||
PanicAlertT("Unknown message received with id : %d", mid);
|
||||
break;
|
||||
|
||||
}
|
||||
@ -256,7 +256,7 @@ void NetPlayClient::Entry()
|
||||
m_is_running = false;
|
||||
NetPlay_Disable();
|
||||
AppendChatGUI("< LOST CONNECTION TO SERVER >");
|
||||
PanicAlert("%s", _wxt("Lost connection to server!"));
|
||||
PanicAlertT("Lost connection to server!");
|
||||
m_do_loop = false;
|
||||
break;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ NetPlayServer::NetPlayServer(const u16 port, const std::string& name, NetPlayDia
|
||||
// add self to player list
|
||||
m_players[m_socket] = player;
|
||||
m_local_player = &m_players[m_socket];
|
||||
//PanicAlert("Listening");
|
||||
//PanicAlertT("Listening");
|
||||
|
||||
UpdateGUI();
|
||||
|
||||
@ -55,7 +55,7 @@ void NetPlayServer::Entry()
|
||||
// update pings every so many seconds
|
||||
if ((m_ping_timer.GetTimeElapsed() > (10 * 1000)) || m_update_pings)
|
||||
{
|
||||
//PanicAlert("sending pings");
|
||||
//PanicAlertT("sending pings");
|
||||
|
||||
m_ping_key = Common::Timer::GetTimeMs();
|
||||
|
||||
@ -257,7 +257,7 @@ unsigned int NetPlayServer::OnDisconnect(sf::SocketTCP& socket)
|
||||
{
|
||||
if (m_is_running)
|
||||
{
|
||||
PanicAlert("%s", _wxt("Client disconnect while game is running!! NetPlay is disabled. You must manually stop the game."));
|
||||
PanicAlertT("Client disconnect while game is running!! NetPlay is disabled. You must manually stop the game.");
|
||||
CritLocker game_lock(m_crit.game); // lock game state
|
||||
m_is_running = false;
|
||||
NetPlay_Disable();
|
||||
@ -487,7 +487,7 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, sf::SocketTCP& socket)
|
||||
|
||||
if (m_ping_key == ping_key)
|
||||
{
|
||||
//PanicAlert("good pong");
|
||||
//PanicAlertT("good pong");
|
||||
player.ping = ping;
|
||||
}
|
||||
UpdateGUI();
|
||||
@ -501,7 +501,7 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, sf::SocketTCP& socket)
|
||||
break;
|
||||
|
||||
default :
|
||||
PanicAlert(_wxt("Unknown message with id:%d received from player:%d Kicking player!"), mid, player.pid);
|
||||
PanicAlertT("Unknown message with id:%d received from player:%d Kicking player!", mid, player.pid);
|
||||
// unknown message, kick the client
|
||||
return 1;
|
||||
break;
|
||||
|
@ -174,13 +174,13 @@ void NetPlaySetupDiag::OnHost(wxCommandEvent&)
|
||||
{
|
||||
if (::netplay_ptr)
|
||||
{
|
||||
PanicAlert("%s", _wxt("A NetPlay window is already open!!"));
|
||||
PanicAlertT("A NetPlay window is already open!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (-1 == m_game_lbox->GetSelection())
|
||||
{
|
||||
PanicAlert("%s", _wxt("You must choose a game!!"));
|
||||
PanicAlertT("You must choose a game!!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ void NetPlaySetupDiag::OnHost(wxCommandEvent&)
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlert("%s", _wxt("Failed to Listen!!"));
|
||||
PanicAlertT("Failed to Listen!!");
|
||||
npd->Destroy();
|
||||
// dialog will delete netplay
|
||||
//delete ::netplay_ptr;
|
||||
@ -210,7 +210,7 @@ void NetPlaySetupDiag::OnJoin(wxCommandEvent&)
|
||||
{
|
||||
if (::netplay_ptr)
|
||||
{
|
||||
PanicAlert("%s", _wxt("A NetPlay window is already open!!"));
|
||||
PanicAlertT("A NetPlay window is already open!!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ void NetPlaySetupDiag::OnJoin(wxCommandEvent&)
|
||||
}
|
||||
else
|
||||
{
|
||||
//PanicAlert("Failed to Connect!!");
|
||||
//PanicAlertT("Failed to Connect!!");
|
||||
npd->Destroy();
|
||||
// dialog will delete netplay
|
||||
//delete ::netplay_ptr;
|
||||
@ -373,7 +373,7 @@ void NetPlayDiag::OnStart(wxCommandEvent&)
|
||||
if (path.length())
|
||||
::netplay_ptr->StartGame(path);
|
||||
else
|
||||
PanicAlert("%s", _wxt("Game not found!!"));
|
||||
PanicAlertT("Game not found!!");
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnStop(wxCommandEvent&)
|
||||
@ -492,7 +492,8 @@ void NetPlayDiag::OnConfigPads(wxCommandEvent&)
|
||||
pmd->Destroy();
|
||||
|
||||
if (false == ((NetPlayServer*)::netplay_ptr)->SetPadMapping(pid, mapping))
|
||||
PanicAlert("%s", _wxt("Could not set pads. The player left or the game is currently running!\n(setting pads while the game is running is not yet supported)"));
|
||||
PanicAlertT("Could not set pads. The player left or the game is currently running!\n"
|
||||
"(setting pads while the game is running is not yet supported)");
|
||||
}
|
||||
|
||||
ChangeGameDiag::ChangeGameDiag(wxWindow* const parent, const CGameListCtrl* const game_list, wxString& game_name)
|
||||
|
@ -110,12 +110,13 @@ void WiimoteConfigDiag::PairUpRealWiimotes(wxCommandEvent&)
|
||||
if (paired > 0)
|
||||
{
|
||||
// Will this message be anoying?
|
||||
//PanicAlert("Paired %d wiimotes.", paired);
|
||||
//PanicAlertT("Paired %d wiimotes.", paired);
|
||||
WiimoteReal::Refresh();
|
||||
UpdateGUI();
|
||||
}
|
||||
else if (paired < 0)
|
||||
PanicAlert("%s", _wxt("A supported bluetooth device was not found!\n(Only the Microsoft bluetooth stack is supported.)"));
|
||||
PanicAlertT("A supported bluetooth device was not found!\n"
|
||||
"(Only the Microsoft bluetooth stack is supported.)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user