add main window
This commit is contained in:
		@@ -1,8 +1,53 @@
 | 
				
			|||||||
#include <QtGlobal>
 | 
					#include <QtGlobal>
 | 
				
			||||||
 | 
					#include <QCoreApplication>
 | 
				
			||||||
 | 
					#include <QApplication>
 | 
				
			||||||
 | 
					#include <QDebug>
 | 
				
			||||||
 | 
					#include <QTimer>
 | 
				
			||||||
 | 
					#include <QFileInfo>
 | 
				
			||||||
 | 
					#include <QThread>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "../common/include/message_handler.h"
 | 
				
			||||||
 | 
					#include "mainwindow.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef __linux__
 | 
				
			||||||
 | 
					#include <sys/sysinfo.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef PTU5
 | 
				
			||||||
 | 
					#define SERIAL_PORT "ttymxc2"
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#define SERIAL_PORT "ttyUSB0"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main(int argc, char **argv) {
 | 
					int main(int argc, char **argv) {
 | 
				
			||||||
    Q_UNUSED(argc);
 | 
					    QByteArray const value = qgetenv("LC_ALL");
 | 
				
			||||||
    Q_UNUSED(argv);
 | 
					    if (value != "C") {
 | 
				
			||||||
 | 
					        qputenv("LC_ALL", "C");
 | 
				
			||||||
    return 0;
 | 
					    }
 | 
				
			||||||
 | 
					    // qputenv("XDG_RUNTIME_DIR", "/var/run/user/0");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    openlog("ATB-UPDATE-DC-FIRMWARE", LOG_PERROR | LOG_PID | LOG_CONS, LOG_USER);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QApplication a(argc, argv);
 | 
				
			||||||
 | 
					    QApplication::setApplicationName("ATBUpdateTool");
 | 
				
			||||||
 | 
					    QApplication::setApplicationVersion(APP_VERSION);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!messageHandlerInstalled()) { // change internal qt-QDebug-handling
 | 
				
			||||||
 | 
					        atbInstallMessageHandler(atbDebugOutput);
 | 
				
			||||||
 | 
					        setDebugLevel(LOG_NOTICE);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QThread::currentThread()->setObjectName("main thread");
 | 
				
			||||||
 | 
					    qInfo() << "Main thread" << QThread::currentThreadId();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MainWindow mw;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    mw.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
 | 
				
			||||||
 | 
					    //mw.showFullScreen();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    qCritical() << "SHOW";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    mw.show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return a.exec();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user