diff --git a/selfdrive/ui/sunnypilot/SConscript b/selfdrive/ui/sunnypilot/SConscript index 4ebfc10940..6866bfb7d8 100644 --- a/selfdrive/ui/sunnypilot/SConscript +++ b/selfdrive/ui/sunnypilot/SConscript @@ -20,11 +20,11 @@ qt_src = [ "sunnypilot/qt/home.cc", "sunnypilot/qt/offroad/offroad_home.cc", "sunnypilot/qt/offroad/settings/device_panel.cc", + "sunnypilot/qt/offroad/settings/lateral_panel.cc", "sunnypilot/qt/offroad/settings/settings.cc", "sunnypilot/qt/offroad/settings/software_panel.cc", "sunnypilot/qt/offroad/settings/sunnylink_panel.cc", "sunnypilot/qt/offroad/settings/sunnylink/sponsor_widget.cc", - "sunnypilot/qt/offroad/settings/sunnypilot_panel.cc", "sunnypilot/qt/offroad/settings/trips_panel.cc", "sunnypilot/qt/offroad/settings/vehicle_panel.cc", "sunnypilot/qt/onroad/annotated_camera.cc", @@ -34,8 +34,8 @@ qt_src = [ "sunnypilot/qt/onroad/onroad_home.cc", ] -sunnypilot_panel_qt_src = [ - "sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.cc", +lateral_panel_qt_src = [ + "sunnypilot/qt/offroad/settings/lateral/mads_settings.cc", ] network_src = [ @@ -50,7 +50,7 @@ vehicle_panel_qt_src = [ ] sp_widgets_src = widgets_src + network_src -sp_qt_src = qt_src + sunnypilot_panel_qt_src + vehicle_panel_qt_src +sp_qt_src = qt_src + lateral_panel_qt_src + vehicle_panel_qt_src sp_qt_util = qt_util Export('sp_widgets_src', 'sp_qt_src', "sp_qt_util") diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.cc similarity index 96% rename from selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.cc rename to selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.cc index d178c59b07..fd5d2fd5c8 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.cc @@ -5,7 +5,7 @@ * See the LICENSE.md file in the root directory for more details. */ -#include "selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.h" +#include "selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h" #include "selfdrive/ui/sunnypilot/qt/widgets/scrollview.h" diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.h b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h similarity index 100% rename from selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.h rename to selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.cc similarity index 87% rename from selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.cc rename to selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.cc index 82d07febb8..e604b03ba9 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.cc @@ -5,12 +5,12 @@ * See the LICENSE.md file in the root directory for more details. */ -#include "selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h" +#include "selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h" #include "common/util.h" #include "selfdrive/ui/sunnypilot/qt/widgets/controls.h" -SunnypilotPanel::SunnypilotPanel(SettingsWindowSP *parent) : QFrame(parent) { +LateralPanel::LateralPanel(SettingsWindowSP *parent) : QFrame(parent) { main_layout = new QStackedLayout(this); ListWidget *list = new ListWidget(this, false); @@ -45,7 +45,7 @@ SunnypilotPanel::SunnypilotPanel(SettingsWindowSP *parent) : QFrame(parent) { toggleOffroadOnly = { madsToggle, }; - QObject::connect(uiState(), &UIState::offroadTransition, this, &SunnypilotPanel::updateToggles); + QObject::connect(uiState(), &UIState::offroadTransition, this, &LateralPanel::updateToggles); sunnypilotScroller = new ScrollViewSP(list, this); vlayout->addWidget(sunnypilotScroller); @@ -71,15 +71,15 @@ SunnypilotPanel::SunnypilotPanel(SettingsWindowSP *parent) : QFrame(parent) { main_layout->setCurrentWidget(sunnypilotScreen); } -void SunnypilotPanel::showEvent(QShowEvent *event) { +void LateralPanel::showEvent(QShowEvent *event) { updateToggles(offroad); } -void SunnypilotPanel::hideEvent(QHideEvent *event) { +void LateralPanel::hideEvent(QHideEvent *event) { main_layout->setCurrentWidget(sunnypilotScreen); } -void SunnypilotPanel::updateToggles(bool _offroad) { +void LateralPanel::updateToggles(bool _offroad) { for (auto *toggle : toggleOffroadOnly) { toggle->setEnabled(_offroad); } diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h similarity index 83% rename from selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h rename to selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h index e955995b34..7cc4b6f11d 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h @@ -11,16 +11,16 @@ #include #include "selfdrive/ui/sunnypilot/ui.h" -#include "selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot/mads_settings.h" +#include "selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h" #include "selfdrive/ui/qt/util.h" #include "selfdrive/ui/sunnypilot/qt/offroad/settings/settings.h" #include "selfdrive/ui/sunnypilot/qt/widgets/scrollview.h" -class SunnypilotPanel : public QFrame { +class LateralPanel : public QFrame { Q_OBJECT public: - explicit SunnypilotPanel(SettingsWindowSP *parent = nullptr); + explicit LateralPanel(SettingsWindowSP *parent = nullptr); void showEvent(QShowEvent *event) override; void hideEvent(QHideEvent* event) override; diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc index a27561edf6..65e9744ed9 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc @@ -15,7 +15,7 @@ #include "selfdrive/ui/sunnypilot/qt/offroad/settings/device_panel.h" #include "selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.h" #include "selfdrive/ui/sunnypilot/qt/offroad/settings/sunnylink_panel.h" -#include "selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h" +#include "selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h" #include "selfdrive/ui/sunnypilot/qt/offroad/settings/trips_panel.h" #include "selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle_panel.h" @@ -78,7 +78,7 @@ SettingsWindowSP::SettingsWindowSP(QWidget *parent) : SettingsWindow(parent) { PanelInfo(" " + tr("sunnylink"), new SunnylinkPanel(this), "../assets/offroad/icon_wifi_strength_full.svg"), PanelInfo(" " + tr("Toggles"), toggles, "../../sunnypilot/selfdrive/assets/offroad/icon_toggle.png"), PanelInfo(" " + tr("Software"), new SoftwarePanelSP(this), "../../sunnypilot/selfdrive/assets/offroad/icon_software.png"), - PanelInfo(" " + tr("sunnypilot"), new SunnypilotPanel(this), "../assets/images/button_home.png"), + PanelInfo(" " + tr("Steering"), new LateralPanel(this), "../assets/images/button_home.png"), PanelInfo(" " + tr("Trips"), new TripsPanel(this), "../../sunnypilot/selfdrive/assets/offroad/icon_trips.png"), PanelInfo(" " + tr("Vehicle"), new VehiclePanel(this), "../../sunnypilot/selfdrive/assets/offroad/icon_vehicle.png"), PanelInfo(" " + tr("Firehose"), new FirehosePanel(this), "../../sunnypilot/selfdrive/assets/offroad/icon_firehose.svg"), @@ -117,7 +117,7 @@ SettingsWindowSP::SettingsWindowSP(QWidget *parent) : SettingsWindow(parent) { nav_btns->addButton(btn); buttons_layout->addWidget(btn, 0, Qt::AlignLeft | Qt::AlignBottom); - const int lr_margin = (name != (" " + tr("Network")) || (name != (" " + tr("sunnypilot")))) ? 50 : 0; // Network and sunnypilot panel handles its own margins + const int lr_margin = (name != (" " + tr("Network"))) ? 50 : 0; // Network panel handles its own margins panel->setContentsMargins(lr_margin, 25, lr_margin, 25); ScrollViewSP *panel_frame = new ScrollViewSP(panel, this);