mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-03-02 07:24:12 +08:00
* Revert "Revert "ui: sunnypilot offroad UI" (#511)" This reverts commit0e264e1b05. * Revert "move files to sp dir" This reverts commitc72d732259. * 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);
|
|
};
|