mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-02 13:29:30 +08:00
2c5e890a23
* rough multiple language demo
* more wrappings
* stash
* add some bad translations
* updates
* map from french to spanish still has same problem of needing to call setText on everything
* add files
* restart UI
* use return code
* relative path
* more translations
* don't loop restart
* Toggle and prime translations
* try on device
* try QComboBox with readable style
* stash
* not yet scrollable
* stash
* dynamic translations (doesn't work for dynamic widget strings yet)
* clean up multiple option selector
* store languages in json
* try transparent
* Try transparent popup
* see how this looks
* tweaks
* clean up
* clean up
* clean up 2 and missing tr
* wrap more strings
* missing updater
* fixes
* add basic test to ensure all strings wrapped
* try in CI
* clean up
* test name
* fix test
* always install qt dev tools
* fix deps
* fast test
* add section so it prints multiple errors
* debug
* debug
get rid of those
* make any difference?
* comment
* oh...
* run with offscreen platform
* try out section
* clean up
* fix missing wrappings (it works!)
* move down
* space
* clear relevant params, set TICI=1
old-commit-hash: 879a7c3201
26 lines
537 B
C++
26 lines
537 B
C++
#pragma once
|
|
|
|
#include <QJsonDocument>
|
|
#include <QLabel>
|
|
|
|
class DriveStats : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DriveStats(QWidget* parent = 0);
|
|
|
|
private:
|
|
void showEvent(QShowEvent *event) override;
|
|
void updateStats();
|
|
inline QString getDistanceUnit() const { return metric_ ? tr("KM") : tr("Miles"); }
|
|
|
|
bool metric_;
|
|
QJsonDocument stats_;
|
|
struct StatsLabels {
|
|
QLabel *routes, *distance, *distance_unit, *hours;
|
|
} all_, week_;
|
|
|
|
private slots:
|
|
void parseResponse(const QString &response, bool success);
|
|
};
|