mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-10-01 03:43:42 +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_Device", PERSISTENT},
|
||||||
{"ApiCache_DriveStats", PERSISTENT},
|
{"ApiCache_DriveStats", PERSISTENT},
|
||||||
{"ApiCache_NavDestinations", PERSISTENT},
|
{"ApiCache_NavDestinations", PERSISTENT},
|
||||||
{"ApiCache_Owner", PERSISTENT},
|
|
||||||
{"Offroad_BadNvme", CLEAR_ON_MANAGER_START},
|
{"Offroad_BadNvme", CLEAR_ON_MANAGER_START},
|
||||||
{"Offroad_CarUnrecognized", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION},
|
{"Offroad_CarUnrecognized", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION},
|
||||||
{"Offroad_ConnectivityNeeded", CLEAR_ON_MANAGER_START},
|
{"Offroad_ConnectivityNeeded", CLEAR_ON_MANAGER_START},
|
||||||
|
|||||||
@@ -143,42 +143,9 @@ PrimeUserWidget::PrimeUserWidget(QWidget* parent) : QFrame(parent) {
|
|||||||
|
|
||||||
mainLayout->addWidget(primeWidget);
|
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();
|
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) {
|
PrimeAdWidget::PrimeAdWidget(QWidget* parent) : QFrame(parent) {
|
||||||
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
||||||
|
|||||||
@@ -51,12 +51,6 @@ class PrimeUserWidget : public QFrame {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PrimeUserWidget(QWidget* parent = 0);
|
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>
|
<source>CONNECT.COMMA.AI</source>
|
||||||
<translation>CONNECT.COMMA.AI</translation>
|
<translation>CONNECT.COMMA.AI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>COMMA POINTS</source>
|
|
||||||
<translation>COMMA PUNKTE</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
|
|||||||
@@ -522,10 +522,6 @@ location set</source>
|
|||||||
<source>CONNECT.COMMA.AI</source>
|
<source>CONNECT.COMMA.AI</source>
|
||||||
<translation>CONNECT.COMMA.AI</translation>
|
<translation>CONNECT.COMMA.AI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>COMMA POINTS</source>
|
|
||||||
<translation>COMMA POINTS</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
|
|||||||
@@ -522,10 +522,6 @@ location set</source>
|
|||||||
<source>CONNECT.COMMA.AI</source>
|
<source>CONNECT.COMMA.AI</source>
|
||||||
<translation>CONNECT.COMMA.AI</translation>
|
<translation>CONNECT.COMMA.AI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>COMMA POINTS</source>
|
|
||||||
<translation>COMMA POINTS</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
|
|||||||
@@ -523,10 +523,6 @@ trabalho definido</translation>
|
|||||||
<source>CONNECT.COMMA.AI</source>
|
<source>CONNECT.COMMA.AI</source>
|
||||||
<translation>CONNECT.COMMA.AI</translation>
|
<translation>CONNECT.COMMA.AI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>COMMA POINTS</source>
|
|
||||||
<translation>PONTOS COMMA</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
|
|||||||
@@ -520,10 +520,6 @@ location set</source>
|
|||||||
<source>CONNECT.COMMA.AI</source>
|
<source>CONNECT.COMMA.AI</source>
|
||||||
<translation>CONNECT.COMMA.AI</translation>
|
<translation>CONNECT.COMMA.AI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>COMMA POINTS</source>
|
|
||||||
<translation>COMMA POINTS点数</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
|
|||||||
@@ -522,10 +522,6 @@ location set</source>
|
|||||||
<source>CONNECT.COMMA.AI</source>
|
<source>CONNECT.COMMA.AI</source>
|
||||||
<translation>CONNECT.COMMA.AI</translation>
|
<translation>CONNECT.COMMA.AI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>COMMA POINTS</source>
|
|
||||||
<translation>COMMA 積分</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user