617a0b0707
svn path=/trunk/KDE/kdebase/workspace/plasma/scriptengines/javascript/; revision=906028
23 lines
553 B
JavaScript
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); |