From 2433cb28bb821f91080924186d40b75fd6f72147 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Mon, 21 Jun 2021 09:59:49 +0800 Subject: [PATCH] onboarding: small cleanup (#21351) --- selfdrive/ui/qt/offroad/onboarding.cc | 12 +++++------- selfdrive/ui/qt/offroad/onboarding.h | 5 ----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/selfdrive/ui/qt/offroad/onboarding.cc b/selfdrive/ui/qt/offroad/onboarding.cc index 2c100885ec..4a298ae3c6 100644 --- a/selfdrive/ui/qt/offroad/onboarding.cc +++ b/selfdrive/ui/qt/offroad/onboarding.cc @@ -11,7 +11,6 @@ void TrainingGuide::mouseReleaseEvent(QMouseEvent *e) { QPoint touch = QPoint(e->x(), e->y()) - imageCorner; - //qDebug() << touch.x() << ", " << touch.y(); // Check for restart if (currentIndex == (boundingBox.size() - 1) && 200 <= touch.x() && touch.x() <= 920 && @@ -78,7 +77,7 @@ void TermsPage::showEvent(QShowEvent *event) { QHBoxLayout* buttons = new QHBoxLayout; main_layout->addLayout(buttons); - decline_btn = new QPushButton("Decline"); + QPushButton *decline_btn = new QPushButton("Decline"); buttons->addWidget(decline_btn); QObject::connect(decline_btn, &QPushButton::released, this, &TermsPage::declinedTerms); @@ -93,7 +92,6 @@ void TermsPage::showEvent(QShowEvent *event) { void TermsPage::enableAccept() { accept_btn->setText("Accept"); accept_btn->setEnabled(true); - return; } void DeclinePage::showEvent(QShowEvent *event) { @@ -113,13 +111,13 @@ void DeclinePage::showEvent(QShowEvent *event) { QHBoxLayout* buttons = new QHBoxLayout; main_layout->addLayout(buttons); - back_btn = new QPushButton("Back"); + QPushButton *back_btn = new QPushButton("Back"); buttons->addWidget(back_btn); buttons->addSpacing(50); QObject::connect(back_btn, &QPushButton::released, this, &DeclinePage::getBack); - uninstall_btn = new QPushButton("Decline, uninstall openpilot"); + QPushButton *uninstall_btn = new QPushButton("Decline, uninstall openpilot"); uninstall_btn->setStyleSheet("background-color: #E22C2C;"); buttons->addWidget(uninstall_btn); @@ -131,8 +129,8 @@ void DeclinePage::showEvent(QShowEvent *event) { } void OnboardingWindow::updateActiveScreen() { - accepted_terms = params.get("HasAcceptedTerms") == current_terms_version; - training_done = params.get("CompletedTrainingVersion") == current_training_version; + bool accepted_terms = params.get("HasAcceptedTerms") == current_terms_version; + bool training_done = params.get("CompletedTrainingVersion") == current_training_version; if (!accepted_terms) { setCurrentIndex(0); } else if (!training_done && !params.getBool("Passive")) { diff --git a/selfdrive/ui/qt/offroad/onboarding.h b/selfdrive/ui/qt/offroad/onboarding.h index 8752e831b7..0313da91da 100644 --- a/selfdrive/ui/qt/offroad/onboarding.h +++ b/selfdrive/ui/qt/offroad/onboarding.h @@ -64,7 +64,6 @@ private: void showEvent(QShowEvent *event) override; QPushButton *accept_btn; - QPushButton *decline_btn; signals: void acceptedTerms(); @@ -79,8 +78,6 @@ public: private: void showEvent(QShowEvent *event) override; - QPushButton *back_btn; - QPushButton *uninstall_btn; signals: void getBack(); @@ -99,8 +96,6 @@ private: Params params; std::string current_terms_version; std::string current_training_version; - bool accepted_terms = false; - bool training_done = false; signals: void onboardingDone();