2009-01-05 13:53:01 +01:00
|
|
|
plasmoid.dataUpdate = function(a, b)
|
|
|
|
{
|
|
|
|
label.text = "Playing " + b.Title + " by " + b.Artist + ". time: " +
|
|
|
|
parseInt(b.Position/60) + ":" + (parseInt(b.Position)%60);
|
|
|
|
}
|
|
|
|
|
2009-01-05 13:58:05 +01:00
|
|
|
plasmoid.stop = function()
|
|
|
|
{
|
|
|
|
print("stopping");
|
|
|
|
}
|
|
|
|
|
2009-01-05 13:53:01 +01:00
|
|
|
layout = new LinearLayout(plasmoid);
|
2009-01-05 13:58:05 +01:00
|
|
|
layout.orientation = Vertical;
|
2009-01-05 13:53:01 +01:00
|
|
|
label = new Label();
|
|
|
|
layout.addItem(label);
|
|
|
|
|
2009-01-05 13:58:05 +01:00
|
|
|
stop = new PushButton();
|
|
|
|
stop.text = "Stop";
|
|
|
|
layout.addItem(stop);
|
|
|
|
|
|
|
|
stop["clicked()"].connect(plasmoid.stop);
|
|
|
|
|
2009-01-05 13:53:01 +01:00
|
|
|
plasmoid.dataEngine("nowplaying").connectSource("org.mpris.amarok", plasmoid, 500);
|