Warning, /network/neochat/src/qml/RegisterPassword.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 import QtQuick
0005 
0006 import org.kde.kirigami as Kirigami
0007 import org.kde.kirigamiaddons.formcard as FormCard
0008 
0009 import org.kde.neochat
0010 
0011 LoginStep {
0012     id: root
0013 
0014     onActiveFocusChanged: if (activeFocus) {
0015         passwordField.forceActiveFocus();
0016     }
0017 
0018     FormCard.FormTextFieldDelegate {
0019         id: passwordField
0020         label: i18n("Password:")
0021         echoMode: TextInput.Password
0022         onTextChanged: Registration.password = text
0023         Keys.onReturnPressed: {
0024             confirmPasswordField.forceActiveFocus();
0025         }
0026     }
0027 
0028     FormCard.FormTextFieldDelegate {
0029         id: confirmPasswordField
0030         label: i18n("Confirm Password:")
0031         enabled: passwordField.enabled
0032         echoMode: TextInput.Password
0033         statusMessage: passwordField.text.length === confirmPasswordField.text.length && passwordField.text !== confirmPasswordField.text ? i18n("The passwords do not match.") : ""
0034         Keys.onReturnPressed: {
0035             if (root.nextAction.enabled) {
0036                 root.nextAction.trigger();
0037             }
0038         }
0039     }
0040 
0041     nextAction: Kirigami.Action {
0042         onTriggered: {
0043             passwordField.enabled = false;
0044             Registration.registerAccount();
0045         }
0046         enabled: passwordField.text === confirmPasswordField.text
0047     }
0048 
0049     previousAction: Kirigami.Action {
0050         onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
0051     }
0052 }