2021-02-27 19:04:47 +00:00
|
|
|
/**
|
|
|
|
* SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
|
|
*/
|
|
|
|
|
2022-12-13 20:45:50 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15 as QQC2
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
2019-10-27 17:08:51 +00:00
|
|
|
import Qt.labs.platform 1.1
|
|
|
|
import org.kde.kdeconnect 1.0
|
|
|
|
|
|
|
|
Kirigami.FormLayout {
|
|
|
|
|
|
|
|
property string device
|
|
|
|
|
|
|
|
property var action: Kirigami.Action {
|
|
|
|
icon.name: "dialog-ok"
|
|
|
|
text: i18n("Apply")
|
|
|
|
onTriggered: config.set("ringtone", path.text)
|
|
|
|
}
|
|
|
|
|
|
|
|
FileDialog {
|
|
|
|
id: fileDialog
|
|
|
|
currentFile: path.text
|
|
|
|
|
|
|
|
onAccepted: {
|
|
|
|
path.text = currentFile.toString().replace("file://", "")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
KdeConnectPluginConfig {
|
|
|
|
id: config
|
|
|
|
deviceId: device
|
|
|
|
pluginName: "kdeconnect_findthisdevice"
|
|
|
|
|
|
|
|
onConfigChanged: {
|
2022-12-13 20:45:50 +00:00
|
|
|
path.text = getString("ringtone", StandardPaths.writableLocation(StandardPaths.DownloadsLocation).toString().replace("file://", ""))
|
2019-10-27 17:08:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Kirigami.FormData.label: i18n("Sound to play:")
|
|
|
|
|
2022-12-13 20:45:50 +00:00
|
|
|
QQC2.TextField {
|
2019-10-27 17:08:51 +00:00
|
|
|
id: path
|
|
|
|
}
|
|
|
|
|
2022-12-13 20:45:50 +00:00
|
|
|
QQC2.Button {
|
2019-10-27 17:08:51 +00:00
|
|
|
icon.name: "document-open"
|
2022-12-13 20:45:50 +00:00
|
|
|
onClicked: fileDialog.open()
|
2019-10-27 17:08:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|