Files
sunnypilot/selfdrive/ui/qt/widgets/ssh_keys.h
Jason Wen 3966599e9d ui: sunnypilot offroad UI (#512)
* Revert "Revert "ui: sunnypilot offroad UI" (#511)"

This reverts commit 0e264e1b05.

* Revert "move files to sp dir"

This reverts commit c72d732259.

* remove drive stats for now

* update translation

* update onboarding

* remove sp onboarding for now

* rearrange

* remove more

* shorter license
2025-01-03 15:04:09 -05:00

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);
};