UI: Replace a lot of PCSX2's with pxGetAppName().

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3254 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-06-21 10:25:06 +00:00
parent 8bbb5848af
commit 9fae2cc4f3
21 changed files with 64 additions and 53 deletions

View File

@ -813,6 +813,7 @@ extern wxTextCtrl* CreateNumericalTextCtrl( wxWindow* parent, int digits, long f
extern bool pxDialogExists( const wxString& name );
extern bool pxIsValidWindowPosition( const wxWindow& window, const wxPoint& windowPos );
extern wxRect wxGetDisplayArea();
extern wxString pxGetAppName();
extern int pxGetCharHeight( const wxWindow* wind, int rows=1 );
extern int pxGetCharHeight( const wxWindow& wind, int rows=1 );

View File

@ -486,3 +486,10 @@ wxFont pxGetFixedFont( int ptsize, int weight )
#endif
);
}
wxString pxGetAppName()
{
pxAssume( wxTheApp );
return wxTheApp->GetAppName();
}

View File

@ -100,7 +100,7 @@ namespace PathDefs
{
switch( mode )
{
case DocsFolder_User: return (wxDirName)Path::Combine( wxStandardPaths::Get().GetDocumentsDir(), wxGetApp().GetAppName() );
case DocsFolder_User: return (wxDirName)Path::Combine( wxStandardPaths::Get().GetDocumentsDir(), pxGetAppName() );
//case DocsFolder_CWD: return (wxDirName)wxGetCwd();
case DocsFolder_Custom: return CustomDocumentsFolder;
@ -275,7 +275,7 @@ namespace FilenameDefs
// TODO : ini extension on Win32 is normal. Linux ini filename default might differ
// from this? like pcsx2_conf or something ... ?
return wxGetApp().GetAppName() + L".ini";
return pxGetAppName() + L".ini";
}
wxFileName GetUsermodeConfig()

View File

@ -120,7 +120,7 @@ void Pcsx2App::ReadUserModeSettings()
#if 0
if( !hasGroup )
{
wxDialogWithHelpers beta( NULL, wxsFormat(_("Welcome to PCSX2 %u.%u.%u (r%u)")), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV );
wxDialogWithHelpers beta( NULL, wxsFormat(_("Welcome to %s %u.%u.%u (r%u)")), pxGetAppName(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV );
beta.SetMinWidth(480);
beta += beta.Heading(
@ -204,7 +204,7 @@ void Pcsx2App::OpenMainFrame()
if( GetMainFramePtr() != NULL ) return;
MainEmuFrame* mainFrame = new MainEmuFrame( NULL, L"PCSX2" );
MainEmuFrame* mainFrame = new MainEmuFrame( NULL, pxGetAppName() );
m_id_MainFrame = mainFrame->GetId();
PostIdleAppMethod( &Pcsx2App::OpenProgramLog );
@ -333,7 +333,7 @@ void Pcsx2App::AllocateCoreStuffs()
void Pcsx2App::OnInitCmdLine( wxCmdLineParser& parser )
{
parser.SetLogo( (wxString)L" >> PCSX2 -- A Playstation2 Emulator for the PC <<\n\n" +
parser.SetLogo( wxsFormat(L" >> %s -- A Playstation2 Emulator for the PC <<", pxGetAppName()) + L"\n\n" +
_("All options are for the current session only and will not be saved.\n")
);
@ -361,7 +361,7 @@ void Pcsx2App::OnInitCmdLine( wxCmdLineParser& parser )
parser.AddOption( wxEmptyString,L"cfgpath", _("changes the configuration file path"), wxCMD_LINE_VAL_STRING );
parser.AddOption( wxEmptyString,L"cfg", _("specifies the PCSX2 configuration file to use"), wxCMD_LINE_VAL_STRING );
parser.AddSwitch( wxEmptyString,L"forcewiz", _("forces PCSX2 to start the First-time Wizard") );
parser.AddSwitch( wxEmptyString,L"forcewiz", wxsFormat(_("forces %s to start the First-time Wizard"), pxGetAppName()) );
const PluginInfo* pi = tbl_PluginInfo; do {
parser.AddOption( wxEmptyString, pi->GetShortname().Lower(),
@ -407,7 +407,7 @@ bool Pcsx2App::ParseOverrides( wxCmdLineParser& parser )
Console.Warning( pi->GetShortname() + L" override: " + dest );
else
{
wxDialogWithHelpers okcan( NULL, _("Plugin Override Error - PCSX2") );
wxDialogWithHelpers okcan( NULL, wxsFormat(_("Plugin Override Error - %s"), pxGetAppName()) );
okcan += okcan.Heading( wxsFormat(
_("%s Plugin Override Error! The following file does not exist or is not a valid %s plugin:\n\n"),
@ -417,7 +417,7 @@ bool Pcsx2App::ParseOverrides( wxCmdLineParser& parser )
okcan += okcan.GetCharHeight();
okcan += okcan.Text(dest);
okcan += okcan.GetCharHeight();
okcan += okcan.Heading(_("Press OK to use the default configured plugin, or Cancel to close PCSX2."));
okcan += okcan.Heading(wxsFormat(_("Press OK to use the default configured plugin, or Cancel to close %s."), pxGetAppName()));
if( wxID_CANCEL == pxIssueConfirmation( okcan, MsgButtons().OKCancel() ) ) return false;
}
@ -550,7 +550,7 @@ bool Pcsx2App::OnInit()
}
catch( Exception::HardwareDeficiency& ex )
{
Msgbox::Alert( ex.FormatDisplayMessage() + _("\n\nPress OK to close PCSX2."), _("PCSX2 Error: Hardware Deficiency") );
Msgbox::Alert( ex.FormatDisplayMessage() + wxsFormat(_("\n\nPress OK to close %s."), pxGetAppName()), _("PCSX2 Error: Hardware Deficiency") );
CleanupOnExit();
return false;
}
@ -562,8 +562,8 @@ bool Pcsx2App::OnInit()
catch( Exception::RuntimeError& ex )
{
Console.Error( ex.FormatDiagnosticMessage() );
Msgbox::Alert( ex.FormatDisplayMessage() + _("\n\nPress OK to close PCSX2."),
_("PCSX2 Critical Error"), wxICON_ERROR );
Msgbox::Alert( ex.FormatDisplayMessage() + wxsFormat(_("\n\nPress OK to close %s."), pxGetAppName()),
wxsFormat(_("%s Critical Error"), pxGetAppName()), wxICON_ERROR );
CleanupOnExit();
return false;
}

View File

@ -296,7 +296,7 @@ void pxMessageOutputMessageBox::Printf(const wxChar* format, ...)
pos += 9; // strlen of [IsoFile]
wxDialogWithHelpers popup( NULL, _("PCSX2 Commandline Options") );
wxDialogWithHelpers popup( NULL, wxsFormat(_("%s Commandline Options"), pxGetAppName()) );
popup.SetMinWidth( 640 );
popup += popup.Heading(out.Mid(0, pos));
//popup += ;

View File

@ -32,7 +32,7 @@ using namespace pxSizerFlags;
// --------------------------------------------------------------------------------------
Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent )
: wxDialogWithHelpers( parent, _("About PCSX2"), pxDialogFlags().Resize().MinWidth( 460 ) )
: wxDialogWithHelpers( parent, wxsFormat(_("About %s"), pxGetAppName()), pxDialogFlags().Resize().MinWidth( 460 ) )
, m_bitmap_dualshock( this, wxID_ANY, wxBitmap( EmbeddedImage<res_Dualshock>().Get() ),
wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN
)
@ -91,7 +91,7 @@ Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent )
// Main (top-level) layout
*this += StdPadding;
*this += Text(_("PCSX2")).Bold();
*this += Text(wxGetApp().GetAppName()).Bold();
*this += Text(_("A Playstation 2 Emulator"));
*this += AuthLogoSizer | StdExpand();

View File

@ -20,7 +20,7 @@
using namespace pxSizerFlags;
Dialogs::AssertionDialog::AssertionDialog( const wxString& text, const wxString& stacktrace )
: wxDialogWithHelpers( NULL, _("PCSX2 Assertion Failure"), pxDialogFlags().Resize(!stacktrace.IsEmpty()) )
: wxDialogWithHelpers( NULL, _("Assertion Failure - ") + pxGetAppName(), pxDialogFlags().Resize(!stacktrace.IsEmpty()) )
{
SetMinWidth( 720 );

View File

@ -220,7 +220,7 @@ void Dialogs::BaseConfigurationDialog::OnScreenshot_Click( wxCommandEvent& evt )
wxString pagename( m_listbook ? (L"_" + m_listbook->GetPageText( m_listbook->GetSelection() )) : wxString() );
wxString filenameDefault;
filenameDefault.Printf( L"pcsx2_%s%s.png", GetDialogName().c_str(), pagename.c_str() );
filenameDefault.Printf( L"%s_%s%s.png", pxGetAppName().Lower(), GetDialogName().c_str(), pagename.c_str() );
filenameDefault.Replace( L"/", L"-" );
wxString filename( wxFileSelector( _("Save dialog screenshots to..."), g_Conf->Folders.Snapshots.ToString(),

View File

@ -43,7 +43,7 @@ bool ApplicableWizardPage::PrepForApply()
// ----------------------------------------------------------------------------
Panels::SettingsDirPickerPanel::SettingsDirPickerPanel( wxWindow* parent )
: DirPickerPanel( parent, FolderId_Settings, _("Settings"), _("Select a folder for PCSX2 settings") )
: DirPickerPanel( parent, FolderId_Settings, _("Settings"), wxsFormat(_("Select a folder for %s settings"), pxGetAppName()) )
{
pxSetToolTip( this, pxE( ".Tooltip:Folders:Settings",
L"This is the folder where PCSX2 saves your settings, including settings generated "
@ -69,7 +69,7 @@ FirstTimeWizard::UsermodePage::UsermodePage( wxWizard* parent ) :
m_panel_LangSel = new LanguageSelectionPanel( &panel );
m_panel_UserSel = new DocsFolderPickerPanel( &panel );
panel += panel.Heading(_("PCSX2 is starting from a new or unknown folder and needs to be configured.")).Bold();
panel += panel.Heading(wxsFormat(_("%s is starting from a new or unknown folder and needs to be configured."), pxGetAppName())).Bold();
panel += m_panel_LangSel | StdCenter();
panel += m_panel_UserSel | pxExpand.Border( wxALL, 8 );
@ -117,7 +117,7 @@ bool FirstTimeWizard::UsermodePage::PrepForApply()
if( !path.Exists() )
{
wxDialogWithHelpers dialog( NULL, _("Create folder?") );
dialog += dialog.Heading( _("PCSX2 will create the following folder for documents. You can change this setting later, at any time.") );
dialog += dialog.Heading(wxsFormat(_("%s will create the following folder for documents. You can change this setting later, at any time."), pxGetAppName()));
dialog += 12;
dialog += dialog.Heading( path.ToString() );
@ -130,7 +130,7 @@ bool FirstTimeWizard::UsermodePage::PrepForApply()
// ----------------------------------------------------------------------------
FirstTimeWizard::FirstTimeWizard( wxWindow* parent )
: wxWizard( parent, wxID_ANY, _("PCSX2 First Time Configuration") )
: wxWizard( parent, wxID_ANY, wxsFormat(_("%s First Time Configuration"), pxGetAppName()) )
, m_page_usermode ( *new UsermodePage( this ) )
, m_page_plugins ( *new ApplicableWizardPage( this, &m_page_usermode ) )
, m_page_bios ( *new ApplicableWizardPage( this, &m_page_plugins ) )

View File

@ -25,11 +25,13 @@ Dialogs::ImportSettingsDialog::ImportSettingsDialog( wxWindow* parent )
{
SetMinWidth( 440 );
pxStaticText& heading = Text( pxE( ".Popup:ImportExistingSettings",
L"Existing PCSX2 settings have been found in the configured settings folder. "
L"Would you like to import these settings or overwrite them with PCSX2 default values?"
L"\n\n(or press Cancel to select a different settings folder)" )
);
pxStaticText& heading( Text( wxsFormat(
pxE( ".Popup:ImportExistingSettings",
L"Existing %s settings have been found in the configured settings folder. "
L"Would you like to import these settings or overwrite them with %s default values?"
L"\n\n(or press Cancel to select a different settings folder)"
), pxGetAppName(), pxGetAppName()
)));
wxBoxSizer& s_buttons = *new wxBoxSizer( wxHORIZONTAL );
wxButton* b_import = new wxButton( this, wxID_ANY, _("Import") );

View File

@ -26,7 +26,7 @@ Dialogs::PickUserModeDialog::PickUserModeDialog( wxWindow* parent )
m_panel_usersel = new DocsFolderPickerPanel( this, false );
m_panel_langsel = new LanguageSelectionPanel( this );
*this += new pxStaticHeading( this, _("PCSX2 is starting from a new or unknown folder and needs to be configured.") );
*this += Heading(wxsFormat(_("%s is starting from a new or unknown folder and needs to be configured."), pxGetAppName()));
*this += m_panel_langsel | pxSizerFlags::StdCenter();
*this += m_panel_usersel | wxSizerFlags().Expand().Border( wxALL, 8 );

View File

@ -25,7 +25,7 @@
using namespace Panels;
Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent)
: BaseConfigurationDialog( parent, _("PS2 Settings - PCSX2"), 580 )
: BaseConfigurationDialog( parent, wxsFormat(_("Emulation Settings - %s"), pxGetAppName()), 580 )
{
ScopedBusyCursor busy( Cursor_ReallyBusy );
@ -45,7 +45,7 @@ Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent)
}
Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent)
: BaseConfigurationDialog( parent, _("Application Settings - PCSX2"), 600 )
: BaseConfigurationDialog( parent, wxsFormat(_("Components Selectors - %s"), pxGetAppName()), 600 )
{
ScopedBusyCursor busy( Cursor_ReallyBusy );

View File

@ -380,8 +380,8 @@ WaitingForThreadedTaskDialog::WaitingForThreadedTaskDialog( pxThread* thr, wxWin
*this += Text( content ) | StdExpand();
*this += 15;
*this += Heading( _("Press Cancel to attempt to cancel the action.") );
*this += Heading( _("Press Terminate to kill PCSX2 immediately.") );
*this += Heading(_("Press Cancel to attempt to cancel the action."));
*this += Heading(wxsFormat(_("Press Terminate to kill %s immediately."), pxGetAppName()));
*this += new wxButton( this, wxID_CANCEL );
*this += new wxButton( this, wxID_ANY, _("Terminate App") );

View File

@ -40,7 +40,7 @@ bool IsoDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen
if( filenames.GetCount() > 1 )
{
wxDialogWithHelpers dialog( m_WindowBound, _("Drag and Drop Error") );
dialog += dialog.Heading( _("It is an error to drop multiple files onto a PCSX2 window. One at a time please, thank you.") );
dialog += dialog.Heading(wxsFormat(_("It is an error to drop multiple files onto a %s window. One at a time please, thank you."), pxGetAppName()));
pxIssueConfirmation( dialog, MsgButtons().Cancel() );
return false;
}
@ -71,10 +71,11 @@ bool IsoDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen
{
wxDialogWithHelpers dialog( m_WindowBound, _("Confirm PS2 Reset") );
dialog += dialog.Heading(
_("You have dropped the following ELF binary into PCSX2:\n\n") +
filenames[0] + L"\n\n" + GetMsg_ConfirmSysReset()
);
dialog += dialog.Heading(wxsFormat(_("You have dropped the following ELF binary into %s:\n\n"), pxGetAppName()));
dialog += dialog.GetCharHeight();
dialog += dialog.Text( filenames[0] );
dialog += dialog.GetCharHeight();
dialog += dialog.Heading(GetMsg_ConfirmSysReset());
confirmed = (pxIssueConfirmation( dialog, MsgButtons().Reset().Cancel(), L"DragDrop:BootELF" ) != wxID_CANCEL);
}
@ -109,7 +110,7 @@ bool IsoDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen
if (isoDetect(&iso))
{
Console.WriteLn( L"(Drag&Drop) Found valid ISO file type!" );
SwapOrReset_Iso(m_WindowBound, stopped_core, filenames[0], _("You have dropped the following ISO image into PCSX2:"));
SwapOrReset_Iso(m_WindowBound, stopped_core, filenames[0], wxsFormat(_("You have dropped the following ISO image into %s:"), pxGetAppName()));
}
_closefile( iso.handle );

View File

@ -320,13 +320,13 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
if( PCSX2_VersionLo & 1 )
{
// Odd versions: beta / development editions, which feature revision number and compile date.
wintitle.Printf( _("PCSX2 %d.%d.%d.%d%s (svn) %s"), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
wintitle.Printf( _("%s %d.%d.%d.%d%s (svn) %s"), pxGetAppName(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
SVN_REV, SVN_MODS ? L"m" : wxEmptyString, fromUTF8(__DATE__).c_str() );
}
else
{
// evens: stable releases, with a simpler title.
wintitle.Printf( _("PCSX2 %d.%d.%d %s"), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
wintitle.Printf( _("%s %d.%d.%d %s"), pxGetAppName(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
SVN_MODS ? _("(modded)") : wxEmptyString
);
}
@ -398,7 +398,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
_("Wipes all internal VM states and shuts down plugins."));
m_menuSys.Append(MenuId_Exit, _("Exit"),
_("Closing PCSX2 may be hazardous to your health"));
wxsFormat(_("Closing %s may be hazardous to your health"), pxGetAppName()));
// ------------------------------------------------------------------------
@ -440,7 +440,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
m_menuConfig.AppendSeparator();
m_menuConfig.Append(MenuId_Config_ResetAll, _("Clear all settings..."),
_("Clears all PCSX2 settings and re-runs the startup wizard."));
wxsFormat(_("Clears all %s settings and re-runs the startup wizard."), pxGetAppName()));
// ------------------------------------------------------------------------

View File

@ -99,13 +99,13 @@ void MainEmuFrame::Menu_ResetAllSettings_Click(wxCommandEvent &event)
{
ScopedCoreThreadPopup suspender;
if( !Msgbox::OkCancel(
if( !Msgbox::OkCancel( wxsFormat(
pxE( ".Popup:DeleteSettings",
L"This command clears PCSX2 settings and allows you to re-run the First-Time Wizard. You will need to "
L"manually restart PCSX2 after this operation.\n\n"
L"WARNING!! Click OK to delete *ALL* settings for PCSX2 and force PCSX2 to shudown, losing any current emulation progress. Are you absolutely sure?"
L"This command clears %s settings and allows you to re-run the First-Time Wizard. You will need to "
L"manually restart %s after this operation.\n\n"
L"WARNING!! Click OK to delete *ALL* settings for %s and force-close the app, losing any current emulation progress. Are you absolutely sure?"
L"\n\n(note: settings for plugins are unaffected)"
),
), pxGetAppName(), pxGetAppName(), pxGetAppName() ),
_("Reset all settings?") ) )
{
suspender.AllowResume();

View File

@ -221,7 +221,7 @@ void Panels::DirPickerPanel::Apply()
if( !wxDir::Exists( path ) )
{
wxDialogWithHelpers dialog( NULL, _("Create folder?") );
dialog += dialog.Heading( _("A configured folder does not exist. Should PCSX2 try to create it?") );
dialog += dialog.Heading(wxsFormat(_("A configured folder does not exist. Should %s try to create it?"), pxGetAppName()));
dialog += 12;
dialog += dialog.Heading( path );

View File

@ -79,7 +79,7 @@ Panels::GameDatabasePanel::GameDatabasePanel( wxWindow* parent )
blankLine();
wxStaticBoxSizer& sizer2 = *new wxStaticBoxSizer(wxVERTICAL, this, _("PCSX2 Gamefixes"));
wxStaticBoxSizer& sizer2 = *new wxStaticBoxSizer(wxVERTICAL, this, _("Gamefixes"));
wxFlexGridSizer& sizer3(*new wxFlexGridSizer(3, 0, StdPadding*4));
sizer3.AddGrowableCol(0);

View File

@ -21,7 +21,7 @@ using namespace pxSizerFlags;
Panels::GameFixesPanel::GameFixesPanel( wxWindow* parent )
: BaseApplicableConfigPanel( parent )
{
wxStaticBoxSizer& groupSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("PCSX2 Gamefixes") );
wxStaticBoxSizer& groupSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Gamefixes") );
// NOTE: Order of checkboxes must match the order of the bits in the GamefixOptions structure!
// NOTE2: Don't make this static, because translations can change at run-time :)

View File

@ -63,7 +63,7 @@ Panels::DocsFolderPickerPanel::DocsFolderPickerPanel( wxWindow* parent, bool isF
m_radio_UserMode->Realize();
if( pxStaticText* woot = m_radio_UserMode->GetSubText(0) ) woot->Unwrapped(); // wrapping sucks for path names!
m_dirpicker_custom = new DirPickerPanel( this, FolderId_Documents, _("Select a document root for PCSX2") );
m_dirpicker_custom = new DirPickerPanel( this, FolderId_Documents, wxsFormat(_("Select a document root for %s"), pxGetAppName()) );
*this += Heading( isFirstTime ? usermodeExplained : usermodeWarning );
*this += m_radio_UserMode | StdExpand();

View File

@ -443,11 +443,11 @@ void Panels::PluginSelectorPanel::AppStatusEvent_OnSettingsApplied()
static wxString GetApplyFailedMsg()
{
return pxE( ".Error:PluginSelector:ApplyFailed",
L"All plugins must have valid selections for PCSX2 to run. If you are unable to make\n"
L"a valid selection due to missing plugins or an incomplete install of PCSX2, then\n"
return wxsFormat( pxE( ".Error:PluginSelector:ApplyFailed",
L"All plugins must have valid selections for %s to run. If you are unable to make\n"
L"a valid selection due to missing plugins or an incomplete install of %s, then\n"
L"press cancel to close the Configuration panel."
);
), pxGetAppName(), pxGetAppName() );
}
void Panels::PluginSelectorPanel::Apply()