exceptions

This commit is contained in:
Glenn Maynard
2004-11-30 20:52:25 +00:00
parent 85ca41e47c
commit 29fa454150
2 changed files with 12 additions and 8 deletions
+11 -8
View File
@@ -35,21 +35,24 @@ void Dialog::Init()
CString Driver; CString Driver;
for( unsigned i = 0; g_pImpl == NULL && i < DriversToTry.size(); ++i ) for( unsigned i = 0; g_pImpl == NULL && i < DriversToTry.size(); ++i )
{ {
try { Driver = DriversToTry[i];
Driver = DriversToTry[i];
#if defined(HAVE_DIALOG_WIN32) #if defined(HAVE_DIALOG_WIN32)
if( !DriversToTry[i].CompareNoCase("Win32") ) g_pImpl = new DialogDriver_Win32; if( !DriversToTry[i].CompareNoCase("Win32") ) g_pImpl = new DialogDriver_Win32;
#endif #endif
#if defined(HAVE_DIALOG_COCOA) #if defined(HAVE_DIALOG_COCOA)
if( !DriversToTry[i].CompareNoCase("Cocoa") ) g_pImpl = new DialogDriver_Cocoa; if( !DriversToTry[i].CompareNoCase("Cocoa") ) g_pImpl = new DialogDriver_Cocoa;
#endif #endif
if( !DriversToTry[i].CompareNoCase("Null") ) g_pImpl = new DialogDriver_Null; if( !DriversToTry[i].CompareNoCase("Null") ) g_pImpl = new DialogDriver_Null;
}
catch( const RageException &e ) if( g_pImpl == NULL )
continue;
CString sError = g_pImpl->Init();
if( sError != "" )
{ {
if( LOG ) if( LOG )
LOG->Info("Couldn't load driver %s: %s", DriversToTry[i].c_str(), e.what()); LOG->Info( "Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str() );
SAFE_DELETE( g_pImpl );
} }
} }
+1
View File
@@ -11,6 +11,7 @@ public:
virtual Dialog::Result AbortRetryIgnore( CString sMessage, CString ID ) { return Dialog::ignore; } virtual Dialog::Result AbortRetryIgnore( CString sMessage, CString ID ) { return Dialog::ignore; }
virtual Dialog::Result RetryCancel( CString sMessage, CString ID ) { return Dialog::cancel; } virtual Dialog::Result RetryCancel( CString sMessage, CString ID ) { return Dialog::cancel; }
virtual CString Init() { return ""; }
virtual ~DialogDriver() { } virtual ~DialogDriver() { }
}; };