|
|
@ -3,6 +3,7 @@ |
|
|
|
#include <cstdio> |
|
|
|
#include <cstdio> |
|
|
|
#include <cstdlib> |
|
|
|
#include <cstdlib> |
|
|
|
#include <sstream> |
|
|
|
#include <sstream> |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
|
|
|
|
#include <QApplication> |
|
|
|
#include <QApplication> |
|
|
|
#include <QLabel> |
|
|
|
#include <QLabel> |
|
|
@ -10,13 +11,12 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include <curl/curl.h> |
|
|
|
#include <curl/curl.h> |
|
|
|
|
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "common/util.h" |
|
|
|
#include "common/util.h" |
|
|
|
#include "system/hardware/hw.h" |
|
|
|
#include "system/hardware/hw.h" |
|
|
|
#include "selfdrive/ui/qt/api.h" |
|
|
|
#include "selfdrive/ui/qt/api.h" |
|
|
|
#include "selfdrive/ui/qt/qt_window.h" |
|
|
|
#include "selfdrive/ui/qt/qt_window.h" |
|
|
|
#include "selfdrive/ui/qt/offroad/networking.h" |
|
|
|
#include "selfdrive/ui/qt/offroad/networking.h" |
|
|
|
|
|
|
|
#include "selfdrive/ui/qt/util.h" |
|
|
|
#include "selfdrive/ui/qt/widgets/input.h" |
|
|
|
#include "selfdrive/ui/qt/widgets/input.h" |
|
|
|
|
|
|
|
|
|
|
|
const std::string USER_AGENT = "AGNOSSetup-"; |
|
|
|
const std::string USER_AGENT = "AGNOSSetup-"; |
|
|
@ -308,6 +308,10 @@ void Setup::nextPage() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Setup::Setup(QWidget *parent) : QStackedWidget(parent) { |
|
|
|
Setup::Setup(QWidget *parent) : QStackedWidget(parent) { |
|
|
|
|
|
|
|
if (std::getenv("MULTILANG")) { |
|
|
|
|
|
|
|
selectLanguage(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::stringstream buffer; |
|
|
|
std::stringstream buffer; |
|
|
|
buffer << std::ifstream("/sys/class/hwmon/hwmon1/in1_input").rdbuf(); |
|
|
|
buffer << std::ifstream("/sys/class/hwmon/hwmon1/in1_input").rdbuf(); |
|
|
|
float voltage = (float)std::atoi(buffer.str().c_str()) / 1000.; |
|
|
|
float voltage = (float)std::atoi(buffer.str().c_str()) / 1000.; |
|
|
@ -370,6 +374,18 @@ Setup::Setup(QWidget *parent) : QStackedWidget(parent) { |
|
|
|
)"); |
|
|
|
)"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Setup::selectLanguage() { |
|
|
|
|
|
|
|
QMap<QString, QString> langs = getSupportedLanguages(); |
|
|
|
|
|
|
|
QString selection = MultiOptionDialog::getSelection(tr("Select a language"), langs.keys(), "", this); |
|
|
|
|
|
|
|
if (!selection.isEmpty()) { |
|
|
|
|
|
|
|
QString selectedLang = langs[selection]; |
|
|
|
|
|
|
|
Params().put("LanguageSetting", selectedLang.toStdString()); |
|
|
|
|
|
|
|
if (translator.load(":/" + selectedLang)) { |
|
|
|
|
|
|
|
qApp->installTranslator(&translator); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) { |
|
|
|
int main(int argc, char *argv[]) { |
|
|
|
QApplication a(argc, argv); |
|
|
|
QApplication a(argc, argv); |
|
|
|
Setup setup; |
|
|
|
Setup setup; |
|
|
|