7e2b88c7809ecc7d8dead87e2acfd903d54df348
[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         */
43
44         Spacer{}
45         Spacer{}
46
47         ButtonNew {
48             height: 100; width: 200
49             label: qsTr("Files")
50             anchors.horizontalCenter: parent.horizontalCenter
51             onButtonClicked: {
52                 pageStack.push("FilesPage.qml");
53                 pageStack.currentPage.init();
54             }
55         }
56
57         /*Button {
58             label: "Contacts"
59             disabled: true
60         }
61         Button {
62             label: "Notes"
63             disabled: true
64         }*/
65
66         ButtonNew {
67             height: 100; width: 200
68             label: qsTr("Account")
69             anchors.horizontalCenter: parent.horizontalCenter
70             onButtonClicked: {
71                 pageStack.push("AccountPage.qml");
72             }
73         }
74         ButtonNew {
75             height: 100; width: 200
76             label: qsTr("Settings")
77             anchors.horizontalCenter: parent.horizontalCenter
78             onButtonClicked: pageStack.push("SettingsPage.qml");
79         }
80         /*Button {
81             label: "Test"
82             //onButtonClicked: tip.show("Ala ma kota!")
83             //onButtonClicked: dialog.open()
84             //onButtonClicked: U1.getAccount()
85         }*/
86
87         //Spacer{}
88
89     }
90
91     DialogInfo {
92         id: dialog
93         z: 200
94         fontSize: 28
95         iconSource: "images/ubi50.png"
96         textHeader: qsTr("<b>Ubi</b>")
97
98         text: qsTr("<p>An unofficial Ubuntu One app for Maemo 5 "
99               +"and other Qt-enabled platforms.</p>"
100               +"<p><small>http://ubi.garage.maemo.org</small></p>"
101               +"<p><small>© 2012 Michal Kosciesza</small></p>")
102
103         onOpened: mask.state = "dialog"
104         onCanceled: mask.state = "idle"
105     }
106
107
108     Text {
109         anchors.bottom: parent.bottom
110         anchors.bottomMargin: 10
111         anchors.horizontalCenter: parent.horizontalCenter
112         font.pixelSize: 18
113         color: "white"
114         text: "ver. 0.9.0-2"
115     }
116 }