Purpose

kdeconnectplugin_config.qml
1/*
2 SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7import QtQuick 2.7
8import QtQuick.Layouts 1.1
9import QtQuick.Controls 2.5
10import org.kde.kirigami 2.12 as Kirigami
11import org.kde.kdeconnect 1.0
12
13ColumnLayout {
14
15 id: root
16 property var device: undefined
17
18 anchors.bottomMargin: Kirigami.Units.smallSpacing
19
20 Kirigami.Heading {
21 text: i18nd("purpose6_kdeconnect", "Choose a device to send to:")
22 visible: list.count !== 0
23 level: 1
24 }
25
27 id: scroll
28
29 Layout.fillWidth: true
30 Layout.fillHeight: true
31
32 // Make sure we have space to show the placeholdermessage when no explicit size is set
33 contentHeight: list.count !== 0 ? implicitContentHeight : Kirigami.Units.gridUnit * 3
34
35 Component.onCompleted: scroll.background.visible = true
36
37 ListView {
38 id: list
39
40 // Don't select anything by default; make the user choose explicitly
41 currentIndex: -1
42
43 clip: true
44 model: DevicesModel {
45 id: connectDeviceModel
46 displayFilter: DevicesModel.Paired | DevicesModel.Reachable
47 }
48
49 delegate: ItemDelegate {
50 width: ListView.view.width
51 text: model.name
52 icon.name: model.iconName
53 onClicked: root.device = deviceId
54 checked: root.device === deviceId
55 highlighted: root.device === deviceId
56 }
57
59 anchors.centerIn: parent
60 width: parent.width - (Kirigami.Units.largeSpacing * 4)
61 visible: list.count === 0
62 text: i18nd("purpose6_kdeconnect","No devices found")
63 }
64 }
65 }
66}
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
QStringView level(QStringView ifopt)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QString name(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.