Warning, /network/kdeconnect-kde/plasmoid/package/contents/ui/main.qml is written in an unsupported language. File is not indexed.
0001 /** 0002 * SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 import QtQuick 0008 import org.kde.plasma.core as PlasmaCore 0009 import org.kde.plasma.plasmoid 0010 import org.kde.kquickcontrolsaddons 0011 import org.kde.kdeconnect 0012 import org.kde.kcmutils as KCMUtils 0013 import org.kde.config as KConfig 0014 0015 PlasmoidItem 0016 { 0017 id: root 0018 0019 readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge 0020 || plasmoid.location == PlasmaCore.Types.RightEdge 0021 || plasmoid.location == PlasmaCore.Types.BottomEdge 0022 || plasmoid.location == PlasmaCore.Types.LeftEdge) 0023 0024 DevicesModel { 0025 id: connectDeviceModel 0026 displayFilter: DevicesModel.Paired | DevicesModel.Reachable 0027 } 0028 0029 DevicesModel { 0030 id: pairedDeviceModel 0031 displayFilter: DevicesModel.Paired 0032 } 0033 0034 Plasmoid.icon: { 0035 let iconName = "kdeconnect-tray"; 0036 0037 if (inPanel) { 0038 return "kdeconnect-tray-symbolic"; 0039 } 0040 0041 return iconName; 0042 } 0043 0044 Binding { 0045 target: plasmoid 0046 property: "status" 0047 value: (connectDeviceModel.count > 0) ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus 0048 } 0049 0050 fullRepresentation: FullRepresentation { 0051 devicesModel: connectDeviceModel 0052 } 0053 0054 compactRepresentation: CompactRepresentation { 0055 } 0056 0057 PlasmaCore.Action { 0058 id: configureAction 0059 text: i18n("KDE Connect Settings...") 0060 icon.name: "configure" 0061 visible: KConfig.KAuthorized.authorizeControlModule("kcm_kdeconnect"); 0062 onTriggered: { 0063 KCMUtils.KCMLauncher.openSystemSettings("kcm_kdeconnect"); 0064 } 0065 } 0066 0067 Component.onCompleted: { 0068 Plasmoid.setInternalAction("configure", configureAction); 0069 } 0070 }