add history widget
[mdictionary] / src / mdictionary / qml / XdxfDictDownloader.qml
1 import Qt 4.7
2
3 Rectangle {
4     id: rectangle1
5     width: 250
6     height: 80
7
8
9     SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
10     color : myPalette.window;
11
12     function setValue(intiger){
13         console.log("ala value " +intiger);
14         progressbar1.setValue(intiger);
15     }
16     function setText(string){
17         console.log("ala text " +string);
18         text.text=string;
19     }
20     function setMaximumValue(intiger){
21         console.log("ala max " +intiger);
22         if(intiger==0){
23             timerUp.running=true;
24             setValue(-1);
25         }
26         else{
27             timerUp.running=false;
28             progressbar1.setMax(intiger);
29         }
30     }
31
32     signal cancelDownloading();
33
34     Text {
35         id: text
36         text: qsTr("Downloading dictionaries list");
37         anchors.right: parent.right
38         anchors.left: parent.left
39         font.pixelSize: 12
40         horizontalAlignment: Text.AlignHCenter;
41     }
42
43     ProgressBar {
44         id: progressbar1
45         anchors.top: text.bottom
46         anchors.horizontalCenter: parent.horizontalCenter
47         value: -1
48         value2: 30
49     }
50
51     Button {
52         id: button1
53         height: 25;
54         textInButton: qsTr("Cancel");
55         anchors.top: progressbar1.bottom
56         anchors.right: parent.right
57         anchors.left: parent.left
58         onClicked: {
59             console.log("click");
60             rectangle1.cancelDownloading();
61         }
62     }
63
64     Timer {
65         property bool progressMax:true;
66         id:timerUp;
67         interval: 50;
68         running: false;
69         repeat: true
70         onTriggered:{
71             if(progressMax==true){
72                  progressbar1.setValue2(0);
73                  progressMax=false;
74             }
75             else{
76                 progressbar1.setValue2(100);
77                 progressMax=true;
78             }
79         }
80     }
81 }