2021-07-16 17:30:00 -07:00
|
|
|
#include <sys/resource.h>
|
|
|
|
|
|
2020-08-20 17:16:44 +02:00
|
|
|
#include <QApplication>
|
2022-07-08 20:25:54 -07:00
|
|
|
#include <QTranslator>
|
2020-08-20 17:16:44 +02:00
|
|
|
|
2022-06-11 16:38:24 -07:00
|
|
|
#include "system/hardware/hw.h"
|
2021-05-09 13:15:17 +08:00
|
|
|
#include "selfdrive/ui/qt/qt_window.h"
|
2021-06-09 20:09:49 +08:00
|
|
|
#include "selfdrive/ui/qt/util.h"
|
2021-05-09 13:15:17 +08:00
|
|
|
#include "selfdrive/ui/qt/window.h"
|
2020-08-20 17:16:44 +02:00
|
|
|
|
2020-08-27 11:57:31 -07:00
|
|
|
int main(int argc, char *argv[]) {
|
2021-07-16 17:30:00 -07:00
|
|
|
setpriority(PRIO_PROCESS, 0, -20);
|
|
|
|
|
|
2021-07-02 14:01:59 +02:00
|
|
|
qInstallMessageHandler(swagLogMessageHandler);
|
2022-02-25 14:36:27 +01:00
|
|
|
initApp(argc, argv);
|
2020-08-20 21:33:32 +02:00
|
|
|
|
2022-07-08 20:25:54 -07:00
|
|
|
QTranslator translator;
|
|
|
|
|
QString translation_file = QString::fromStdString(Params().get("LanguageSetting"));
|
|
|
|
|
if (!translator.load(translation_file, "translations") && translation_file.length()) {
|
|
|
|
|
qCritical() << "Failed to load translation file:" << translation_file;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-20 17:16:44 +02:00
|
|
|
QApplication a(argc, argv);
|
2022-07-08 20:25:54 -07:00
|
|
|
a.installTranslator(&translator);
|
|
|
|
|
|
2020-08-20 17:16:44 +02:00
|
|
|
MainWindow w;
|
2020-11-24 22:07:03 -08:00
|
|
|
setMainWindow(&w);
|
2020-11-20 13:21:18 +01:00
|
|
|
a.installEventFilter(&w);
|
2020-08-20 17:16:44 +02:00
|
|
|
return a.exec();
|
|
|
|
|
}
|