Commit 523184bc authored by Nate Graham's avatar Nate Graham
Browse files

Revert "Delete the Touchpad applet"

This reverts commit 3b402664.

Removing the applet entirely was too heavy-handed, as it can serve a
valid purpose as a status notifier to remind people who have manually
disabled their touchpads that they have done so.

BUG: 445095
FIXED-IN: 5.23.4
(cherry picked from commit 4d03ce00)
parent 0b1beaaf
......@@ -41,7 +41,7 @@ target_link_libraries(touchpad
add_subdirectory(kcm)
add_subdirectory(kded)
add_subdirectory(dataengine)
add_subdirectory(applet)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.touchpad.xml
DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
......
set(DataEngine_SRCS
remove_definitions(-DTRANSLATION_DOMAIN="kcm_touchpad")
add_definitions(-DTRANSLATION_DOMAIN="plasma_applet_touchpad")
plasma_install_package(qml touchpad)
set(Applet_SRCS
touchpadengine.cpp
touchpadservice.cpp
)
qt5_generate_dbus_interface(../kded/kded.h org.kde.touchpad.xml)
qt_add_dbus_interfaces(DataEngine_SRCS
qt_add_dbus_interfaces(Applet_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.touchpad.xml
)
qt_add_dbus_interfaces(DataEngine_SRCS
qt_add_dbus_interfaces(Applet_SRCS
${KDED_DBUS_INTERFACE}
)
kcoreaddons_add_plugin(plasma_engine_touchpad SOURCES ${DataEngine_SRCS} INSTALL_NAMESPACE "plasma/dataengine")
kcoreaddons_add_plugin(plasma_engine_touchpad SOURCES ${Applet_SRCS} INSTALL_NAMESPACE "plasma/dataengine")
target_link_libraries(plasma_engine_touchpad
KF5::Plasma
Qt::DBus
......@@ -25,3 +31,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/plasma-dataengine-touchpad.desktop
install(FILES touchpad.operations
DESTINATION ${PLASMA_DATA_INSTALL_DIR}/services
)
install(FILES touchpad.svg
DESTINATION ${KDE_INSTALL_DATADIR}/plasma/desktoptheme/default/icons
)
// -*- coding: iso-8859-1 -*-
/*
* Copyright 2013 Alexander Mezin <mezin.alexander@gmail.com>
* Copyright 2016 Kai Uwe Broulik <kde@privat.broulik.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0
Item {
id: root
readonly property bool hasTouchpad: typeof dataSource.data.touchpad !== "undefined" && dataSource.data.touchpad.workingTouchpadFound
readonly property bool touchpadEnabled: hasTouchpad ? dataSource.data.touchpad.enabled : false
readonly property bool hasMouse: hasTouchpad ? dataSource.data.touchpad.mousePluggedIn : false
Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation
Plasmoid.icon: touchpadEnabled ? "input-touchpad-on" : "input-touchpad-off"
Plasmoid.status: {
if (confirmDialog.status !== PlasmaComponents.DialogStatus.Closed) {
return PlasmaCore.Types.AcceptingInputStatus;
} else if (hasTouchpad) {
return PlasmaCore.Types.ActiveStatus;
} else {
return PlasmaCore.Types.HiddenStatus;
}
}
Plasmoid.toolTipSubText: {
if (!hasTouchpad) {
return i18n("No touchpad was found");
} else if (touchpadEnabled) {
return i18n("Touchpad is enabled");
} else {
return i18n("Touchpad is disabled");
}
}
Plasmoid.onActivated: action_toggle()
Component.onCompleted: {
// the "text" argument for setAction is mandatory but we overwrite
// it by a binding right away anyway
plasmoid.setAction("toggle", "");
var action = plasmoid.action("toggle");
action.text = Qt.binding(function() {
return root.touchpadEnabled ? i18n("Disable touchpad") : i18n("Enable touchpad");
});
action.visible = Qt.binding(function() {
return root.hasTouchpad;
});
}
PlasmaCore.DataSource {
id: dataSource
engine: "touchpad"
connectedSources: dataSource.sources
}
Plasmoid.compactRepresentation: PlasmaCore.ToolTipArea {
id: toolTip
Layout.minimumWidth: PlasmaCore.Units.iconSizes.small
Layout.minimumHeight: Layout.minimumWidth
mainText: plasmoid.title
subText: plasmoid.toolTipSubText
active: confirmDialog.status === PlasmaComponents.DialogStatus.Closed
Connections {
target: confirmDialog
function onStatusChanged() {
if (confirmDialog.status === PlasmaComponents.DialogStatus.Open) {
toolTip.hideToolTip()
}
}
}
MouseArea {
anchors.fill: parent
enabled: root.hasTouchpad
onClicked: root.action_toggle()
}
PlasmaCore.IconItem {
anchors.fill: parent
source: plasmoid.icon
active: parent.containsMouse
enabled: root.hasTouchpad
}
}
// This is only accessible from System Tray, when hidden in the popup
// and you click the list item text instead of the icon
Plasmoid.fullRepresentation: Item {
PlasmaComponents.Button {
readonly property QtObject action: plasmoid.action("toggle")
anchors.centerIn: parent
text: action.text
enabled: action.visible
onClicked: action.trigger()
}
}
function action_toggle() {
if (!root.hasTouchpad) {
return;
}
if (!root.hasMouse && root.touchpadEnabled) {
confirmDialog.open()
return;
}
execOp("toggle")
}
function execOp(op) {
var service = dataSource.serviceForSource("touchpad")
service.startOperationCall(service.operationDescription(op))
}
PlasmaComponents.QueryDialog {
id: confirmDialog
visualParent: plasmoid.compactRepresentationItem
hideOnWindowDeactivate: true
titleText: i18n("Touchpad")
titleIcon: "dialog-warning"
message: i18n("No mouse was detected.\nAre you sure you want to disable the touchpad?")
acceptButtonText: i18n("Disable")
onAccepted: execOp("disable")
}
}
[Desktop Entry]
Comment=Shows current touchpad state
Comment[ar]=أظهر حالة لوحة اللمس الحاليّة
Comment[ast]=Amuesa l'estáu actual del panel táctil
Comment[az]=Cari toxunma paneli vəziyyətini göstərir
Comment[ca]=Mostra l'estat actual del ratolí tàctil
Comment[ca@valencia]=Mostra l'estat actual del ratolí tàctil
Comment[cs]=Zobrazí současný stav touchpadu
Comment[da]=Vis aktuel touchpad-tilstand
Comment[de]=Zeigt den aktuellen Status des Touchpads an
Comment[el]=Δείχνει την τρέχουσα κατάσταση της επιφάνειας αφής
Comment[en_GB]=Shows current touchpad state
Comment[es]=Muestra el estado actual del panel táctil
Comment[et]=Puutepadja aktiivse oleku näitamine
Comment[eu]=Erakutsi uneko ukimen-saguaren egoera
Comment[fi]=Näyttää kosketuslevyn nykyisen tilan
Comment[fr]=Afficher l'état actuel du pavé tactile
Comment[gl]=Mostra o estado da área táctil actual
Comment[he]=הראה את מצב לוח המגע
Comment[hu]=Az érintőtábla állapotának megjelenítése
Comment[ia]=Monstra stato currente de pannello tactile
Comment[id]=Tampilkan keadaan touchpad saat ini
Comment[is]=Birtir stöðu snertiplatta
Comment[it]=Mostra lo stato attuale del touchpad
Comment[ja]=現在のタッチパッドの状態を表示
Comment[ko]=현재 터치패드 상태 표시
Comment[lt]=Rodo esamą jutiklinio kilimėlio būseną
Comment[nl]=Huidige status van touchpad tonen
Comment[nn]=Vis gjeldande styreplatestatus
Comment[pa]=ਮੌਜੂਦਾ ਟੱਚਪੈਠ ਦੀ ਹਾਲਤ ਦਿਖਾਉਂਦਾ ਹੈ
Comment[pl]=Pokazuje bieżący stan gładzika
Comment[pt]=Mostra o estado actual do rato por toque
Comment[pt_BR]=Mostra o estado atual do touchpad
Comment[ro]=Arată starea curentă a zonei tactile
Comment[ru]=Показывает текущее состояние сенсорной панели
Comment[sk]=Zobrazí aktuálny stav touchpadu
Comment[sl]=Prikazuje trenutno stanje sledilne ploščice
Comment[sr]=Приказ тренутног стања додирника
Comment[sr@ijekavian]=Приказ тренутног стања додирника
Comment[sr@ijekavianlatin]=Prikaz trenutnog stanja dodirnika
Comment[sr@latin]=Prikaz trenutnog stanja dodirnika
Comment[sv]=Visar tryckplattans nuvarande tillstånd
Comment[ta]=தற்போதைய தொடுபலகை நிலையை காட்டும்
Comment[tr]=Dokunmatik yüzeyin durumunu gösterir
Comment[uk]=Показує поточний стан сенсорної панелі
Comment[vi]=Hiện trạng thái hiện thời của bàn cảm ứng
Comment[x-test]=xxShows current touchpad statexx
Comment[zh_CN]=显示当前触摸板状态
Comment[zh_TW]=顯示目前的觸控板狀態
Icon=input-touchpad
Keywords=Touchpad
Keywords[ast]=Panel táctil
Keywords[az]=Toxunma Paneli
Keywords[ca]=Ratolí tàctil
Keywords[ca@valencia]=Ratolí tàctil
Keywords[cs]=Touchpad
Keywords[da]=Touchpad
Keywords[de]=Touchpad
Keywords[el]=Επιφάνεια αφής
Keywords[en_GB]=Touchpad
Keywords[es]=Panel táctil
Keywords[et]=Puutepadi
Keywords[eu]=Ukimen-sagua
Keywords[fi]=Kosketuslevy
Keywords[fr]=Pavé tactile
Keywords[gl]=Área táctil
Keywords[he]=לוח מגע
Keywords[hu]=Érintőtábla
Keywords[ia]=Touchpad
Keywords[id]=Touchpad
Keywords[is]=Snertiplatti
Keywords[it]=Touchpad
Keywords[ja]=タッチパッド
Keywords[ko]=터치패드
Keywords[lt]=Jutiklinis kilimėlis
Keywords[nl]=Touchpad
Keywords[nn]=Styreplate
Keywords[pa]=ਟੱਚਪੈਡ
Keywords[pl]=Gładzik
Keywords[pt]=Rato por Toque
Keywords[pt_BR]=Touchpad
Keywords[ro]=Zonă tactilă
Keywords[ru]=сенсорная панель
Keywords[sk]=Touchpad
Keywords[sl]=Sledilna ploščica
Keywords[sr]=touchpad;додирник;
Keywords[sr@ijekavian]=touchpad;додирник;
Keywords[sr@ijekavianlatin]=touchpad;dodirnik;
Keywords[sr@latin]=touchpad;dodirnik;
Keywords[sv]=Tryckplatta
Keywords[tg]=Лавҳаи ламсӣ
Keywords[tr]=Dokunmatik yüzey
Keywords[uk]=Сенсорна панель
Keywords[vi]=Bàn cảm ứng
Keywords[x-test]=xxTouchpadxx
Keywords[zh_CN]=触摸板
Keywords[zh_TW]=觸控板
Name=Touchpad
Name[ar]=لوحة اللمس
Name[ast]=Panel táctil
Name[az]=Toxunma Paneli
Name[ca]=Ratolí tàctil
Name[ca@valencia]=Ratolí tàctil
Name[cs]=Touchpad
Name[da]=Touchpad
Name[de]=Touchpad
Name[el]=Επιφάνεια αφής
Name[en_GB]=Touchpad
Name[es]=Panel táctil
Name[et]=Puutepadi
Name[eu]=Ukimen-sagua
Name[fi]=Kosketuslevy
Name[fr]=Pavé tactile
Name[gl]=Área táctil
Name[he]=לוח מגע
Name[hu]=Érintőtábla
Name[ia]=Touchpad
Name[id]=Touchpad
Name[is]=Snertiplatti
Name[it]=Touchpad
Name[ja]=タッチパッド
Name[ko]=터치패드
Name[lt]=Jutiklinis kilimėlis
Name[nl]=Touchpad
Name[nn]=Styreplate
Name[pa]=ਟੱਚਪੈਡ
Name[pl]=Gładzik
Name[pt]=Rato por Toque
Name[pt_BR]=Touchpad
Name[ro]=Zonă tactilă
Name[ru]=Сенсорная панель
Name[sk]=Touchpad
Name[sl]=Sledilna ploščica
Name[sr]=Додирник
Name[sr@ijekavian]=Додирник
Name[sr@ijekavianlatin]=Dodirnik
Name[sr@latin]=Dodirnik
Name[sv]=Tryckplatta
Name[ta]=தொடுபலகை
Name[tg]=Лавҳаи ламсӣ
Name[tr]=Dokunmatik yüzey
Name[uk]=Сенсорна панель
Name[vi]=Bàn cảm ứng
Name[x-test]=xxTouchpadxx
Name[zh_CN]=触摸板
Name[zh_TW]=觸控板
Type=Service
X-KDE-ParentApp=
X-KDE-PluginInfo-Author=Alexander Mezin
X-KDE-PluginInfo-Category=System Information
X-KDE-PluginInfo-Email=mezin.alexander@gmail.com
X-KDE-PluginInfo-License=GPL-2.0+
X-KDE-PluginInfo-Name=touchpad
X-KDE-PluginInfo-Website=https://projects.kde.org/projects/playground/utils/kcm-touchpad/
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=declarativeappletscript
X-Plasma-ConfigPlugins=kcm_touchpad
X-Plasma-MainScript=ui/touchpad.qml
X-Plasma-NotificationArea=true
X-Plasma-NotificationAreaCategory=Hardware
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="128" height="64" id="svg2" version="1.1" inkscape:version="0.48.4 r9939" sodipodi:docname="touchpad.svg">
<defs id="defs4" />
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="3.959798" inkscape:cx="51.717623" inkscape:cy="35.126778" inkscape:document-units="px" inkscape:current-layer="touchpad_disabled" showgrid="false" showguides="true" inkscape:guide-bbox="true" inkscape:window-width="1366" inkscape:window-height="724" inkscape:window-x="-4" inkscape:window-y="21" inkscape:window-maximized="1" />
<metadata id="metadata7">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-988.36218)">
<g id="touchpad_enabled">
<title id="title3772">touchpad_enabled</title>
<rect ry="5" rx="5" transform="translate(0,988.36218)" y="2.7595019" x="2.9041886" height="43.184021" width="58.210041" id="rect3755" style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#353535;stroke-width:1.50000000000000000;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect ry="5" rx="5" y="1036.7048" x="2.9041886" height="13.889598" width="28.031733" id="rect3757" style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#353535;stroke-width:1.50000000000000000;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#353535;stroke-width:1.50000000000000000;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3759" width="28.031733" height="13.889598" x="32.829956" y="1036.5786" rx="5" ry="5" />
</g>
<g id="touchpad_disabled">
<title id="title3779">touchpad_disabled</title>
<rect style="fill:#ffffff;fill-opacity:0.19711539;fill-rule:nonzero;stroke:#323232;stroke-width:1.50000000000000000;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3761" width="58.210041" height="43.184021" x="66.29126" y="990.61658" rx="5" ry="5" />
<rect style="fill:#ffffff;fill-opacity:0.19711539;fill-rule:nonzero;stroke:#323232;stroke-width:1.50000000000000000;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3763" width="28.031733" height="13.889598" x="66.29126" y="1036.1997" rx="5" ry="5" />
<rect ry="5" rx="5" y="1036.0735" x="96.217026" height="13.889598" width="28.031733" id="rect3765" style="fill:#ffffff;fill-opacity:0.19711539;fill-rule:nonzero;stroke:#323232;stroke-width:1.50000000000000000;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</g>
</svg>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment