@ -118,11 +118,11 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
auto dcamBtn = new ButtonControl ( " Driver Camera " , " PREVIEW " ,
" Preview the driver facing camera to help optimize device mounting position for best driver monitoring experience. (vehicle must be off) " ) ;
connect ( dcamBtn , & ButtonControl : : releas ed, [ = ] ( ) { emit showDriverView ( ) ; } ) ;
connect ( dcamBtn , & ButtonControl : : click ed, [ = ] ( ) { emit showDriverView ( ) ; } ) ;
QString resetCalibDesc = " openpilot requires the device to be mounted within 4° left or right and within 5° up or down. openpilot is continuously calibrating, resetting is rarely required. " ;
auto resetCalibBtn = new ButtonControl ( " Reset Calibration " , " RESET " , resetCalibDesc ) ;
connect ( resetCalibBtn , & ButtonControl : : releas ed, [ = ] ( ) {
connect ( resetCalibBtn , & ButtonControl : : click ed, [ = ] ( ) {
if ( ConfirmationDialog : : confirm ( " Are you sure you want to reset calibration? " , this ) ) {
Params ( ) . remove ( " CalibrationParams " ) ;
}
@ -152,7 +152,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
ButtonControl * retrainingBtn = nullptr ;
if ( ! params . getBool ( " Passive " ) ) {
retrainingBtn = new ButtonControl ( " Review Training Guide " , " REVIEW " , " Review the rules, features, and limitations of openpilot " ) ;
connect ( retrainingBtn , & ButtonControl : : releas ed, [ = ] ( ) {
connect ( retrainingBtn , & ButtonControl : : click ed, [ = ] ( ) {
if ( ConfirmationDialog : : confirm ( " Are you sure you want to review the training guide? " , this ) ) {
Params ( ) . remove ( " CompletedTrainingVersion " ) ;
emit reviewTrainingGuide ( ) ;
@ -161,7 +161,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
}
auto uninstallBtn = new ButtonControl ( " Uninstall " + getBrand ( ) , " UNINSTALL " ) ;
connect ( uninstallBtn , & ButtonControl : : releas ed, [ = ] ( ) {
connect ( uninstallBtn , & ButtonControl : : click ed, [ = ] ( ) {
if ( ConfirmationDialog : : confirm ( " Are you sure you want to uninstall? " , this ) ) {
Params ( ) . putBool ( " DoUninstall " , true ) ;
}
@ -182,7 +182,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
QPushButton * reboot_btn = new QPushButton ( " Reboot " ) ;
reboot_btn - > setStyleSheet ( " height: 120px;border-radius: 15px; background-color: #393939; " ) ;
power_layout - > addWidget ( reboot_btn ) ;
QObject : : connect ( reboot_btn , & QPushButton : : releas ed, [ = ] ( ) {
QObject : : connect ( reboot_btn , & QPushButton : : click ed, [ = ] ( ) {
if ( ConfirmationDialog : : confirm ( " Are you sure you want to reboot? " , this ) ) {
Hardware : : reboot ( ) ;
}
@ -191,7 +191,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
QPushButton * poweroff_btn = new QPushButton ( " Power Off " ) ;
poweroff_btn - > setStyleSheet ( " height: 120px;border-radius: 15px; background-color: #E22C2C; " ) ;
power_layout - > addWidget ( poweroff_btn ) ;
QObject : : connect ( poweroff_btn , & QPushButton : : releas ed, [ = ] ( ) {
QObject : : connect ( poweroff_btn , & QPushButton : : click ed, [ = ] ( ) {
if ( ConfirmationDialog : : confirm ( " Are you sure you want to power off? " , this ) ) {
Hardware : : poweroff ( ) ;
}
@ -207,7 +207,7 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : QWidget(parent) {
versionLbl = new LabelControl ( " Version " , " " , QString : : fromStdString ( params . get ( " ReleaseNotes " ) ) . trimmed ( ) ) ;
lastUpdateLbl = new LabelControl ( " Last Update Check " , " " , " The last time openpilot successfully checked for an update. The updater only runs while the car is off. " ) ;
updateBtn = new ButtonControl ( " Check for Update " , " " ) ;
connect ( updateBtn , & ButtonControl : : releas ed, [ = ] ( ) {
connect ( updateBtn , & ButtonControl : : click ed, [ = ] ( ) {
if ( params . getBool ( " IsOffroad " ) ) {
const QString paramsPath = QString : : fromStdString ( params . getParamsPath ( ) ) ;
fs_watch - > addPath ( paramsPath + " /d/LastUpdateTime " ) ;
@ -270,12 +270,12 @@ QWidget * network_panel(QWidget * parent) {
// wifi + tethering buttons
auto wifiBtn = new ButtonControl ( " WiFi Settings " , " OPEN " ) ;
QObject : : connect ( wifiBtn , & ButtonControl : : releas ed, [ = ] ( ) { HardwareEon : : launch_wifi ( ) ; } ) ;
QObject : : connect ( wifiBtn , & ButtonControl : : click ed, [ = ] ( ) { HardwareEon : : launch_wifi ( ) ; } ) ;
layout - > addWidget ( wifiBtn ) ;
layout - > addWidget ( horizontal_line ( ) ) ;
auto tetheringBtn = new ButtonControl ( " Tethering Settings " , " OPEN " ) ;
QObject : : connect ( tetheringBtn , & ButtonControl : : releas ed, [ = ] ( ) { HardwareEon : : launch_tethering ( ) ; } ) ;
QObject : : connect ( tetheringBtn , & ButtonControl : : click ed, [ = ] ( ) { HardwareEon : : launch_tethering ( ) ; } ) ;
layout - > addWidget ( tetheringBtn ) ;
layout - > addWidget ( horizontal_line ( ) ) ;
@ -320,7 +320,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
close_btn - > setFixedSize ( 200 , 200 ) ;
sidebar_layout - > addSpacing ( 45 ) ;
sidebar_layout - > addWidget ( close_btn , 0 , Qt : : AlignCenter ) ;
QObject : : connect ( close_btn , & QPushButton : : releas ed, this , & SettingsWindow : : closeSettings ) ;
QObject : : connect ( close_btn , & QPushButton : : click ed, this , & SettingsWindow : : closeSettings ) ;
// setup panels
DevicePanel * device = new DevicePanel ( this ) ;
@ -372,7 +372,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
ScrollView * panel_frame = new ScrollView ( panel , this ) ;
panel_widget - > addWidget ( panel_frame ) ;
QObject : : connect ( btn , & QPushButton : : releas ed, [ = , w = panel_frame ] ( ) {
QObject : : connect ( btn , & QPushButton : : click ed, [ = , w = panel_frame ] ( ) {
btn - > setChecked ( true ) ;
panel_widget - > setCurrentWidget ( w ) ;
} ) ;