CString -> RString
This commit is contained in:
@@ -10,19 +10,19 @@
|
||||
#include "RageThreads.h"
|
||||
|
||||
#if !defined(SMPACKAGE)
|
||||
static Preference<CString> g_sIgnoredDialogs( "IgnoredDialogs", "" );
|
||||
static Preference<RString> g_sIgnoredDialogs( "IgnoredDialogs", "" );
|
||||
#endif
|
||||
|
||||
#include "Selector_Dialog.h"
|
||||
DialogDriver *MakeDialogDriver()
|
||||
{
|
||||
CString sDrivers = "win32,cocoa,null";
|
||||
vector<CString> asDriversToTry;
|
||||
RString sDrivers = "win32,cocoa,null";
|
||||
vector<RString> asDriversToTry;
|
||||
split( sDrivers, ",", asDriversToTry, true );
|
||||
|
||||
ASSERT( asDriversToTry.size() != 0 );
|
||||
|
||||
CString sDriver;
|
||||
RString sDriver;
|
||||
DialogDriver *pRet = NULL;
|
||||
|
||||
for( unsigned i = 0; pRet == NULL && i < asDriversToTry.size(); ++i )
|
||||
@@ -44,7 +44,7 @@ DialogDriver *MakeDialogDriver()
|
||||
continue;
|
||||
}
|
||||
|
||||
CString sError = pRet->Init();
|
||||
RString sError = pRet->Init();
|
||||
if( sError != "" )
|
||||
{
|
||||
if( LOG )
|
||||
@@ -77,10 +77,10 @@ void Dialog::Shutdown()
|
||||
g_pImpl = NULL;
|
||||
}
|
||||
|
||||
static bool MessageIsIgnored( CString sID )
|
||||
static bool MessageIsIgnored( RString sID )
|
||||
{
|
||||
#if !defined(SMPACKAGE)
|
||||
vector<CString> asList;
|
||||
vector<RString> asList;
|
||||
split( g_sIgnoredDialogs, ",", asList );
|
||||
for( unsigned i = 0; i < asList.size(); ++i )
|
||||
if( !sID.CompareNoCase(asList[i]) )
|
||||
@@ -89,7 +89,7 @@ static bool MessageIsIgnored( CString sID )
|
||||
return false;
|
||||
}
|
||||
|
||||
void Dialog::IgnoreMessage( CString sID )
|
||||
void Dialog::IgnoreMessage( RString sID )
|
||||
{
|
||||
/* We can't ignore messages before PREFSMAN is around. */
|
||||
#if !defined(SMPACKAGE)
|
||||
@@ -106,7 +106,7 @@ void Dialog::IgnoreMessage( CString sID )
|
||||
if( MessageIsIgnored(sID) )
|
||||
return;
|
||||
|
||||
vector<CString> asList;
|
||||
vector<RString> asList;
|
||||
split( g_sIgnoredDialogs, ",", asList );
|
||||
asList.push_back( sID );
|
||||
g_sIgnoredDialogs.Set( join(",",asList) );
|
||||
@@ -114,7 +114,7 @@ void Dialog::IgnoreMessage( CString sID )
|
||||
#endif
|
||||
}
|
||||
|
||||
void Dialog::Error( CString sMessage, CString sID )
|
||||
void Dialog::Error( RString sMessage, RString sID )
|
||||
{
|
||||
Dialog::Init();
|
||||
|
||||
@@ -136,7 +136,7 @@ void Dialog::SetWindowed( bool bWindowed )
|
||||
g_bWindowed = bWindowed;
|
||||
}
|
||||
|
||||
void Dialog::OK( CString sMessage, CString sID )
|
||||
void Dialog::OK( RString sMessage, RString sID )
|
||||
{
|
||||
Dialog::Init();
|
||||
|
||||
@@ -157,7 +157,7 @@ void Dialog::OK( CString sMessage, CString sID )
|
||||
RageThread::SetIsShowingDialog( false );
|
||||
}
|
||||
|
||||
Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString sID )
|
||||
Dialog::Result Dialog::AbortRetryIgnore( RString sMessage, RString sID )
|
||||
{
|
||||
Dialog::Init();
|
||||
|
||||
@@ -181,7 +181,7 @@ Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString sID )
|
||||
return ret;
|
||||
}
|
||||
|
||||
Dialog::Result Dialog::AbortRetry( CString sMessage, CString sID )
|
||||
Dialog::Result Dialog::AbortRetry( RString sMessage, RString sID )
|
||||
{
|
||||
Dialog::Init();
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace Dialog
|
||||
void SetWindowed( bool bWindowed );
|
||||
|
||||
enum Result { abort, retry, ignore };
|
||||
void Error( CString sError, CString sID = "" );
|
||||
void OK( CString sMessage, CString sID = "" );
|
||||
Result AbortRetryIgnore( CString sMessage, CString sID = "" );
|
||||
Result AbortRetry( CString sMessage, CString sID = "" );
|
||||
void Error( RString sError, RString sID = "" );
|
||||
void OK( RString sMessage, RString sID = "" );
|
||||
Result AbortRetryIgnore( RString sMessage, RString sID = "" );
|
||||
Result AbortRetry( RString sMessage, RString sID = "" );
|
||||
|
||||
/* for DialogDrivers */
|
||||
void IgnoreMessage( CString sID );
|
||||
void IgnoreMessage( RString sID );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
class DialogDriver
|
||||
{
|
||||
public:
|
||||
virtual void Error( CString sMessage, CString sID ) { printf("Error: %s\n", sMessage.c_str()); }
|
||||
virtual void OK( CString sMessage, CString sID ) {}
|
||||
virtual Dialog::Result AbortRetryIgnore( CString sMessage, CString sID ) { return Dialog::ignore; }
|
||||
virtual Dialog::Result AbortRetry( CString sMessage, CString sID ) { return Dialog::abort; }
|
||||
virtual void Error( RString sMessage, RString sID ) { printf("Error: %s\n", sMessage.c_str()); }
|
||||
virtual void OK( RString sMessage, RString sID ) {}
|
||||
virtual Dialog::Result AbortRetryIgnore( RString sMessage, RString sID ) { return Dialog::ignore; }
|
||||
virtual Dialog::Result AbortRetry( RString sMessage, RString sID ) { return Dialog::abort; }
|
||||
|
||||
virtual CString Init() { return CString(); }
|
||||
virtual RString Init() { return RString(); }
|
||||
virtual ~DialogDriver() { }
|
||||
};
|
||||
|
||||
|
||||
@@ -10,15 +10,16 @@
|
||||
#include "archutils/win32/AppInstance.h"
|
||||
#include "archutils/win32/GotoURL.h"
|
||||
#include "archutils/win32/RestartProgram.h"
|
||||
#include "archutils/win32/WindowsResources.h"
|
||||
#if !defined(SMPACKAGE)
|
||||
#include "archutils/win32/WindowsResources.h"
|
||||
#include "archutils/win32/GraphicsWindow.h"
|
||||
#endif
|
||||
|
||||
static bool g_bHush;
|
||||
static CString g_sMessage;
|
||||
static RString g_sMessage;
|
||||
static bool g_bAllowHush;
|
||||
|
||||
#if !defined(SMPACKAGE)
|
||||
static BOOL CALLBACK OKWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( msg )
|
||||
@@ -40,7 +41,7 @@ static BOOL CALLBACK OKWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
|
||||
SetWindowLong( hHushButton, GWL_STYLE, iStyle );
|
||||
|
||||
// Set static text.
|
||||
CString sMessage = g_sMessage;
|
||||
RString sMessage = g_sMessage;
|
||||
sMessage.Replace( "\n", "\r\n" );
|
||||
SetWindowText( GetDlgItem(hWnd, IDC_MESSAGE), sMessage );
|
||||
|
||||
@@ -68,6 +69,7 @@ static BOOL CALLBACK OKWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static HWND GetHwnd()
|
||||
{
|
||||
@@ -78,7 +80,7 @@ static HWND GetHwnd()
|
||||
#endif
|
||||
}
|
||||
|
||||
static CString GetWindowTitle()
|
||||
static RString GetWindowTitle()
|
||||
{
|
||||
#if !defined(SMPACKAGE)
|
||||
return CommonMetrics::WINDOW_TITLE.IsLoaded() ? CommonMetrics::WINDOW_TITLE.GetValue() : PRODUCT_NAME;
|
||||
@@ -87,18 +89,22 @@ static CString GetWindowTitle()
|
||||
#endif
|
||||
}
|
||||
|
||||
void DialogDriver_Win32::OK( CString sMessage, CString sID )
|
||||
void DialogDriver_Win32::OK( RString sMessage, RString sID )
|
||||
{
|
||||
g_bAllowHush = sID != "";
|
||||
g_sMessage = sMessage;
|
||||
AppInstance handle;
|
||||
#if !defined(SMPACKAGE)
|
||||
DialogBox( handle.Get(), MAKEINTRESOURCE(IDD_OK), ::GetHwnd(), OKWndProc );
|
||||
#else
|
||||
::MessageBox( NULL, sMessage, GetWindowTitle(), MB_OK );
|
||||
#endif
|
||||
if( g_bAllowHush && g_bHush )
|
||||
Dialog::IgnoreMessage( sID );
|
||||
}
|
||||
|
||||
#if !defined(SMPACKAGE)
|
||||
static CString g_sErrorString;
|
||||
static RString g_sErrorString;
|
||||
|
||||
static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
@@ -107,7 +113,7 @@ static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
// Set static text
|
||||
CString sMessage = g_sErrorString;
|
||||
RString sMessage = g_sErrorString;
|
||||
sMessage.Replace( "\n", "\r\n" );
|
||||
SetWindowText( GetDlgItem(hWnd, IDC_EDIT_ERROR), sMessage );
|
||||
}
|
||||
@@ -155,7 +161,7 @@ static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||
}
|
||||
#endif
|
||||
|
||||
void DialogDriver_Win32::Error( CString sError, CString sID )
|
||||
void DialogDriver_Win32::Error( RString sError, RString sID )
|
||||
{
|
||||
#if !defined(SMPACKAGE)
|
||||
g_sErrorString = sError;
|
||||
@@ -166,7 +172,7 @@ void DialogDriver_Win32::Error( CString sError, CString sID )
|
||||
#endif
|
||||
}
|
||||
|
||||
Dialog::Result DialogDriver_Win32::AbortRetryIgnore( CString sMessage, CString ID )
|
||||
Dialog::Result DialogDriver_Win32::AbortRetryIgnore( RString sMessage, RString ID )
|
||||
{
|
||||
switch( MessageBox(::GetHwnd(), sMessage, ::GetWindowTitle(), MB_ABORTRETRYIGNORE|MB_DEFBUTTON3 ) )
|
||||
{
|
||||
@@ -177,7 +183,7 @@ Dialog::Result DialogDriver_Win32::AbortRetryIgnore( CString sMessage, CString I
|
||||
}
|
||||
}
|
||||
|
||||
Dialog::Result DialogDriver_Win32::AbortRetry( CString sMessage, CString sID )
|
||||
Dialog::Result DialogDriver_Win32::AbortRetry( RString sMessage, RString sID )
|
||||
{
|
||||
switch( MessageBox(::GetHwnd(), sMessage, ::GetWindowTitle(), MB_RETRYCANCEL) )
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
class DialogDriver_Win32: public DialogDriver
|
||||
{
|
||||
public:
|
||||
void Error( CString sMessage, CString sID );
|
||||
void OK( CString sMessage, CString sID );
|
||||
Dialog::Result AbortRetryIgnore( CString sMessage, CString sID );
|
||||
Dialog::Result AbortRetry( CString sMessage, CString sID );
|
||||
void Error( RString sMessage, RString sID );
|
||||
void OK( RString sMessage, RString sID );
|
||||
Dialog::Result AbortRetryIgnore( RString sMessage, RString sID );
|
||||
Dialog::Result AbortRetry( RString sMessage, RString sID );
|
||||
};
|
||||
#define USE_DIALOG_DRIVER_WIN32
|
||||
|
||||
|
||||
Reference in New Issue
Block a user