From 3ac0484f21edb10859dd946f3fcfade9b0782690 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Wed, 31 Dec 2014 08:09:53 +0300 Subject: [PATCH] some test with actions --- .../plasmoid/plasmoid/contents/ui/main.qml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sources/plasmoid/plasmoid/contents/ui/main.qml b/sources/plasmoid/plasmoid/contents/ui/main.qml index 994b19b..7227b2b 100644 --- a/sources/plasmoid/plasmoid/contents/ui/main.qml +++ b/sources/plasmoid/plasmoid/contents/ui/main.qml @@ -16,6 +16,7 @@ ***************************************************************************/ import QtQuick 2.2 +import QtQuick.Controls 1.3 as QtControls import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents @@ -58,7 +59,12 @@ Item { } property int interval: plasmoid.configuration.autoUpdateInterval property string pattern: plasmoid.configuration.textPattern + property variant paths: { + "netctl": plasmoid.configuration.netctlPath, + "sudo": plasmoid.configuration.sudoPath + } property bool status: false + property bool useHelper: plasmoid.configuration.useHelper // init Plasmoid.icon: icon.source @@ -118,4 +124,20 @@ Item { text: "N\\A" } } + + QtControls.Action { + id: stopProfile + text: i18n("Stop profile") + iconSource: "dialog-close" + onTriggered: NetctlAdds.stopProfileSlot(info, useHelper, paths["netctl"], paths["sudo"]) + } + + Component.onCompleted: { + plasmoid.setAction("stopProfile", i18n("Stop profile"), "dialog-close") +// plasmoid.setAction("powerdevilkcm", i18n("&Configure Power Saving..."), "preferences-system-power-management"); + } + + function action_stopProfile() { + NetctlAdds.stopProfileSlot(info, useHelper, paths["netctl"], paths["sudo"]) + } }