Warning, /network/kaccounts-integration/src/kcm/ui/RemoveAccountDialog.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   SPDX-FileCopyrightText: 2020 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003  *
0004  *   SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick
0008 import QtQuick.Layouts
0009 
0010 import org.kde.kirigami as Kirigami
0011 
0012 import org.kde.kaccounts as KAccounts
0013 
0014 MessageBoxSheet {
0015     id: component
0016     property int accountId
0017     property string displayName
0018     property string providerName
0019     signal accountRemoved()
0020 
0021     Component {
0022         id: accountRemovalJob
0023         KAccounts.RemoveAccountJob {
0024             onFinished: component.accountRemoved()
0025         }
0026     }
0027 
0028     title: i18ndc("kaccounts-integration", "The title for a dialog which lets you remove an account", "Remove Account?")
0029     text: {
0030         if (displayName.length > 0 && providerName.length > 0) {
0031             return i18ndc("kaccounts-integration", "The text for a dialog which lets you remove an account when both provider name and account name are available", "Are you sure you wish to remove the \"%1\" account \"%2\"?", providerName, displayName)
0032         } else if (displayName.length > 0) {
0033             return i18ndc("kaccounts-integration", "The text for a dialog which lets you remove an account when only the account name is available", "Are you sure you wish to remove the account \"%1\"?", displayName)
0034         } else {
0035             return i18ndc("kaccounts-integration", "The text for a dialog which lets you remove an account when only the provider name is available", "Are you sure you wish to remove this \"%1\" account?", providerName)
0036         }
0037     }
0038     actions: [
0039         Kirigami.Action {
0040             text: i18ndc("kaccounts-integration", "The label for a button which will cause the removal of a specified account", "Remove Account")
0041             onTriggered: {
0042                 var job = accountRemovalJob.createObject(component, { "accountId": component.accountId });
0043                 job.start();
0044             }
0045         }
0046     ]
0047 }