mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-02 06:03:43 +08:00
81da8ac9f4
date: 2024-06-11T01:36:39 master commit: f8cb04e4a8b032b72a909f68b808a50936184bee
33 lines
615 B
C++
33 lines
615 B
C++
#pragma once
|
|
|
|
#include <QPushButton>
|
|
|
|
#include "system/hardware/hw.h"
|
|
#include "selfdrive/ui/qt/widgets/controls.h"
|
|
|
|
// 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);
|
|
};
|