aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.cpp
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-10 15:39:33 +0200
committerFelix Queißner <felix@ib-queissner.de>2023-10-13 13:14:00 +0200
commit6d97b7f19824e36caee34219e02e7bbe7ec29fa1 (patch)
tree30957e51979a26f5baaf54e0c3f193d9689fe92c /src/browsertab.cpp
parent8cb79ee6711b3db3f138db6367752053f45efc17 (diff)
Replace QInputDialog with custom dialog for queries
Recent commits allowed multi-line input while reusing the QInputDialog object already defined by Kristall. However, QInputDialog lacks a way to access its QPlainTextEdit directly, and therefore set the wrap mode. Since QInputDialog does no wrapping, it is inconvenient for writing a long text (think of social media sites such as BBS or Station). Therefore, a custom QDialog-derived class, namely QueryDialog, has been provided.
Diffstat (limited to 'src/browsertab.cpp')
-rw-r--r--src/browsertab.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index b64ab93..efb75c9 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -25,6 +25,7 @@
#include "kristall.hpp"
#include "widgets/favouritepopup.hpp"
#include "widgets/searchbox.hpp"
+#include "widgets/querydialog.hpp"
#include <cassert>
#include <QTabWidget>
@@ -867,10 +868,8 @@ void BrowserTab::on_inputRequired(const QString &query, const bool is_sensitive)
{
this->network_timeout_timer.stop();
- QInputDialog dialog{this};
+ QueryDialog dialog(this);
- dialog.setInputMode(QInputDialog::TextInput);
- dialog.setOption(QInputDialog::UsePlainTextEditForTextInput);
dialog.setLabelText(query);
if (is_sensitive) dialog.setTextEchoMode(QLineEdit::Password);