mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-10 10:13:45 +08:00
FrogPilot 0.9.7
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "selfdrive/ui/qt/widgets/keyboard.h"
|
||||
|
||||
const int DEFAULT_MAX_LENGTH = 512;
|
||||
|
||||
class DialogBase : public QDialog {
|
||||
Q_OBJECT
|
||||
@@ -27,12 +28,15 @@ class InputDialog : public DialogBase {
|
||||
public:
|
||||
explicit InputDialog(const QString &title, QWidget *parent, const QString &subtitle = "", bool secret = false);
|
||||
static QString getText(const QString &title, QWidget *parent, const QString &subtitle = "",
|
||||
bool secret = false, int minLength = -1, const QString &defaultText = "");
|
||||
bool secret = false, int minLength = -1, const QString &defaultText = "", int maxLength = DEFAULT_MAX_LENGTH);
|
||||
QString text();
|
||||
void setMessage(const QString &message, bool clearInputField = true);
|
||||
void setMinLength(int length);
|
||||
void show();
|
||||
|
||||
// FrogPilot widgets
|
||||
void setMaxLength(int length);
|
||||
|
||||
private:
|
||||
int minLength;
|
||||
QLineEdit *line;
|
||||
@@ -42,6 +46,12 @@ private:
|
||||
QVBoxLayout *main_layout;
|
||||
QPushButton *eye_btn;
|
||||
|
||||
// FrogPilot widgets
|
||||
void updateMaxLengthSublabel(const QString &text);
|
||||
|
||||
// FrogPilot variables
|
||||
int maxLength;
|
||||
|
||||
private slots:
|
||||
void handleEnter();
|
||||
|
||||
@@ -55,7 +65,7 @@ class ConfirmationDialog : public DialogBase {
|
||||
|
||||
public:
|
||||
explicit ConfirmationDialog(const QString &prompt_text, const QString &confirm_text,
|
||||
const QString &cancel_text, const bool rich, QWidget* parent);
|
||||
const QString &cancel_text, const bool rich, QWidget* parent, const bool is_long=false);
|
||||
static bool alert(const QString &prompt_text, QWidget *parent);
|
||||
static bool confirm(const QString &prompt_text, const QString &confirm_text, QWidget *parent);
|
||||
static bool rich(const QString &prompt_text, QWidget *parent);
|
||||
|
||||
Reference in New Issue
Block a user