2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-17 00:15:44 +01:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QString>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-01-17 00:15:44 +01:00
|
|
|
class TextInputDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-06-11 09:37:30 +02:00
|
|
|
TextInputDialog(QWidget *parent = nullptr);
|
2017-01-17 00:15:44 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
QString getText() const
|
2017-01-17 00:15:44 +01:00
|
|
|
{
|
2017-04-12 17:46:44 +02:00
|
|
|
return _lineEdit.text();
|
2017-01-17 00:15:44 +01:00
|
|
|
}
|
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
void setText(const QString &text)
|
2017-01-17 00:15:44 +01:00
|
|
|
{
|
2017-04-12 17:46:44 +02:00
|
|
|
_lineEdit.setText(text);
|
2017-01-17 00:15:44 +01:00
|
|
|
}
|
|
|
|
|
2018-04-07 21:21:56 +02:00
|
|
|
void highlightText();
|
|
|
|
|
2017-01-17 00:15:44 +01:00
|
|
|
private:
|
2017-04-12 17:46:44 +02:00
|
|
|
QVBoxLayout _vbox;
|
|
|
|
QLineEdit _lineEdit;
|
|
|
|
QHBoxLayout _buttonBox;
|
|
|
|
QPushButton _okButton;
|
|
|
|
QPushButton _cancelButton;
|
2017-01-17 00:15:44 +01:00
|
|
|
|
2017-01-17 00:42:32 +01:00
|
|
|
private slots:
|
2017-01-17 00:15:44 +01:00
|
|
|
void okButtonClicked();
|
|
|
|
void cancelButtonClicked();
|
|
|
|
};
|
|
|
|
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|