1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
3 import "UIConstants.js" as Const
15 height: taskView.height+Const.DEFAULT_MARGIN
17 function addTask(type,filename)
19 //emptyLabel.visible = Utils.emptyQuee();
20 //emptyLabel.visible = false;
21 //console.log("1. taskView.childrens.length: "+taskView.children.length);
22 //console.log("1. taskView.height: "+taskView.height);
23 var comp = Qt.createComponent("components/Bar.qml");
24 //var obj = comp.createObject(taskView,{"width": root.width});
25 var obj = comp.createObject(taskView);
27 console.log("Error creating object");
30 //obj.width = root.width
32 obj.cancel.connect(function(file) {
33 Utils.cancelFile(file);
36 obj.isDownload = true;
40 //console.log("2. taskView.childrens.length: "+taskView.children.length);
41 //console.log("2. taskView.height: "+taskView.height);
44 function setProgress(filename, progress)
46 var l = taskView.children.length;
47 for(var i=0;i<l;++i) {
48 var item = taskView.children[i];
49 if(item && item.label==filename) {
50 item.setProgres(progress);
56 function start(filename)
58 var l = taskView.children.length;
59 for(var i=0;i<l;++i) {
60 var item = taskView.children[i];
61 if(item && item.label==filename) {
68 function stop(filename)
70 //console.log("stop task");
71 //console.log("3. taskView.childrens.length: "+taskView.children.length);
72 var l = taskView.children.length;
73 for(var i=0;i<l;++i) {
74 var item = taskView.children[i];
75 if(item && item.label==filename) {
76 //console.log("stop task 2");
82 //console.log("4. taskView.childrens.length: "+taskView.children.length);
83 //emptyLabel.visible = Utils.emptyQuee();
89 spacing: Const.DEFAULT_MARGIN
91 //onHeightChanged: console.log("takView.height: "+height)
94 font.pixelSize: Const.DEFAULT_FONT_PIXEL_SIZE
95 color: Const.DEFAULT_FOREGROUND_COLOR
97 wrapMode: Text.WordWrap
99 qsTr("No active downloads or uploads") :
100 qsTr("Active downloads and uploads")
101 anchors.bottomMargin: 2*Const.DEFAULT_MARGIN
102 visible: root.count==0