Warning, /frameworks/purpose/src/plugins/kdeconnect/kdeconnectplugin_config.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0003
0004 SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006
0007 import QtQuick 2.7
0008 import QtQuick.Layouts 1.1
0009 import QtQuick.Controls 2.5
0010 import org.kde.kirigami 2.12 as Kirigami
0011 import org.kde.kdeconnect 1.0
0012
0013 ColumnLayout {
0014
0015 id: root
0016 property var device: undefined
0017
0018 anchors.bottomMargin: Kirigami.Units.smallSpacing
0019
0020 Kirigami.Heading {
0021 text: i18nd("purpose6_kdeconnect", "Choose a device to send to:")
0022 visible: list.count !== 0
0023 level: 1
0024 }
0025
0026 ScrollView {
0027 id: scroll
0028
0029 Layout.fillWidth: true
0030 Layout.fillHeight: true
0031
0032 // Make sure we have space to show the placeholdermessage when no explicit size is set
0033 contentHeight: list.count !== 0 ? implicitContentHeight : Kirigami.Units.gridUnit * 3
0034
0035 Component.onCompleted: scroll.background.visible = true
0036
0037 ListView {
0038 id: list
0039
0040 // Don't select anything by default; make the user choose explicitly
0041 currentIndex: -1
0042
0043 clip: true
0044 model: DevicesModel {
0045 id: connectDeviceModel
0046 displayFilter: DevicesModel.Paired | DevicesModel.Reachable
0047 }
0048
0049 delegate: ItemDelegate {
0050 width: ListView.view.width
0051 text: model.name
0052 icon.name: model.iconName
0053 onClicked: root.device = deviceId
0054 checked: root.device === deviceId
0055 highlighted: root.device === deviceId
0056 }
0057
0058 Kirigami.PlaceholderMessage {
0059 anchors.centerIn: parent
0060 width: parent.width - (Kirigami.Units.largeSpacing * 4)
0061 visible: list.count === 0
0062 text: i18nd("purpose6_kdeconnect","No devices found")
0063 }
0064 }
0065 }
0066 }