main.cpp

Go to the documentation of this file.
00001 /****************************************************************
00002 **
00003 ** toMOTko
00004 ** 
00005 ** Small application to learn vocabulary on my Zaurus.
00006 **
00007 ** Author : Frederic Bergeron (c) 2006
00008 **
00009 ****************************************************************/
00010 
00011 #include <qpe/qpeapplication.h>
00012 #include <qfont.h>
00013 #include "Controller.h"
00014 #include "MainWindow.h"
00015 #include "zlib.h"
00016 
00017 QAction* action[ ACTION_COUNT ];
00018 
00019 int main( int argc, char **argv ) {
00020     // Check if zlib is ok.  Taken from zlib's example.c file.
00021     static const char* myVersion = ZLIB_VERSION;
00022 
00023     if( zlibVersion()[ 0 ] != myVersion[ 0 ] ) {
00024         fprintf( stderr, "incompatible zlib version\n" );
00025         exit( 1 );
00026     } else if( strcmp( zlibVersion(), ZLIB_VERSION ) != 0 ) {
00027         fprintf( stderr, "warning: different zlib version\n" );
00028     }
00029 
00030     // printf( "zlib version %s = 0x%04x, compile flags = 0x%lx\n", ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags() );
00031     // End of zlib check.
00032 
00033     QPEApplication a( argc, argv );
00034     Controller* controller = new Controller();
00035     if( !controller->init() ) {
00036         cerr << "Cannot initialize controller.  Check disk space and file permissions." << endl;
00037         exit( 2 );
00038     }
00039 
00040     QFont labelsFont( controller->getPreferences().getLabelsFont() ); 
00041     qApp->setFont( labelsFont );
00042 
00043     MainWindow* mainWindow = new MainWindow( controller );
00044     a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
00045     a.showMainWidget( mainWindow );
00046     return a.exec();
00047 }

Generated on Sun Mar 1 17:30:47 2009 for toMOTko by  doxygen 1.5.6