#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    QString configFilename = "config.xml";
    QString logFilename = "";
    int use_gestures = -1;
    if(argc>1)
    {
        configFilename = argv[1];

        if(argc>3)
        {
            system("mkdir logs");
            logFilename = QString("logs\\")+argv[2]+"!"+argv[3]+"!"+argv[1];
            cout<<"log event file:"<<logFilename.toLatin1().data()<<endl;
            if(argc>4)
            {
                if(QString(argv[4])=="gestures_on")
                {

                    use_gestures = 1;
                } else if(QString(argv[4])=="gestures_off")
                {
                    use_gestures = 0;
                }
                logFilename +=QString("!")+argv[4];
            }
        }
    }
    w.showMaximized();
    cout<<"configFilename"<<configFilename.toLatin1().data()<<endl;
    w.init(configFilename,logFilename,use_gestures);

    return a.exec();
}
