remove old dialog api

This commit is contained in:
Glenn Maynard
2004-06-10 22:50:46 +00:00
parent 211f9b852a
commit fc1028d431
2 changed files with 0 additions and 88 deletions
@@ -1,76 +1,8 @@
#include "global.h"
#include "ArchHooks.h"
#include "PrefsManager.h"
#include "RageUtil.h"
#include "RageDisplay.h" // for IsWindowed()
ArchHooks *HOOKS = NULL;
bool ArchHooks::MessageIsIgnored( CString ID )
{
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
for( unsigned i = 0; i < list.size(); ++i )
if( !ID.CompareNoCase(list[i]) )
return true;
return false;
}
void ArchHooks::IgnoreMessage( CString ID )
{
if( MessageIsIgnored(ID) )
return;
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
list.push_back( ID );
PREFSMAN->m_sIgnoredMessageWindows = join( ",", list );
PREFSMAN->SaveGlobalPrefsToDisk();
}
void ArchHooks::MessageBoxError( CString sMessage, CString ID )
{
if( ID != "" && MessageIsIgnored( ID ) )
return;
MessageBoxErrorPrivate( sMessage, ID );
}
void ArchHooks::MessageBoxOK( CString sMessage, CString ID )
{
if( ID != "" && MessageIsIgnored( ID ) )
return;
// only show MessageBox if windowed
if( DISPLAY && !DISPLAY->IsWindowed() )
ArchHooks::MessageBoxOKPrivate( sMessage, ID );
else
this->MessageBoxOKPrivate( sMessage, ID ); // call derived version
}
ArchHooks::MessageBoxResult ArchHooks::MessageBoxAbortRetryIgnore( CString sMessage, CString ID )
{
if( ID != "" && MessageIsIgnored( ID ) )
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
// only show MessageBox if windowed
if( DISPLAY && !DISPLAY->IsWindowed() )
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
else
return this->MessageBoxAbortRetryIgnorePrivate( sMessage, ID ); // call derived version
}
ArchHooks::MessageBoxResult ArchHooks::MessageBoxRetryCancel( CString sMessage, CString ID )
{
if( ID != "" && MessageIsIgnored( ID ) )
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
// only show MessageBox if windowed
if( DISPLAY && !DISPLAY->IsWindowed() )
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
else
return this->MessageBoxRetryCancelPrivate( sMessage, ID ); // call derived version
}
/*
* (c) 2003-2004 Glenn Maynard, Chris Danford
* All rights reserved.
-20
View File
@@ -17,24 +17,11 @@
*/
class ArchHooks
{
protected:
bool MessageIsIgnored( CString ID );
void IgnoreMessage( CString ID );
public:
/* This is called as soon as SDL is set up, the loading window is shown
* and we can safely log and throw. */
virtual void DumpDebugInfo() { }
/* Message box stuff. Not supported on all archs. The ID can be used
* to identify a class of messages, for "don't display this dialog"-type
* prompts. (Don't overload these, overload *Private below.) */
enum MessageBoxResult { abort, retry, ignore, cancel };
void MessageBoxError( CString error, CString ID = "" );
void MessageBoxOK( CString sMessage, CString ID = "" );
MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage, CString ID = "" );
MessageBoxResult MessageBoxRetryCancel( CString sMessage, CString ID = "" );
virtual ~ArchHooks() { }
/* This is called once each time through the game loop */
virtual void Update(float delta) { }
@@ -49,13 +36,6 @@ public:
virtual void ExitTimeCriticalSection() { }
virtual void SetTime( tm newtime ) { }
protected:
virtual void MessageBoxErrorPrivate( CString sMessage, CString ID ) { printf("Error: %s\n", sMessage.c_str()); }
virtual void MessageBoxOKPrivate( CString sMessage, CString ID ) {}
virtual MessageBoxResult MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID ) { return ignore; }
virtual MessageBoxResult MessageBoxRetryCancelPrivate( CString sMessage, CString ID ) { return cancel; }
};
#endif