From b1f5450f58bd3a1d09f5c64b2cb32150c20b710b Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sun, 9 Aug 2020 16:01:00 -0700 Subject: [PATCH] set valid url for homeserver fixes https://todo.sr.ht/~thrrgilag/pantalaimon-ut/3 --- CMakeLists.txt | 2 +- po/pantalaimon.thrrgilag.pot | 10 +++++----- qml/Components/EditServerPage.qml | 11 +++++++++-- src/.config.py.swp | Bin 12288 -> 0 bytes 4 files changed, 15 insertions(+), 8 deletions(-) delete mode 100644 src/.config.py.swp diff --git a/CMakeLists.txt b/CMakeLists.txt index b74085f..23697fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ install(DIRECTORY src DESTINATION ${DATA_DIR}) install(DIRECTORY qml DESTINATION ${DATA_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/AboutPage.qml DESTINATION ${DATA_DIR}qml/) -# example config file for local testing +# TODO: example config file for local testing # install(FILES example.conf DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon.conf) # Translations diff --git a/po/pantalaimon.thrrgilag.pot b/po/pantalaimon.thrrgilag.pot index 8ee05af..3d7f667 100644 --- a/po/pantalaimon.thrrgilag.pot +++ b/po/pantalaimon.thrrgilag.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pantalaimon.thrrgilag\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-09 20:24+0000\n" +"POT-Creation-Date: 2020-08-09 22:57+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,15 +25,15 @@ msgstr "" msgid "Save" msgstr "" -#: ../qml/Components/EditServerPage.qml:83 +#: ../qml/Components/EditServerPage.qml:89 msgid "Description:" msgstr "" -#: ../qml/Components/EditServerPage.qml:103 -msgid "Homeserver:" +#: ../qml/Components/EditServerPage.qml:109 +msgid "Homeserver URL:" msgstr "" -#: ../qml/Components/EditServerPage.qml:124 +#: ../qml/Components/EditServerPage.qml:131 msgid "Listen on 127.0.0.1:" msgstr "" diff --git a/qml/Components/EditServerPage.qml b/qml/Components/EditServerPage.qml index 678be56..28d8d72 100644 --- a/qml/Components/EditServerPage.qml +++ b/qml/Components/EditServerPage.qml @@ -23,6 +23,12 @@ Page { iconName: 'ok' text: i18n.tr('Save') onTriggered: { + if (homeserver.text.length == 0) { + homeserver.text = "https://matrix.org" + } + if (!/^https?:\/\//i.test(homeserver.text)) { + homeserver.text = "https://" + homeserver.text + } var data = { name: instance.text, homeserver: homeserver.text, @@ -85,7 +91,7 @@ Page { TextField { id: instance - text: "" + text: "my-homeserver" anchors.verticalCenter: parent.verticalCenter Layout.fillWidth: true } @@ -100,12 +106,13 @@ Page { Label { anchors.verticalCenter: parent.verticalCenter - text: i18n.tr('Homeserver:') + text: i18n.tr('Homeserver URL:') } TextField { id: homeserver text: "" + placeholderText: "https://matrix.org" anchors.verticalCenter: parent.verticalCenter Layout.fillWidth: true inputMethodHints: Qt.ImhUrlCharactersOnly diff --git a/src/.config.py.swp b/src/.config.py.swp deleted file mode 100644 index a9f11266e3a06f3907abd01a9a8af3debaf10550..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2&2Jnv7{*;hr2;MGXZD_7bZ2u?k61c^U^1CPfun+e?{QcpyBCwjCVf4qM7=hv2!c+~r3 z{X@PQ^%7kbN-Vl3nN zs4TQKaVc^uGNEQgzB0G5(c^er>Y5g-D`lYlKxuzRrnOl`mVI{?Zj>i6ceex(m0Km>>Y z5g-CYfCvx)B0vO)01+SpMBo?_5D8^`&t{dJnLKcPp^L+D572k0BDzU)P+dOm?dd+saOPQOZ1AyS8!l^7=>oP3}rp*FU)ORv8CM(-e7>6(TXAtMtp76={k^i4r-Qr(ws4Te6PX z>9RylxU2E~>#4Q0bDeXUTdkzo%N&lUu8c&9+)F~|y|&?6-Q(BcKiSZ%er~MD$8s2@ z(uVDn@m_s|CdL8Du{_q2&dXx9^J4*bp!WM}bvigkJ8_m<+Mi&{BDFK-KsT*UPsYHg z+kOvTKn{7jKD8XnD!uAjmtx*$WaQXwH4}E9*wvAiBDvwtnec$qrMqXshg%q5o}rl57BJ#sbz)|`WAj2*JLoQhE