mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-27 00:23:54 +08:00
* cleanup include path
* continue
* format includes
* fix testraw.cc
* remove include path from SConstruct
* regroup
* rebase master
* almost done
* apply review
* rename FileReader.xx to filereader.xx
* rename Unlogger.x->unlogger.x
* rename FrameReader.xx -> framereader.xx
* apply reviews
* ui.h
* continue
* fix framebuffer.cc build error:mv util.h up
* full path to msm_media_info
* fix qcom2 camerad
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20d
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QString>
|
|
#include <QVBoxLayout>
|
|
#include <QWidget>
|
|
|
|
#include "selfdrive/ui/qt/widgets/keyboard.h"
|
|
|
|
class InputDialog : public QDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit InputDialog(const QString &prompt_text, QWidget* parent = 0);
|
|
static QString getText(const QString &prompt, int minLength = -1);
|
|
QString text();
|
|
void setMessage(const QString &message, bool clearInputField = true);
|
|
void setMinLength(int length);
|
|
void show();
|
|
|
|
private:
|
|
int minLength;
|
|
QLineEdit *line;
|
|
Keyboard *k;
|
|
QLabel *label;
|
|
QVBoxLayout *layout;
|
|
|
|
public slots:
|
|
int exec() override;
|
|
|
|
private slots:
|
|
void handleInput(const QString &s);
|
|
|
|
signals:
|
|
void cancel();
|
|
void emitText(const QString &text);
|
|
};
|
|
|
|
class ConfirmationDialog : public QDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ConfirmationDialog(const QString &prompt_text, const QString &confirm_text = "Ok",
|
|
const QString &cancel_text = "Cancel", QWidget* parent = 0);
|
|
static bool alert(const QString &prompt_text, QWidget *parent = 0);
|
|
static bool confirm(const QString &prompt_text, QWidget *parent = 0);
|
|
|
|
private:
|
|
QLabel *prompt;
|
|
QVBoxLayout *layout;
|
|
|
|
public slots:
|
|
int exec() override;
|
|
};
|