diff options
author | Lenny McLennington <lennymclennington@protonmail.com> | 2022-01-26 00:31:08 +0000 |
---|---|---|
committer | Lenny McLennington <lennymclennington@protonmail.com> | 2022-01-26 00:34:02 +0000 |
commit | 0eff21a4f1ee97e4b0a484c608eac9617897446d (patch) | |
tree | e3fb7191ce8e01b23780e545833bcfc6d77b0c46 /launcher/ui/pages/global | |
parent | af20b5ee0e09d5c9ec36d54c80ca688c7c67012d (diff) | |
download | PrismLauncher-0eff21a4f1ee97e4b0a484c608eac9617897446d.tar.gz PrismLauncher-0eff21a4f1ee97e4b0a484c608eac9617897446d.tar.bz2 PrismLauncher-0eff21a4f1ee97e4b0a484c608eac9617897446d.zip |
Validate Pastebin URL with regex
Diffstat (limited to 'launcher/ui/pages/global')
-rw-r--r-- | launcher/ui/pages/global/PastePage.cpp | 2 | ||||
-rw-r--r-- | launcher/ui/pages/global/PastePage.ui | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/launcher/ui/pages/global/PastePage.cpp b/launcher/ui/pages/global/PastePage.cpp index 0965da77..7c69e1a4 100644 --- a/launcher/ui/pages/global/PastePage.cpp +++ b/launcher/ui/pages/global/PastePage.cpp @@ -30,7 +30,9 @@ PastePage::PastePage(QWidget *parent) : QWidget(parent), ui(new Ui::PastePage) { + static QRegularExpression validUrlRegExp("https?://.+"); ui->setupUi(this); + ui->urlChoices->setValidator(new QRegularExpressionValidator(validUrlRegExp, ui->urlChoices)); ui->tabWidget->tabBar()->hide();\ loadSettings(); } diff --git a/launcher/ui/pages/global/PastePage.ui b/launcher/ui/pages/global/PastePage.ui index fe372540..2d13a765 100644 --- a/launcher/ui/pages/global/PastePage.ui +++ b/launcher/ui/pages/global/PastePage.ui @@ -38,7 +38,7 @@ <property name="title"> <string>Pastebin URL</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_10"> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="Line" name="line"> <property name="orientation"> @@ -47,6 +47,21 @@ </widget> </item> <item> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string><html><head/><body><p>Note: only input that starts with <span style=" font-weight:600;">http://</span> or <span style=" font-weight:600;">https://</span> will be accepted.</p></body></html></string> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + </widget> + </item> + <item> <widget class="QComboBox" name="urlChoices"> <property name="editable"> <bool>true</bool> @@ -69,7 +84,7 @@ <item> <widget class="QLabel" name="label"> <property name="text"> - <string><html><head/><body><p>Here you can choose from a predefined list, or input the URL of a different paste service, provided that it supports the same protocol as 0x0.st, that is POST a file to the URL and return a link in the response body.</p></body></html></string> + <string><html><head/><body><p>Here you can choose from a predefined list of paste services, or input the URL of a different paste service of your choice, provided it supports the same protocol as 0x0.st, that is POST a file parameter to the URL and return a link in the response body.</p></body></html></string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> |