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 //nick.text = account.nickname;
36 email.text = account.email;
37 storage.text = Conv.bytesToSize(account.total_storage);
39 U1.getRootNode(secrets,root);
42 function onRespRootNode(resp)
44 //console.log("onResp");
46 var ubytes = Conv.bytesToSize(resp.used_bytes);
47 var uprec = Math.round((resp.used_bytes/resp.max_bytes)*100);
48 used.text = ubytes+" ("+uprec+"%)";
51 function onErr(status)
53 //console.log("onErr");
56 tip.show(qsTr("Ubuntu One authorization has failed. Try once again or check login settings."));
57 } else if(status==0) {
58 tip.show(qsTr("Unable to connect. Check internet connection."));
60 tip.show(qsTr("Unknown error: ")+status);
69 contentHeight: content.height+Const.TOP_BAR_HEIGHT+Const.SYSTEM_BAR_HEIGHT+Const.TEXT_MARGIN
70 y: Const.TOP_BAR_HEIGHT
74 spacing: Const.DEFAULT_MARGIN
87 width: root.width - 6*Const.DEFAULT_MARGIN
92 text: qsTr("User name:")
99 width: root.width - 6*Const.DEFAULT_MARGIN
102 width: root.width-2*Const.TEXT_MARGIN
107 text: qsTr("Nickname:")
114 width: root.width - 6*Const.DEFAULT_MARGIN
126 width: root.width - 6*Const.DEFAULT_MARGIN
129 width: root.width-2*Const.TEXT_MARGIN
134 text: qsTr("Total storage:")
141 width: root.width - 6*Const.DEFAULT_MARGIN
144 width: root.width-2*Const.TEXT_MARGIN
156 width: root.width - 6*Const.DEFAULT_MARGIN
165 menuHeight: menuFixed.height+4*Const.DEFAULT_MARGIN
167 menuDynamic: _menuDyn
169 y: root.height-taskMenu.menuHeight-Const.SYSTEM_BAR_HEIGHT+1*Const.DEFAULT_MARGIN