int main(int argc, char **argv)
{
// Prepare log system
CConsoleLog *pConsoleLogger = new CConsoleLog;
std::string Prefix("test");
CFileLog *pFileLogger = new CFileLog(Prefix, false);
CLog::instance()->registerLogDevice(pConsoleLogger);
CLog::instance()->registerLogDevice(pFileLogger);
CLog::instance()->enableDEBUG(true);
CLog::instance()->enableMESSAGE(true);
CLog::instance()->enableWARNING(true);
CLog::instance()->enableERROR(true);
CLog::instance()->enableFATAL(true);
FlightbookManager::instance().setApplicationTitle(Application);
LOG_MESSAGE("Starting " << argv[0] <<
" compiled: " << __DATE__ << ", " << __TIME__);
#ifdef WIN32
// QApplication::setStyle(new QWindowsStyle);
#endif
App.setPalette(Palette);
App.
setWindowIcon(QIcon(":/images/applicationicon.png"));
int ret = 0;
{
MainWindow *pMainWin = new MainWindow;
pMainWin->show();
QPixmap Splash
(":/images/splash.png");
pSplash->showMessage(Application, Qt::AlignLeft|Qt::AlignBottom,
pSplash->show();
if(!pMainWin->initialize()) {
LOG_FATAL("Couldn't initialize, aborting...");
shutdown();
return 1;
}
pSplash->finish(pMainWin);
delete pSplash;
pMainWin->login("");
ret = App.exec();
delete pMainWin;
shutdown();
}
return ret;
}
int main(int argc, char **argv)
{
// Prepare log system
CConsoleLog *pConsoleLogger = new CConsoleLog;
std::string Prefix("test");
CFileLog *pFileLogger = new CFileLog(Prefix, false);
CLog::instance()->registerLogDevice(pConsoleLogger);
CLog::instance()->registerLogDevice(pFileLogger);
CLog::instance()->enableDEBUG(true);
CLog::instance()->enableMESSAGE(true);
CLog::instance()->enableWARNING(true);
CLog::instance()->enableERROR(true);
CLog::instance()->enableFATAL(true);
QString Application (QString(Flightbook::APP_STRING) + " ");
FlightbookManager::instance().setApplicationTitle(Application);
LOG_MESSAGE("Starting " << argv[0] <<
" compiled: " << __DATE__ << ", " << __TIME__);
QApplication App(argc, argv);
#ifdef WIN32
QApplication::setStyle(new QWindowsVistaStyle);
// QApplication::setStyle(new QWindowsStyle);
#endif
QCoreApplication::setOrganizationName("TEST");
QCoreApplication::setOrganizationDomain("test123.de");
QCoreApplication::setApplicationName("TEST APP");
QPalette Palette;
Palette.setColor(QPalette::Highlight, QColor(1,1,255,200));
Palette.setColor(QPalette::HighlightedText, QColor(255,255,255));
App.setPalette(Palette);
App.setWindowIcon(QIcon(":/images/applicationicon.png"));
int ret = 0;
{
MainWindow *pMainWin = new MainWindow;
pMainWin->show();
QPixmap Splash(":/images/splash.png");
QSplashScreen *pSplash = new QSplashScreen(Splash);
pSplash->showMessage(Application, Qt::AlignLeft|Qt::AlignBottom,
QColor(255, 255, 255));
pSplash->show();
if(!pMainWin->initialize()) {
LOG_FATAL("Couldn't initialize, aborting...");
shutdown();
return 1;
}
pSplash->finish(pMainWin);
delete pSplash;
pMainWin->login("");
ret = App.exec();
delete pMainWin;
shutdown();
}
return ret;
}
To copy to clipboard, switch view to plain text mode
Bookmarks