table view
[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         progressbar1.setValue(intiger);
14     }
15     function setText(string){
16         text.text=string;
17     }
18     function setMaximumValue(intiger){
19         if(intiger==0){
20             timerUp.running=true;
21             setValue(-1);
22         }
23         else{
24             timerUp.running=false;
25             progressbar1.setMax(intiger);
26         }
27     }
28
29     signal cancelDownloading();
30
31     Text {
32         id: text
33         text: qsTr("Downloading dictionaries list");
34         anchors.right: parent.right
35         anchors.left: parent.left
36         font.pixelSize: 12
37         horizontalAlignment: Text.AlignHCenter;
38     }
39
40     ProgressBar {
41         id: progressbar1
42         anchors.top: text.bottom
43         anchors.horizontalCenter: parent.horizontalCenter
44         value: -1
45         value2: 30
46     }
47
48     Button {
49         id: button1
50         height: 25;
51         textInButton: qsTr("Cancel");
52         anchors.top: progressbar1.bottom
53         anchors.right: parent.right
54         anchors.left: parent.left
55         onClicked: {
56             rectangle1.cancelDownloading();
57         }
58     }
59
60     Timer {
61         property bool progressMax:true;
62         id:timerUp;
63         interval: 50;
64         running: false;
65         repeat: true
66         onTriggered:{
67             if(progressMax==true){
68                  progressbar1.setValue2(0);
69                  progressMax=false;
70             }
71             else{
72                 progressbar1.setValue2(100);
73                 progressMax=true;
74             }
75         }
76     }
77 }