From 617a0b0707fe5dea615080d66b7ec3bb429fcb7c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 5 Jan 2009 12:58:05 +0000 Subject: [PATCH] a stop button, fake for now svn path=/trunk/KDE/kdebase/workspace/plasma/scriptengines/javascript/; revision=906028 --- .../tests/script-nowplaying/contents/code/main.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scriptengines/javascript/tests/script-nowplaying/contents/code/main.js b/scriptengines/javascript/tests/script-nowplaying/contents/code/main.js index 9bc9439af..53c86c098 100644 --- a/scriptengines/javascript/tests/script-nowplaying/contents/code/main.js +++ b/scriptengines/javascript/tests/script-nowplaying/contents/code/main.js @@ -1,14 +1,23 @@ plasmoid.dataUpdate = function(a, b) { - for ( var i in b ) { - print(i + ' -> ' + b[i] ); - } label.text = "Playing " + b.Title + " by " + b.Artist + ". time: " + parseInt(b.Position/60) + ":" + (parseInt(b.Position)%60); } +plasmoid.stop = function() +{ + print("stopping"); +} + layout = new LinearLayout(plasmoid); +layout.orientation = Vertical; label = new Label(); layout.addItem(label); +stop = new PushButton(); +stop.text = "Stop"; +layout.addItem(stop); + +stop["clicked()"].connect(plasmoid.stop); + plasmoid.dataEngine("nowplaying").connectSource("org.mpris.amarok", plasmoid, 500); \ No newline at end of file