WWW update
[ubi] / qml / ubi / InitPage.qml
index 9803d27..d912d0e 100644 (file)
@@ -13,7 +13,7 @@ Showable {
     function init() {
         if(Utils.isAuthorized()) {
             //title = "Hi, "+Utils.name();
-            //login();
+            login();
         } else {
             pageStack.initialPage = "LoginPage.qml";
             hide();
@@ -21,14 +21,6 @@ Showable {
     }
 
     function login() {
-        /*var secrets = {
-            token: Utils.token(),
-            secret: Utils.tokenSecret(),
-            consumer_key : Utils.customerKey(),
-            consumer_secret: Utils.customerSecret()
-        };
-        U1.getRootNode(secrets,root);
-        */
         pageStack.currentPage.init();
     }
 
@@ -37,12 +29,14 @@ Showable {
     }
 
     function onErr(status) {
-        hide()
         if(status==401) {
+            hide()
             tip.show(qsTr("Ubuntu One authorization has failed. Try once again or check login settings."));
         } else if(status==0) {
-            tip.show(qsTr("Unable to connect. Check internet connection."));
+            hide()
+            tip.show(qsTr("Unable to connect. Check internet connection and restart application."));
         } else {
+            hide()
             tip.show(qsTr("Unknown error: ")+status);
         }
     }
@@ -67,13 +61,10 @@ Showable {
                 source: "images/ubi100.png"
                 width: 104; height: 70
                 anchors.horizontalCenter: parent.horizontalCenter
-                //y: (box.height-height)/3
             }
 
             Text {
                 id: loading
-                //anchors.top: pic.bottom
-                //anchors.margins: Const.TEXT_MARGIN
                 anchors.horizontalCenter: parent.horizontalCenter
                 font.pixelSize: 25
                 color: "white"
@@ -81,19 +72,25 @@ Showable {
             }
 
             BusyIndicator {
-                //anchors.top: loading.bottom
-                //anchors.margins: 2*Const.TEXT_MARGIN
+                id: busy
                 anchors.horizontalCenter: parent.horizontalCenter
                 running: true
             }
         }
 
+        Button {
+            id: close
+            iconSource: "images/close.png"
+            anchors { right: parent.right; top: parent.top; margins: Const.DEFAULT_MARGIN }
+            onButtonClicked: Qt.quit()
+        }
+
         Text {
             anchors.bottom: ver.top
             anchors.horizontalCenter: parent.horizontalCenter
             font.pixelSize: 20
             color: "white"
-            text: "v0.9.3-1 © 2012 Michal Kosciesza"
+            text: "v0.9.4-1 © 2012 Michal Kosciesza"
         }
 
         Text {