plasmoid: Port to org.kde.plasma.components 3.0

This commit is contained in:
Aleix Pol 2019-07-19 13:18:28 +02:00
parent 875eba8e07
commit 51d2382988
9 changed files with 30 additions and 43 deletions

View file

@ -19,8 +19,6 @@
*/ */
import QtQuick 2.1 import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0 import org.kde.kdeconnect 1.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4

View file

@ -20,7 +20,6 @@
import QtQuick 2.1 import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0 import org.kde.kdeconnect 1.0
QtObject { QtObject {

View file

@ -21,7 +21,6 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
DropArea { DropArea {
readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge

View file

@ -21,13 +21,12 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.kdeconnect 1.0 import org.kde.kdeconnect 1.0
import QtQuick.Dialogs 1.0 import QtQuick.Dialogs 1.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
PlasmaComponents.ListItem PlasmaComponents.ItemDelegate
{ {
id: root id: root
readonly property QtObject device: DeviceDbusInterfaceFactory.create(model.deviceId) readonly property QtObject device: DeviceDbusInterfaceFactory.create(model.deviceId)
@ -95,9 +94,9 @@ PlasmaComponents.ListItem
} }
id: shareFile id: shareFile
iconSource: "document-share" icon.name: "document-share"
visible: share.available visible: share.available
tooltip: i18n("Share file") ToolTip.text: i18n("Share file")
onClicked: { onClicked: {
fileDialog.open() fileDialog.open()
fileDialog.fileUrls.forEach(function (url) { fileDialog.fileUrls.forEach(function (url) {
@ -115,9 +114,9 @@ PlasmaComponents.ListItem
} }
id: ring id: ring
iconSource: "irc-voice" icon.name: "irc-voice"
visible: findmyphone.available visible: findmyphone.available
tooltip: i18n("Ring my phone") ToolTip.text: i18n("Ring my phone")
onClicked: { onClicked: {
findmyphone.ring() findmyphone.ring()
@ -133,9 +132,9 @@ PlasmaComponents.ListItem
} }
id: browse id: browse
iconSource: "document-open-folder" icon.name: "document-open-folder"
visible: sftp.available visible: sftp.available
tooltip: i18n("Browse this device") ToolTip.text: i18n("Browse this device")
onClicked: { onClicked: {
sftp.browse() sftp.browse()
@ -147,7 +146,7 @@ PlasmaComponents.ListItem
} }
//RemoteKeyboard //RemoteKeyboard
PlasmaComponents.ListItem { PlasmaComponents.ItemDelegate {
visible: remoteKeyboard.remoteState visible: remoteKeyboard.remoteState
width: parent.width width: parent.width
@ -169,7 +168,7 @@ PlasmaComponents.ListItem
} }
//Notifications //Notifications
PlasmaComponents.ListItem { PlasmaComponents.ItemDelegate {
visible: notificationsModel.count>0 visible: notificationsModel.count>0
enabled: true enabled: true
PlasmaComponents.Label { PlasmaComponents.Label {
@ -179,8 +178,8 @@ PlasmaComponents.ListItem
enabled: true enabled: true
visible: notificationsModel.isAnyDimissable; visible: notificationsModel.isAnyDimissable;
anchors.right: parent.right anchors.right: parent.right
iconSource: "edit-clear-history" icon.name: "edit-clear-history"
tooltip: i18n("Dismiss all notifications") ToolTip.text: i18n("Dismiss all notifications")
onClicked: notificationsModel.dismissAll(); onClicked: notificationsModel.dismissAll();
} }
} }
@ -190,7 +189,7 @@ PlasmaComponents.ListItem
id: notificationsModel id: notificationsModel
deviceId: root.device.id() deviceId: root.device.id()
} }
delegate: PlasmaComponents.ListItem { delegate: PlasmaComponents.ItemDelegate {
id: listitem id: listitem
enabled: true enabled: true
onClicked: checked = !checked onClicked: checked = !checked
@ -215,8 +214,8 @@ PlasmaComponents.ListItem
visible: repliable visible: repliable
enabled: repliable enabled: repliable
anchors.right: dismissButton.left anchors.right: dismissButton.left
iconSource: "mail-reply-sender" icon.name: "mail-reply-sender"
tooltip: i18n("Reply") ToolTip.text: i18n("Reply")
onClicked: dbusInterface.reply(); onClicked: dbusInterface.reply();
} }
PlasmaComponents.ToolButton { PlasmaComponents.ToolButton {
@ -224,8 +223,8 @@ PlasmaComponents.ListItem
visible: notificationsModel.isAnyDimissable; visible: notificationsModel.isAnyDimissable;
enabled: dismissable enabled: dismissable
anchors.right: parent.right anchors.right: parent.right
iconSource: "window-close" icon.name: "window-close"
tooltip: i18n("Dismiss") ToolTip.text: i18n("Dismiss")
onClicked: dbusInterface.dismiss(); onClicked: dbusInterface.dismiss();
} }
} }
@ -249,8 +248,8 @@ PlasmaComponents.ListItem
PlasmaComponents.Button PlasmaComponents.Button
{ {
id: addCommandButton id: addCommandButton
iconSource: "list-add" icon.name: "list-add"
tooltip: i18n("Add command") ToolTip.text: i18n("Add command")
onClicked: rc.plugin.editCommands() onClicked: rc.plugin.editCommands()
visible: rc.plugin && rc.plugin.canAddCommand visible: rc.plugin && rc.plugin.canAddCommand
} }
@ -262,7 +261,7 @@ PlasmaComponents.ListItem
id: commandsModel id: commandsModel
deviceId: rc.device.id() deviceId: rc.device.id()
} }
delegate: PlasmaComponents.ListItem { delegate: PlasmaComponents.ItemDelegate {
enabled: true enabled: true
onClicked: rc.plugin.triggerCommand(key) onClicked: rc.plugin.triggerCommand(key)
@ -281,7 +280,7 @@ PlasmaComponents.ListItem
PlasmaComponents.Label { PlasmaComponents.Label {
text: i18n("Share text") text: i18n("Share text")
} }
PlasmaComponents3.TextArea { PlasmaComponents.TextArea {
id: shareText id: shareText
width: parent.width width: parent.width
} }
@ -289,7 +288,7 @@ PlasmaComponents.ListItem
{ {
id: submitTextButton id: submitTextButton
anchors.right: shareText.right anchors.right: shareText.right
iconSource: "document-send" icon.name: "document-send"
onClicked: { onClicked: {
share.plugin.shareText(shareText.getText(0, shareText.length)) share.plugin.shareText(shareText.getText(0, shareText.length))
shareText.clear() shareText.clear()

View file

@ -19,8 +19,6 @@
*/ */
import QtQuick 2.1 import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0 import org.kde.kdeconnect 1.0
QtObject { QtObject {

View file

@ -20,8 +20,8 @@
import QtQuick 2.1 import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kdeconnect 1.0 as KdeConnect import org.kde.kdeconnect 1.0 as KdeConnect
Item { Item {
@ -38,14 +38,14 @@ Item {
/* /*
//Startup arguments //Startup arguments
PlasmaComponents.Label { Text {
visible: (startupArguments.length > 0) visible: (startupArguments.length > 0)
text: (""+startupArguments) text: (""+startupArguments)
anchors.fill: parent anchors.fill: parent
} }
*/ */
PlasmaExtras.ScrollArea { PlasmaComponents.ScrollView {
id: dialogItem id: dialogItem
anchors.fill: parent anchors.fill: parent

View file

@ -19,8 +19,6 @@
*/ */
import QtQuick 2.1 import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0 import org.kde.kdeconnect 1.0
QtObject { QtObject {

View file

@ -19,8 +19,6 @@
*/ */
import QtQuick 2.1 import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0 import org.kde.kdeconnect 1.0
QtObject { QtObject {

View file

@ -19,8 +19,6 @@
*/ */
import QtQuick 2.1 import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0 import org.kde.kdeconnect 1.0
QtObject { QtObject {