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

KDE's Doxygen guidelines are available online.