Skip to content

Commit

Permalink
SetupWidget: correctly hide widget
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed May 23, 2023
1 parent b5451fc commit 073a1f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions selfdrive/ui/qt/widgets/prime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ SetupWidget::SetupWidget(QWidget* parent) : QFrame(parent) {

if (uiState()->primeType()) {
mainLayout->setCurrentWidget((QWidget*)primeUser);
} else {
mainLayout->setVisible(false);
}

setFixedWidth(750);
Expand Down Expand Up @@ -237,11 +239,15 @@ void SetupWidget::replyFinished(const QString &response, bool success) {

if (!json["is_paired"].toBool()) {
mainLayout->setCurrentIndex(0);
mainLayout->setVisible(true);
} else {
popup->reject();

if (prime_type) {
mainLayout->setCurrentWidget(primeUser);
mainLayout->setVisible(true);
} else {
mainLayout->setVisible(false);
}
}
}

0 comments on commit 073a1f9

Please sign in to comment.