mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 06:33:57 +08:00
UI: remove comma points (#28303)
* UI: remove comma points * remove param
This commit is contained in:
@@ -189,7 +189,6 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"ApiCache_Device", PERSISTENT},
|
||||
{"ApiCache_DriveStats", PERSISTENT},
|
||||
{"ApiCache_NavDestinations", PERSISTENT},
|
||||
{"ApiCache_Owner", PERSISTENT},
|
||||
{"Offroad_BadNvme", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_CarUnrecognized", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION},
|
||||
{"Offroad_ConnectivityNeeded", CLEAR_ON_MANAGER_START},
|
||||
|
||||
@@ -143,42 +143,9 @@ PrimeUserWidget::PrimeUserWidget(QWidget* parent) : QFrame(parent) {
|
||||
|
||||
mainLayout->addWidget(primeWidget);
|
||||
|
||||
// comma points layout
|
||||
QWidget *pointsWidget = new QWidget;
|
||||
pointsWidget->setObjectName("primeWidget");
|
||||
QVBoxLayout *pointsLayout = new QVBoxLayout(pointsWidget);
|
||||
pointsLayout->setContentsMargins(60, 50, 60, 50);
|
||||
|
||||
QLabel *commaPoints = new QLabel(tr("COMMA POINTS"));
|
||||
commaPoints->setStyleSheet("font-size: 41px; font-family: Inter SemiBold;");
|
||||
pointsLayout->addWidget(commaPoints, 0, Qt::AlignTop);
|
||||
|
||||
points = new QLabel("0");
|
||||
points->setStyleSheet("font-size: 91px; font-weight: bold;");
|
||||
pointsLayout->addWidget(points, 0, Qt::AlignTop);
|
||||
|
||||
mainLayout->addWidget(pointsWidget);
|
||||
|
||||
mainLayout->addStretch();
|
||||
|
||||
// set up API requests
|
||||
if (auto dongleId = getDongleId()) {
|
||||
QString url = CommaApi::BASE_URL + "/v1/devices/" + *dongleId + "/owner";
|
||||
RequestRepeater *repeater = new RequestRepeater(this, url, "ApiCache_Owner", 6);
|
||||
QObject::connect(repeater, &RequestRepeater::requestDone, this, &PrimeUserWidget::replyFinished);
|
||||
}
|
||||
}
|
||||
|
||||
void PrimeUserWidget::replyFinished(const QString &response) {
|
||||
QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8());
|
||||
if (doc.isNull()) {
|
||||
qDebug() << "JSON Parse failed on getting points";
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonObject json = doc.object();
|
||||
points->setText(QString::number(json["points"].toInt()));
|
||||
}
|
||||
|
||||
PrimeAdWidget::PrimeAdWidget(QWidget* parent) : QFrame(parent) {
|
||||
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
||||
|
||||
@@ -51,12 +51,6 @@ class PrimeUserWidget : public QFrame {
|
||||
|
||||
public:
|
||||
explicit PrimeUserWidget(QWidget* parent = 0);
|
||||
|
||||
private:
|
||||
QLabel *points;
|
||||
|
||||
private slots:
|
||||
void replyFinished(const QString &response);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -521,10 +521,6 @@ location set</source>
|
||||
<source>CONNECT.COMMA.AI</source>
|
||||
<translation>CONNECT.COMMA.AI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>COMMA POINTS</source>
|
||||
<translation>COMMA PUNKTE</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
||||
@@ -522,10 +522,6 @@ location set</source>
|
||||
<source>CONNECT.COMMA.AI</source>
|
||||
<translation>CONNECT.COMMA.AI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>COMMA POINTS</source>
|
||||
<translation>COMMA POINTS</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
||||
@@ -522,10 +522,6 @@ location set</source>
|
||||
<source>CONNECT.COMMA.AI</source>
|
||||
<translation>CONNECT.COMMA.AI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>COMMA POINTS</source>
|
||||
<translation>COMMA POINTS</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
||||
@@ -523,10 +523,6 @@ trabalho definido</translation>
|
||||
<source>CONNECT.COMMA.AI</source>
|
||||
<translation>CONNECT.COMMA.AI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>COMMA POINTS</source>
|
||||
<translation>PONTOS COMMA</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
||||
@@ -520,10 +520,6 @@ location set</source>
|
||||
<source>CONNECT.COMMA.AI</source>
|
||||
<translation>CONNECT.COMMA.AI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>COMMA POINTS</source>
|
||||
<translation>COMMA POINTS点数</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
||||
@@ -522,10 +522,6 @@ location set</source>
|
||||
<source>CONNECT.COMMA.AI</source>
|
||||
<translation>CONNECT.COMMA.AI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>COMMA POINTS</source>
|
||||
<translation>COMMA 積分</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
||||
Reference in New Issue
Block a user