Warning, /network/kdeconnect-kde/plugins/findthisdevice/kdeconnect_findthisdevice_config.qml is written in an unsupported language. File is not indexed.

0001 /**
0002  * SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 import QtQuick 2.15
0008 import QtQuick.Controls 2.15 as QQC2
0009 import QtQuick.Layouts 1.15
0010 import org.kde.kirigami 2.20 as Kirigami
0011 import Qt.labs.platform 1.1
0012 import org.kde.kdeconnect 1.0
0013 
0014 Kirigami.FormLayout {
0015 
0016     property string device
0017 
0018     property var action: Kirigami.Action {
0019         icon.name: "dialog-ok"
0020         text: i18n("Apply")
0021         onTriggered: config.set("ringtone", path.text)
0022     }
0023 
0024     FileDialog {
0025         id: fileDialog
0026         currentFile: path.text
0027 
0028         onAccepted: {
0029             path.text = currentFile.toString().replace("file://", "")
0030         }
0031     }
0032 
0033     KdeConnectPluginConfig {
0034         id: config
0035         deviceId: device
0036         pluginName: "kdeconnect_findthisdevice"
0037 
0038         onConfigChanged: {
0039             path.text = getString("ringtone", StandardPaths.writableLocation(StandardPaths.DownloadsLocation).toString().replace("file://", ""))
0040         }
0041     }
0042 
0043     RowLayout {
0044         Kirigami.FormData.label: i18n("Sound to play:")
0045 
0046         QQC2.TextField {
0047             id: path
0048         }
0049 
0050         QQC2.Button {
0051             icon.name: "document-open"
0052             onClicked: fileDialog.open()
0053         }
0054     }
0055 }
0056