plasma-framework/scriptengines/javascript/tests/script-nowplaying/contents/code/main.js
Marco Martin 617a0b0707 a stop button, fake for now
svn path=/trunk/KDE/kdebase/workspace/plasma/scriptengines/javascript/; revision=906028
2009-01-05 12:58:05 +00:00

23 lines
553 B
JavaScript

plasmoid.dataUpdate = function(a, b)
{
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);