Warning, /plasma/wacomtablet/src/applet/package/contents/ui/main.qml is written in an unsupported language. File is not indexed.
0001 // -*- coding: iso-8859-1 -*-
0002 /*
0003 * Copyright 2015 Weng Xuetian <wengxt@gmail.com>
0004 *
0005 * This program is free software; you can redistribute it and/or modify
0006 * it under the terms of the GNU Library General Public License as
0007 * published by the Free Software Foundation; either version 2 or
0008 * (at your option) any later version.
0009 *
0010 * This program is distributed in the hope that it will be useful,
0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0013 * GNU General Public License for more details
0014 *
0015 * You should have received a copy of the GNU Library General Public
0016 * License along with this program; if not, write to the
0017 * Free Software Foundation, Inc.,
0018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0019 */
0020
0021 import QtQuick
0022 import QtQuick.Layouts
0023 import org.kde.plasma.plasmoid
0024 import org.kde.plasma.core as PlasmaCore
0025 import org.kde.plasma.plasma5support as P5Support
0026 import org.kde.ksvg as KSvg
0027 import org.kde.kcmutils as KCMUtils
0028 import org.kde.config as KConfig
0029
0030 PlasmoidItem {
0031 id: root
0032
0033 function action_wacomtabletkcm() {
0034 var service = dataSource.serviceForSource("wacomtablet");
0035 var operation = service.operationDescription("RunKCM");
0036 service.startOperationCall(operation);
0037 }
0038
0039 PlasmaCore.Action {
0040 id: configureAction
0041 text: i18n("&Configure Graphics Tablet...")
0042 icon.name: "configure"
0043 visible: KConfig.KAuthorized.authorizeControlModule("kcm_wacomtablet");
0044 onTriggered: KCMUtils.KCMLauncher.openSystemSettings("kcm_wacomtablet");
0045 }
0046
0047 Component.onCompleted: {
0048 Plasmoid.setInternalAction("configure", configureAction)
0049 }
0050
0051 property bool active: dataSource.data["wacomtablet"]["serviceAvailable"] && dataModel.count != 0
0052
0053 toolTipMainText: i18n("Wacom Tablet")
0054 Plasmoid.status: active ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus
0055 Plasmoid.icon: "input-tablet"
0056 KSvg.Svg {
0057 id: lineSvg
0058 imagePath: "widgets/line"
0059 }
0060
0061 P5Support.DataSource {
0062 id: dataSource
0063 engine: "wacomtablet"
0064 connectedSources: dataSource.sources
0065 }
0066 P5Support.DataModel {
0067 id: dataModel
0068 dataSource: dataSource
0069 sourceFilter: "Tablet.*"
0070 }
0071
0072 fullRepresentation: FullRepresentation { }
0073 }