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
12 property alias taskMenu: taskMenu
14 Component.onCompleted: init()
20 secret: Utils.tokenSecret(),
21 consumer_key : Utils.customerKey(),
22 consumer_secret: Utils.customerSecret()
25 U1.getAccount(secrets,root);
28 function onResp(secrets,account)
30 //console.log("onResp");
33 //uid.text = account.id;
34 username.text = account.username;
35 //username.text = "Molly";
37 //nick.text = account.nickname;
39 email.text = account.email;
40 //email.text = "molly@ponny.eu";
41 storage.text = Conv.bytesToSize(account.total_storage);
43 U1.getRootNode(secrets,root);
46 function onRespRootNode(resp)
48 //console.log("onResp");
50 var ubytes = Conv.bytesToSize(resp.used_bytes);
51 var uprec = Math.round((resp.used_bytes/resp.max_bytes)*100);
52 used.text = ubytes+" ("+uprec+"%)";
55 function onErr(status)
57 //console.log("onErr");
60 tip.show(qsTr("Ubuntu One authorization has failed. Try once again or check login settings."));
61 } else if(status==0) {
62 tip.show(qsTr("Unable to connect. Check internet connection."));
64 tip.show(qsTr("Unknown error: ")+status);
73 contentHeight: content.height+Const.TOP_BAR_HEIGHT+Const.SYSTEM_BAR_HEIGHT+Const.TEXT_MARGIN
74 y: Const.TOP_BAR_HEIGHT
78 spacing: Const.DEFAULT_MARGIN
91 width: root.width - 6*Const.DEFAULT_MARGIN
96 text: qsTr("User name:")
103 width: root.width - 6*Const.DEFAULT_MARGIN
106 width: root.width-2*Const.TEXT_MARGIN
111 text: qsTr("Nickname:")
118 width: root.width - 6*Const.DEFAULT_MARGIN
130 width: root.width - 6*Const.DEFAULT_MARGIN
133 width: root.width-2*Const.TEXT_MARGIN
138 text: qsTr("Total storage:")
145 width: root.width - 6*Const.DEFAULT_MARGIN
148 width: root.width-2*Const.TEXT_MARGIN
160 width: root.width - 6*Const.DEFAULT_MARGIN
169 menuHeight: menuFixed.height+4*Const.DEFAULT_MARGIN
171 menuDynamic: _menuDyn
173 y: root.height-taskMenu.menuHeight-Const.SYSTEM_BAR_HEIGHT+1*Const.DEFAULT_MARGIN