6366ceb530
Depending on the content we want to use Page or ScrollablePage The runcommand config should be a scrollablepage, but isn't right now The code even (incompletely) works around that To address this make the individual config files add their page instead of an additional wrapper page
66 lines
1.6 KiB
QML
66 lines
1.6 KiB
QML
/**
|
|
* 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
|
|
*/
|
|
|
|
import QtQuick 2.15
|
|
import QtQuick.Controls 2.15 as QQC2
|
|
import QtQuick.Layouts 1.15
|
|
import org.kde.kirigami 2.20 as Kirigami
|
|
import Qt.labs.platform 1.1
|
|
import org.kde.kdeconnect 1.0
|
|
|
|
Kirigami.Page {
|
|
|
|
property string device
|
|
|
|
actions: [
|
|
Kirigami.Action {
|
|
icon.name: "dialog-ok"
|
|
text: i18n("Apply")
|
|
onTriggered: config.set("incoming_path", path.text)
|
|
}
|
|
]
|
|
|
|
Kirigami.FormLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
FolderDialog {
|
|
id: folderDialog
|
|
currentFolder: path.text
|
|
|
|
onAccepted: {
|
|
path.text = currentFolder.toString().replace("file://", "")
|
|
}
|
|
}
|
|
|
|
KdeConnectPluginConfig {
|
|
id: config
|
|
deviceId: device
|
|
pluginName: "kdeconnect_share"
|
|
|
|
onConfigChanged: {
|
|
path.text = getString("incoming_path", StandardPaths.writableLocation(StandardPaths.DownloadsLocation).toString().replace("file://", ""))
|
|
}
|
|
}
|
|
|
|
RowLayout {
|
|
Kirigami.FormData.label: i18n("Save files in:")
|
|
|
|
QQC2.TextField {
|
|
id: path
|
|
}
|
|
|
|
QQC2.Button {
|
|
icon.name: "document-open"
|
|
onClicked: folderDialog.open()
|
|
}
|
|
}
|
|
|
|
QQC2.Label {
|
|
text: i18n("%1 in the path will be replaced with the specific device name", "%1")
|
|
}
|
|
}
|
|
}
|