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