Warning, /utilities/keysmith/src/contents/ui/RenameAccount.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-License-Identifier: GPL-3.0-or-later
0003  * SPDX-FileCopyrightText: 2020-2021 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
0004  */
0005 
0006 import QtQuick 2.1
0007 import QtQuick.Layouts 1.2
0008 import QtQuick.Controls 2.0 as Controls
0009 import org.kde.kirigami 2.8 as Kirigami
0010 
0011 import Keysmith.Application 1.0 as Application
0012 import Keysmith.Models 1.0 as Models
0013 import Keysmith.Validators 1.0 as Validators
0014 
0015 Kirigami.Page {
0016     id: root
0017     title: i18nc("@title:window", "Rename account to add")
0018 
0019     property Application.RenameAccountViewModel vm
0020 
0021     property bool acceptable: accountName.acceptable
0022 
0023     Connections {
0024         target: vm.input
0025         function onTypeChanged() {
0026             root.detailsEnabled = false;
0027         }
0028     }
0029 
0030     ColumnLayout {
0031         anchors {
0032             horizontalCenter: parent.horizontalCenter
0033         }
0034         Controls.Label {
0035             text:i18nc("@info:label Keysmith received an account to add via URI on e.g. commandline which is already in use", "Another account with the same name already exists. Please correct the name or issuer for the new account.")
0036             color: Kirigami.Theme.negativeTextColor
0037             Layout.maximumWidth: root.width - 2 * Kirigami.Units.largeSpacing
0038             wrapMode: Text.WordWrap
0039         }
0040         AccountNameForm {
0041             id: accountName
0042             accounts: vm.accounts
0043             validateAccountAvailability: true
0044             validatedInput: root.vm.input
0045         }
0046     }
0047 
0048     actions.left: Kirigami.Action {
0049         text: i18nc("@action:button cancel and dismiss the rename account form", "Cancel")
0050         iconName: "edit-undo"
0051         onTriggered: {
0052             vm.cancelled();
0053         }
0054     }
0055     actions.main: Kirigami.Action {
0056         text: i18n("Add")
0057         iconName: "answer-correct"
0058         enabled: acceptable
0059         onTriggered: {
0060             vm.accepted();
0061         }
0062     }
0063 }