WWW update
[ubi] / qml / ubi / meego_main.qml
1 import QtQuick 1.1
2 import "components"
3 import "UIConstants.js" as Const
4 import com.nokia.meego 1.0 as Meego
5
6 Meego.PageStackWindow {
7     id: appWindow
8
9     initialPage: mainPage
10     showToolBar: false
11     //showStatusBar: false
12
13     Component.onCompleted: {
14         theme.inverted = true;
15     }
16
17     Meego.Page {
18         id: mainPage
19
20         Rectangle {
21             id: mainWindow
22
23             anchors.fill: parent
24             color: Const.DEFAULT_BACKGROUND_COLOR
25
26             PageStack {
27                 id: pageStack
28                 initialPage: Qt.resolvedUrl("FilesPage.qml")
29             }
30
31             TopBar {
32                 id: topbar
33             }
34
35             NotificationNew {
36                 id: tip
37                 z: 201
38                 anchors.horizontalCenter: mainWindow.horizontalCenter
39                 y: mainWindow.height-height-Const.SYSTEM_BAR_HEIGHT-Const.TEXT_MARGIN
40             }
41
42             Connections {
43                 target: Utils
44                 onFileDownloaded: tip.show(qsTr("File downloaded."))
45                 onFileUploaded: tip.show(qsTr("File uploaded."))
46                 onDownloadError: tip.show(qsTr("Error while downloading."))
47                 onUploadError: tip.show(qsTr("Error while uploading."))
48                 onDownloadAdded: tip.show(qsTr("File added to the queue."))
49                 onUploadAdded: tip.show(qsTr("File added to the queue."))
50                 onOperationCanceled: tip.show(qsTr("File operation canceled."))
51             }
52
53             DialogBlank {
54                 id: downloadDialog
55                 z: 200
56
57                 property bool isActiveDownloads: progressArea.count>0
58
59                 boxHeight: progressArea.height + 3*Const.DEFAULT_MARGIN
60
61                 Connections {
62                     target: Utils
63                     onFileDownloadProgress: progressArea.setProgress(filename,progress)
64                     onFileUploadProgress: progressArea.setProgress(filename,progress)
65                     onDownloadAdded: progressArea.addTask("download",filename)
66                     onUploadAdded: progressArea.addTask("upload",filename)
67                     onDownloadStarted: progressArea.start(filename)
68                     onUploadStarted: progressArea.start(filename)
69                     onFileDownloaded: progressArea.stop(filename)
70                     onFileUploaded: progressArea.stop(filename)
71                     onDownloadError: progressArea.stop(filename)
72                     onUploadError: progressArea.stop(filename)
73                     onOperationCanceled: progressArea.stop(filename)
74                     onFileRemovedFromQuee: progressArea.stop(filename)
75                 }
76
77                 DownloadArea {
78                     anchors.top: parent.box.top
79                     anchors.topMargin: 2*Const.DEFAULT_MARGIN
80                     anchors.margins: Const.DEFAULT_MARGIN
81                     anchors.horizontalCenter: parent.horizontalCenter
82                     id: progressArea
83                     width: parent.width-3*Const.DEFAULT_MARGIN
84                 }
85             }
86
87             DialogInfo {
88                 id: aboutDialog
89                 z: 200
90                 fontSize: 28
91                 iconSource: "images/ubi50.png"
92                 textHeader: qsTr("<b>Ubi</b>")
93
94                 text: qsTr("<p>An unofficial Ubuntu One app for Maemo/Meego "
95                       +"and other Qt-enabled platforms.</p>"
96                       +"<p><small>http://ubi.garage.maemo.org</small></p>"
97                       +"<p><small>© 2012 Michal Kosciesza</small></p>")
98             }
99
100             SystemBar {
101                 id: systemBar
102                 z: 201
103                 onClickedOnMask: {
104                     aboutDialog.close();
105                     downloadDialog.close();
106                     pageStack.currentPage.taskMenu.close();
107                 }
108             }
109
110             Rectangle {
111                 color: "black"
112                 z: 300
113                 width: 1
114                 anchors.left: parent.left
115                 anchors.top: parent.top
116                 anchors.bottom: parent.bottom
117             }
118
119             InitPage {
120                 id: initPage
121                 z: 301
122                 height: mainWindow.height;
123                 width: mainWindow.width;
124             }
125         }
126
127     }
128 }