Initial commit
[ubi] / qml / ubi / StartPage.qml
1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import "UIConstants.js" as Const
3 import "u1.js" as U1
4 import "components"
5
6 Page {
7     id: root
8     title: "Ubi"
9
10     Component.onCompleted: init()
11
12     function init() {
13         if(Utils.isAuthorized()) {
14             //title = "Hi, "+Utils.name();
15         } else {
16             console.log("not authorized!");
17             pageStack.initialPage = "LoginPage.qml";
18         }
19     }
20
21     menu: [
22         [qsTr("About Ubi"),false]
23     ]
24
25     function menuFun(id) {
26         if(id==qsTr("About Ubi")) {
27             dialog.open();
28         }
29     }
30
31     Column {
32         spacing: 10
33         anchors.centerIn: parent
34
35         /*Image {
36             source: "images/cloud.png"
37             width: 150; height: 98
38         }
39
40         Spacer{}
41         Spacer{}
42         Spacer{}
43         Spacer{}*/
44
45         Button {
46             label: qsTr("Files")
47             anchors.horizontalCenter: parent.horizontalCenter
48             onButtonClicked: {
49                 pageStack.push("FilesPage.qml");
50                 pageStack.currentPage.init();
51             }
52         }
53
54         /*Button {
55             label: "Contacts"
56             disabled: true
57         }
58         Button {
59             label: "Notes"
60             disabled: true
61         }*/
62
63         Button {
64             label: qsTr("Account")
65             anchors.horizontalCenter: parent.horizontalCenter
66             onButtonClicked: {
67                 pageStack.push("AccountPage.qml");
68             }
69         }
70         Button {
71             label: qsTr("Settings")
72             anchors.horizontalCenter: parent.horizontalCenter
73             onButtonClicked: pageStack.push("SettingsPage.qml");
74         }
75         /*Button {
76             label: "Test"
77             //onButtonClicked: tip.show("Ala ma kota!")
78             //onButtonClicked: dialog.open()
79             //onButtonClicked: U1.getAccount()
80         }*/
81
82         //Spacer{}
83
84     }
85
86     DialogInfo {
87         id: dialog
88         z: 200
89         fontSize: 28
90         //iconSource: "images/ubi50.png"
91         text: qsTr("<b>Ubi</b> 0.9.1<br/>"
92               +"Ubuntu One client for Maemo 5<br/>"
93               +"<small>Copyright © 2012 Michal Kosciesza</small><br/>")
94         onOpened: mask.state = "dialog"
95         onCanceled: mask.state = "idle"
96     }
97
98
99     Text {
100         anchors.bottom: parent.bottom
101         anchors.bottomMargin: 10
102         anchors.horizontalCenter: parent.horizontalCenter
103         font.pixelSize: 18
104         color: "white"
105         text: "| v0.9.0 beta |"
106     }
107 }