2017-09-03 05:57:35 +00:00
|
|
|
#include <QApplication>
|
2017-09-01 13:13:12 +00:00
|
|
|
|
2017-09-02 13:07:40 +00:00
|
|
|
#include "../common/version.h"
|
2017-09-11 03:54:19 +00:00
|
|
|
#include "driver/drivermanager.h"
|
2017-09-03 09:20:37 +00:00
|
|
|
#include "fortcommon.h"
|
2017-09-01 15:13:17 +00:00
|
|
|
#include "fortmanager.h"
|
2017-09-03 09:20:37 +00:00
|
|
|
#include "fortsettings.h"
|
2017-08-23 13:52:22 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2017-09-01 13:13:12 +00:00
|
|
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
2017-09-02 13:07:40 +00:00
|
|
|
|
2017-09-03 05:57:35 +00:00
|
|
|
QApplication app(argc, argv);
|
2017-09-02 13:07:40 +00:00
|
|
|
app.setApplicationName(APP_NAME);
|
|
|
|
app.setApplicationVersion(APP_VERSION_STR);
|
|
|
|
app.setApplicationDisplayName(APP_NAME " v" APP_VERSION_STR);
|
2017-08-23 13:52:22 +00:00
|
|
|
|
2017-09-11 03:54:19 +00:00
|
|
|
FortSettings fortSettings(qApp->arguments());
|
2017-09-03 09:20:37 +00:00
|
|
|
|
|
|
|
// Register booted provider and exit
|
2017-09-11 03:54:19 +00:00
|
|
|
if (fortSettings.boot()) {
|
2017-09-03 09:20:37 +00:00
|
|
|
FortCommon::provUnregister();
|
|
|
|
return FortCommon::provRegister(true);
|
|
|
|
}
|
|
|
|
|
2017-09-11 03:54:19 +00:00
|
|
|
FortManager fortManager(&fortSettings);
|
|
|
|
|
|
|
|
// Error: Cannot open the driver device
|
|
|
|
if (!fortManager.driverManager()->isDeviceOpened())
|
|
|
|
return 1;
|
|
|
|
|
2017-09-03 05:57:35 +00:00
|
|
|
fortManager.showTrayIcon();
|
2017-09-01 13:13:12 +00:00
|
|
|
|
2017-08-23 13:52:22 +00:00
|
|
|
return app.exec();
|
|
|
|
}
|