mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-06 05:52:12 +08:00
46cfb5c45b
* good updater experience * set params on startup * no fetch on first loop * little type hinting * little more * update translations * always set params with valid overlay * wrap check * use the param * more wrapping * vanish * cleanup * remove that old-commit-hash: c4e63d14ab158118efc6eadd0e20d8d533f9e046
87 lines
1.6 KiB
C++
87 lines
1.6 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);
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
private:
|
|
Params params;
|
|
std::map<std::string, ParamControl*> toggles;
|
|
|
|
void updateToggles();
|
|
};
|
|
|
|
class SoftwarePanel : public ListWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit SoftwarePanel(QWidget* parent = nullptr);
|
|
|
|
private:
|
|
void showEvent(QShowEvent *event) override;
|
|
void updateLabels();
|
|
void checkForUpdates();
|
|
|
|
bool is_onroad = false;
|
|
|
|
QLabel *onroadLbl;
|
|
LabelControl *versionLbl;
|
|
ButtonControl *installBtn;
|
|
ButtonControl *downloadBtn;
|
|
ButtonControl *targetBranchBtn;
|
|
|
|
Params params;
|
|
QFileSystemWatcher *fs_watch;
|
|
};
|