#include <QApplication>
//#include <QPlastiqueStyle>
#include "mainwindow.h"
#ifdef Q_WS_QWS
#include <QtGui/QWSServer>
#include <QtCore/QSettings>
#endif
//#include "mygraphicsview.h"
#include <Logger.h>
#include <ConsoleAppender.h>
#include <FileAppender.h>
#include <OutputDebugAppender.h>
//#include <QPlastiqueStyle>
#include "INIManager.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
//    a.setStyle(new QPlastiqueStyle);
//    a.setStyle(new QPlastiqueStyle);
    FileAppender *fileAppender = new FileAppender(INIMANAGER.logfilePfadName());
    fileAppender->setMaxBackupIndex(1);         //Maximal 1 Backup File
    fileAppender->setMaxFileSize(5*1024*1024);  //Maximal 5MByte pro Logdatei
    fileAppender->setFormat("%t{dd.MM.yyyy HH:mm:ss.zzz} [%-7l] %m\n");
    LoggerEx::registerAppender(fileAppender);

#ifdef DEBUG
    OutputDebugAppender *outputDebugAppender = new OutputDebugAppender();
    outputDebugAppender->setFormat("%t{HH:mm:ss.zzz} [%-7l] %m\n");
    LoggerEx::registerAppender(outputDebugAppender);
#endif

#ifdef Q_WS_QWS
    QSettings settings("/doc/system/amk", QSettings::IniFormat);
    QString mouse = settings.value ("MOUSE").toString ();
    if (mouse.startsWith ("off"))
        QWSServer::setCursorVisible(false);
#endif
    MainWindow w;
#ifdef Q_WS_QWS
    w.showFullScreen();
#else
    w.show/*FullScreen*/();
#endif

//    MyGraphicsView view;
//    view.show();
    return a.exec();

}
