1 #include "SUITApp_Application.h"
3 #include "SUIT_MessageBox.h"
4 #include "SUIT_ExceptionHandler.h"
16 SUITApp_Application::SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* hand )
17 : QApplication( argc, argv ),
18 myExceptHandler( hand )
20 QString path = QFileInfo( argv[0] ).dirPath() + QDir::separator() + "../../resources";
21 path = QDir::convertSeparators( QDir( path ).canonicalPath() );
23 QTranslator* strTbl = new QTranslator( 0 );
24 if ( strTbl->load( "SUITApp_msg_en.po", path ) )
25 installTranslator( strTbl );
30 SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand )
31 : QApplication( argc, argv, type ),
32 myExceptHandler( hand )
34 QTranslator* strTbl = new QTranslator( 0 );
35 strTbl->load( "resources\\SUITApp_msg_en.po" );
36 installTranslator( strTbl );
39 bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
41 return myExceptHandler ? myExceptHandler->handle( receiver, e ) :
42 QApplication::notify( receiver, e );
45 void SUITApp_Application::setHandler( SUIT_ExceptionHandler* hand )
47 myExceptHandler = hand;
50 SUIT_ExceptionHandler* SUITApp_Application::handler() const
52 return myExceptHandler;