Files
sunnypilot/selfdrive/ui/qt/widgets/ssh_keys.h
Dean Lee 0c59f626c7 input.cc: close dialog when parent is hidden (#21318)
* close dialog when parent is hidden

* Q_OBJECT

* apply reviews

* rebase master

* rebase master

* fix wroing minLength

* merge master
old-commit-hash: 5be75f5354
2021-07-07 21:06:50 -07:00

35 lines
640 B
C++

#pragma once
#include <QPushButton>
#include "selfdrive/hardware/hw.h"
#include "selfdrive/ui/qt/widgets/controls.h"
// SSH enable toggle
class SshToggle : public ToggleControl {
Q_OBJECT
public:
SshToggle() : ToggleControl("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;
QLabel username_label;
void refresh();
void getUserKeys(const QString &username);
};