Warning, /network/tokodon/src/content/ui/LoginFlow/LoginIssuePage.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 import QtQuick
0005 import QtQuick.Controls 2 as QQC2
0006 import QtQuick.Layouts
0007 import QtQml.Models
0008 
0009 import org.kde.kirigami 2 as Kirigami
0010 import org.kde.kirigamiaddons.formcard 1 as FormCard
0011 
0012 import org.kde.tokodon
0013 
0014 MastoPage {
0015     id: root
0016 
0017     title: i18nc("@title:window", "Login Issue")
0018 
0019     FormCard.FormCard {
0020         Layout.topMargin: Kirigami.Units.largeSpacing
0021 
0022         FormCard.FormTextDelegate {
0023             leading: Kirigami.Icon {
0024                 source: "data-warning"
0025             }
0026 
0027             text: i18n("There was an issue logging into the server:<br><b>%1</b>", AccountManager.selectedAccountLoginIssue())
0028             textItem.textFormat: Text.RichText
0029         }
0030     }
0031 
0032     FormCard.FormCard {
0033         Layout.topMargin: Kirigami.Units.largeSpacing
0034 
0035         FormCard.FormTextDelegate {
0036             id: helpLabel
0037             text: i18n("Please check if the password service is running. For other login issues, you can try logging into the server's website.\\n\\nYou can attempt to log in again with the button below, or restart Tokodon.")
0038             icon.name: "internet-services-symbolic"
0039             textItem {
0040                 wrapMode: Text.WordWrap
0041             }
0042         }
0043 
0044         FormCard.FormDelegateSeparator {}
0045 
0046         FormCard.FormButtonDelegate {
0047             id: continueButton
0048             text: i18n("View Website")
0049             icon.name: "internet-services-symbolic"
0050             onClicked: Qt.openUrlExternally(AccountManager.selectedAccount.instanceUri)
0051         }
0052 
0053         FormCard.FormDelegateSeparator {}
0054 
0055         FormCard.FormButtonDelegate {
0056             id: attemptButton
0057             text: i18n("Re-Attempt Log In")
0058             icon.name: "edit-redo-symbolic"
0059             onClicked: {
0060                 AccountManager.selectedAccount.validateToken()
0061                 AccountManager.selectedAccount = AccountManager.selectedAccount; // reload the pages
0062             }
0063         }
0064     }
0065 }