From 06784e2a80151e387fffa5824f99b3635508fb94 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 31 May 2024 22:10:18 -0400 Subject: [PATCH] interact with reboot button too --- selfdrive/ui/qt/text.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selfdrive/ui/qt/text.cc b/selfdrive/ui/qt/text.cc index df9de4c433..62f21e550c 100644 --- a/selfdrive/ui/qt/text.cc +++ b/selfdrive/ui/qt/text.cc @@ -43,7 +43,9 @@ int main(int argc, char *argv[]) { Hardware::reboot(); }); QObject::connect(update_btn, &QPushButton::clicked, [=, &watcher]() { + btn->setEnabled(false); update_btn->setEnabled(false); + update_btn->setText(QObject::tr("Updating...")); const std::string git_branch = Params().get("GitBranch"); const std::string cmd1 = "git remote remove origin-update"; const std::string cmd2 = "git remote add origin-update " + Params().get("GitRemote"); @@ -54,6 +56,7 @@ int main(int argc, char *argv[]) { std::system(("cd /data/openpilot && " + cmd1 + " && " + cmd2 + " && " + cmd3 + " && " + cmd4).c_str()); }); QObject::connect(&watcher, &QFutureWatcher::finished, [=]() { + btn->setEnabled(true); update_btn->setEnabled(true); update_btn->setText("Ready to Reboot"); });