Warning, /pim/kube/extensions/gpg/qml/main.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  *
0009  * This program is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012  * GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License along
0015  * with this program; if not, write to the Free Software Foundation, Inc.,
0016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017  */
0018 
0019 import QtQuick 2.7
0020 import Qt.labs.settings 1.0
0021 import org.kube.framework 1.0 as Kube
0022 import org.kube.extensionapi 1.0
0023 
0024 Row {
0025     id: root
0026     property variant secret: null
0027 
0028     Component.onCompleted: {
0029         loadSecret(context.accountId)
0030     }
0031 
0032     function loadSecret(accountId) {
0033         if (settings.enabled) {
0034             ExtensionApi.loadSecret(accountId)
0035         }
0036     }
0037 
0038     function storeSecret(accountId, keyLookupName, secret) {
0039         if (settings.enabled) {
0040             ExtensionApi.storeSecret(accountId, keyLookupName, secret)
0041         }
0042     }
0043 
0044     Connections {
0045         target: ExtensionApi
0046         function onSecretAvailable(secret) {
0047             root.secret = secret
0048         }
0049     }
0050 
0051     spacing: Kube.Units.smallSpacing
0052     Kube.CheckBox {
0053         id: checkBox
0054         activeFocusOnTab: false
0055         checked: false
0056     }
0057     Kube.Label {
0058         text: qsTr("Enable GPG Keyring Integration")
0059         color: Kube.Colors.disabledTextColor
0060     }
0061 
0062     Settings {
0063         id: settings
0064         category: "extension.gpg"
0065         property alias enabled: checkBox.checked
0066     }
0067 }