mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-04 07:03:44 +08:00
3966599e9d
* Revert "Revert "ui: sunnypilot offroad UI" (#511)"
This reverts commit 0e264e1b05.
* Revert "move files to sp dir"
This reverts commit c72d732259d35872fca92b90289785e7b4086140.
* remove drive stats for now
* update translation
* update onboarding
* remove sp onboarding for now
* rearrange
* remove more
* shorter license
40 lines
780 B
C++
40 lines
780 B
C++
#pragma once
|
|
|
|
#include <QPushButton>
|
|
|
|
#include "system/hardware/hw.h"
|
|
|
|
#ifdef SUNNYPILOT
|
|
#include "selfdrive/ui/sunnypilot/qt/widgets/controls.h"
|
|
#define ButtonControl ButtonControlSP
|
|
#define ToggleControl ToggleControlSP
|
|
#else
|
|
#include "selfdrive/ui/qt/widgets/controls.h"
|
|
#endif
|
|
|
|
// SSH enable toggle
|
|
class SshToggle : public ToggleControl {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SshToggle() : ToggleControl(tr("Enable SSH"), "", "", Hardware::get_ssh_enabled()) {
|
|
QObject::connect(this, &SshToggle::toggleFlipped, [=](bool state) {
|
|
Hardware::set_ssh_enabled(state);
|
|
});
|
|
}
|
|
};
|
|
|
|
// SSH key management widget
|
|
class SshControl : public ButtonControl {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SshControl();
|
|
|
|
private:
|
|
Params params;
|
|
|
|
void refresh();
|
|
void getUserKeys(const QString &username);
|
|
};
|