Files
dragonpilot/selfdrive/ui/qt/offroad/settings.h
T
Adeeb Shihadeh cc3857eb62 updated: add branch switching (#25200)
* switch param

* add to ui

* fix that

* fetch for new branch

Co-authored-by: Comma Device <device@comma.ai>
2022-07-18 21:18:10 -07:00

79 lines
1.5 KiB
C++

#pragma once
#include <QButtonGroup>
#include <QFileSystemWatcher>
#include <QFrame>
#include <QLabel>
#include <QPushButton>
#include <QStackedWidget>
#include <QWidget>
#include "selfdrive/ui/qt/widgets/controls.h"
// ********** settings window + top-level panels **********
class SettingsWindow : public QFrame {
Q_OBJECT
public:
explicit SettingsWindow(QWidget *parent = 0);
protected:
void showEvent(QShowEvent *event) override;
signals:
void closeSettings();
void reviewTrainingGuide();
void showDriverView();
private:
QPushButton *sidebar_alert_widget;
QWidget *sidebar_widget;
QButtonGroup *nav_btns;
QStackedWidget *panel_widget;
};
class DevicePanel : public ListWidget {
Q_OBJECT
public:
explicit DevicePanel(SettingsWindow *parent);
signals:
void reviewTrainingGuide();
void showDriverView();
private slots:
void poweroff();
void reboot();
void updateCalibDescription();
private:
Params params;
};
class TogglesPanel : public ListWidget {
Q_OBJECT
public:
explicit TogglesPanel(SettingsWindow *parent);
};
class SoftwarePanel : public ListWidget {
Q_OBJECT
public:
explicit SoftwarePanel(QWidget* parent = nullptr);
private:
void showEvent(QShowEvent *event) override;
void updateLabels();
LabelControl *gitBranchLbl;
LabelControl *gitCommitLbl;
LabelControl *osVersionLbl;
LabelControl *versionLbl;
LabelControl *lastUpdateLbl;
ButtonControl *updateBtn;
ButtonControl *branchSwitcherBtn;
Params params;
QFileSystemWatcher *fs_watch;
};