1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
3 import "UIConstants.js" as Const
5 import "bytesconv.js" as Conv
11 property variant secrets
13 Component.onCompleted: init()
19 secret: Utils.tokenSecret(),
20 consumer_key : Utils.customerKey(),
21 consumer_secret: Utils.customerSecret()
24 U1.getAccount(secrets,root);
27 function onResp(secrets,account)
29 //console.log("onResp");
32 //uid.text = account.id;
33 username.text = account.username;
34 //nick.text = account.nickname;
35 email.text = account.email;
36 storage.text = Conv.bytesToSize(account.total_storage);
38 U1.getRootNode(secrets,root);
41 function onRespRootNode(resp)
43 //console.log("onResp");
45 var ubytes = Conv.bytesToSize(resp.used_bytes);
46 var uprec = Math.round((resp.used_bytes/resp.max_bytes)*100);
47 used.text = ubytes+" ("+uprec+"%)";
50 function onErr(status)
52 //console.log("onErr");
55 tip.show(qsTr("Authorization failed!"));
56 } else if(status==0) {
57 tip.show(qsTr("Unable to connect!"));
59 tip.show(qsTr("Error: ")+status);
67 contentHeight: content.height+Const.SYSTEM_BAR_HEIGHT+Const.TEXT_MARGIN
68 y: Const.SYSTEM_BAR_HEIGHT+Const.TEXT_MARGIN
72 spacing: Const.DEFAULT_MARGIN
85 width: root.width - 6*Const.DEFAULT_MARGIN
90 text: qsTr("User name:")
97 width: root.width - 6*Const.DEFAULT_MARGIN
100 width: root.width-2*Const.TEXT_MARGIN
105 text: qsTr("Nickname:")
112 width: root.width - 6*Const.DEFAULT_MARGIN
124 width: root.width - 6*Const.DEFAULT_MARGIN
127 width: root.width-2*Const.TEXT_MARGIN
132 text: qsTr("Total storage:")
139 width: root.width - 6*Const.DEFAULT_MARGIN
142 width: root.width-2*Const.TEXT_MARGIN
154 width: root.width - 6*Const.DEFAULT_MARGIN