openpilot v0.9.6 release
date: 2024-01-12T10:13:37 master commit: ba792d576a49a0899b88a753fa1c52956bedf9e6
This commit is contained in:
30
selfdrive/ui/main.cc
Normal file
30
selfdrive/ui/main.cc
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "system/hardware/hw.h"
|
||||
#include "selfdrive/ui/qt/qt_window.h"
|
||||
#include "selfdrive/ui/qt/util.h"
|
||||
#include "selfdrive/ui/qt/window.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
setpriority(PRIO_PROCESS, 0, -20);
|
||||
|
||||
qInstallMessageHandler(swagLogMessageHandler);
|
||||
initApp(argc, argv);
|
||||
|
||||
QTranslator translator;
|
||||
QString translation_file = QString::fromStdString(Params().get("LanguageSetting"));
|
||||
if (!translator.load(QString(":/%1").arg(translation_file)) && translation_file.length()) {
|
||||
qCritical() << "Failed to load translation file:" << translation_file;
|
||||
}
|
||||
|
||||
QApplication a(argc, argv);
|
||||
a.installTranslator(&translator);
|
||||
|
||||
MainWindow w;
|
||||
setMainWindow(&w);
|
||||
a.installEventFilter(&w);
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user