Merge lp:ubuntu-facebook-app into lp:~kedazo/ubuntu-facebook-app/ci-fix
- trunk
- Merge into ci-fix
Status: | Needs review |
---|---|
Proposed branch: | lp:ubuntu-facebook-app |
Merge into: | lp:~kedazo/ubuntu-facebook-app/ci-fix |
Diff against target: |
1500 lines (+812/-130) (has conflicts) 34 files modified
.bzr-builddeb/default.conf (+2/-0) .bzrignore (+7/-0) AuthModel.qml (+1/-0) CommentsPanel.qml (+236/-0) LoginPopup.qml (+4/-2) NewsPage.qml (+72/-66) StatusUpdatePopup.qml (+138/-0) ThreadView.qml (+132/-0) artwork/PageHeaderBaseDivider@18.sci (+5/-0) artwork/PageHeaderBaseDividerLight@18.sci (+5/-0) artwork/TabLeftSelected@8.sci (+7/-0) artwork/TabLeftUnselected@8.sci (+7/-0) artwork/TabMiddleSelected@8.sci (+7/-0) artwork/TabMiddleUnselected@8.sci (+7/-0) artwork/TabRightSelected@8.sci (+7/-0) artwork/TabRightUnselected@8.sci (+7/-0) artwork/ubuntushape_medium_radius_idle@18.sci (+5/-0) artwork/ubuntushape_medium_radius_pressed@18.sci (+5/-0) artwork/ubuntushape_medium_radius_shape@18.sci (+5/-0) artwork/ubuntushape_small_radius_idle@18.sci (+5/-0) artwork/ubuntushape_small_radius_pressed@18.sci (+5/-0) artwork/ubuntushape_small_radius_shape@18.sci (+5/-0) auth.js (+18/-13) debian/compat (+1/-1) debian/control (+7/-6) debian/copyright (+5/-5) debian/rules (+3/-21) debian/source/format (+1/-1) debian/ubuntu-facebook-app.install (+4/-3) facebook.js (+49/-0) facebook.qmlproject (+1/-1) ubuntu-facebook-app (+1/-1) ubuntu-facebook-app.desktop (+1/-1) ubuntu-facebook-app.qml (+47/-9) Contents conflict in facebook.qmlproject.user |
To merge this branch: | bzr merge lp:ubuntu-facebook-app |
Related bugs: | |
Related blueprints: |
Facebook application implementation
(Undefined)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Kedves | Pending | ||
Review via email: mp+157220@code.launchpad.net |
Commit message
Description of the change
Dropped the shldibdeps, as there are no binaries in the package.
- 3. By Michael Hall
-
Updates packaging and icon for a better install.
Approved by Hugo Miguel Barbarrica Rodrigues Lima, Ubuntu Phone Apps Jenkins Bot.
- 4. By Hugo Miguel Barbarrica Rodrigues Lima
-
Initial version with login and news feed.
Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 5. By Hugo Miguel Barbarrica Rodrigues Lima
-
Initial development:
- List comments and likes
- Post a comment
- Like / Unlike post.Approved by Michael Hall, Ubuntu Phone Apps Jenkins Bot.
- 6. By Riccardo Padovani
-
Fix #1173261. Fixes: https:/
/bugs.launchpad .net/bugs/ 1173261. Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 7. By Florian Boucault
-
Remove use of theming because the theming infrastructure in the toolkit is going to change drastically.
The theme was copied over almost entirely from the toolkit which should not be done. There was however one significant difference: the header background and height were customized. That capability might be introduced differently in the future. For now no custom header unfortunately.
Approved by Ubuntu Phone Apps Jenkins Bot, Hugo Miguel Barbarrica Rodrigues Lima.
- 8. By Robert Bruce Park
-
Stop using deprecated image://gicon.
Unmerged revisions
- 8. By Robert Bruce Park
-
Stop using deprecated image://gicon.
- 7. By Florian Boucault
-
Remove use of theming because the theming infrastructure in the toolkit is going to change drastically.
The theme was copied over almost entirely from the toolkit which should not be done. There was however one significant difference: the header background and height were customized. That capability might be introduced differently in the future. For now no custom header unfortunately.
Approved by Ubuntu Phone Apps Jenkins Bot, Hugo Miguel Barbarrica Rodrigues Lima.
- 6. By Riccardo Padovani
-
Fix #1173261. Fixes: https:/
/bugs.launchpad .net/bugs/ 1173261. Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 5. By Hugo Miguel Barbarrica Rodrigues Lima
-
Initial development:
- List comments and likes
- Post a comment
- Like / Unlike post.Approved by Michael Hall, Ubuntu Phone Apps Jenkins Bot.
- 4. By Hugo Miguel Barbarrica Rodrigues Lima
-
Initial version with login and news feed.
Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 3. By Michael Hall
-
Updates packaging and icon for a better install.
Approved by Hugo Miguel Barbarrica Rodrigues Lima, Ubuntu Phone Apps Jenkins Bot.
Preview Diff
1 | === added directory '.bzr-builddeb' |
2 | === added file '.bzr-builddeb/default.conf' |
3 | --- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000 |
4 | +++ .bzr-builddeb/default.conf 2013-09-09 19:09:28 +0000 |
5 | @@ -0,0 +1,2 @@ |
6 | +[BUILDDEB] |
7 | +split = True |
8 | |
9 | === added file '.bzrignore' |
10 | --- .bzrignore 1970-01-01 00:00:00 +0000 |
11 | +++ .bzrignore 2013-09-09 19:09:28 +0000 |
12 | @@ -0,0 +1,7 @@ |
13 | +*.qmlproject.user |
14 | +*.~*~ |
15 | + |
16 | +debian/files |
17 | +debian/app-template/ |
18 | +debian/*.debhelper.log |
19 | +debian/*.substvars |
20 | |
21 | === modified file 'AuthModel.qml' |
22 | --- AuthModel.qml 2013-03-30 01:52:44 +0000 |
23 | +++ AuthModel.qml 2013-09-09 19:09:28 +0000 |
24 | @@ -1,6 +1,7 @@ |
25 | import QtQuick 2.0 |
26 | import QtQuick.LocalStorage 2.0 |
27 | import Ubuntu.OnlineAccounts 0.1 |
28 | +import "facebook.js" as FacebookFuncs |
29 | import "auth.js" as AuthFuncs |
30 | |
31 | Item { |
32 | |
33 | === added file 'CommentsPanel.qml' |
34 | --- CommentsPanel.qml 1970-01-01 00:00:00 +0000 |
35 | +++ CommentsPanel.qml 2013-09-09 19:09:28 +0000 |
36 | @@ -0,0 +1,236 @@ |
37 | +import QtQuick 2.0 |
38 | +import Ubuntu.Components 0.1 |
39 | +import Ubuntu.Components.ListItems 0.1 |
40 | +import Friends 0.1 |
41 | +import "facebook.js" as FacebookFuncs |
42 | + |
43 | +Rectangle { |
44 | + color: "#F6F7F8" |
45 | + height: likeLabels.height + replyPanel.height + units.gu(2) |
46 | + |
47 | + property int commentsCountProp |
48 | + property bool liked: column_13 |
49 | + |
50 | + FriendsDispatcher { |
51 | + id: friends |
52 | + onSendComplete: { |
53 | + if (success) { |
54 | + commentField.text = ''; |
55 | + console.log ("Send completed successfully"); |
56 | + } else { |
57 | + console.log ("Send failed: " + errorMessage); |
58 | + } |
59 | + commentField.enabled = true; |
60 | + postButton.enabled = true; |
61 | + loadingIndicator.visible = false; |
62 | + } |
63 | + |
64 | + onLikeComplete: { |
65 | + if (success) { |
66 | + liked = true; |
67 | + } else { |
68 | + console.log ("Like failed: " + errorMessage); |
69 | + } |
70 | + likeLinkMouseArea.enabled = true; |
71 | + likeLink.color = "#7CA1E4"; |
72 | + } |
73 | + onUnlikeComplete: { |
74 | + if (success) { |
75 | + liked = false; |
76 | + } else { |
77 | + console.log ("UnLike failed: " + errorMessage); |
78 | + } |
79 | + likeLinkMouseArea.enabled = true; |
80 | + likeLink.color = "#7CA1E4"; |
81 | + } |
82 | + |
83 | + } |
84 | + |
85 | + Row { |
86 | + id: likeLabels |
87 | + anchors.left: parent.left |
88 | + anchors.top: parent.top |
89 | + spacing: units.gu(1) |
90 | + anchors.leftMargin: units.gu(1) |
91 | + anchors.topMargin: units.gu(1) |
92 | + |
93 | + Label { |
94 | + id: likeLink |
95 | + text: (liked?"Unlike":"Like") |
96 | + color: "#7CA1E4" |
97 | + MouseArea { |
98 | + id: likeLinkMouseArea |
99 | + anchors.top: parent.top |
100 | + anchors.left: parent.left |
101 | + anchors.right: parent.right |
102 | + height: likeLabels.height + units.gu(1) |
103 | + |
104 | + onClicked: { |
105 | + likeLinkMouseArea.enabled = false; |
106 | + likeLink.color = "#A6A7A8"; |
107 | + if (liked) { |
108 | + friends.unlikeAsync(accountId, postMessageId); |
109 | + console.log('unlike accountId:' + accountId + ', messageId' + postMessageId); |
110 | + } |
111 | + else { |
112 | + friends.likeAsync(accountId, postMessageId); |
113 | + console.log('like accountId:' + accountId + ', messageId' + postMessageId); |
114 | + } |
115 | + } |
116 | + } |
117 | + } |
118 | + |
119 | + Label { |
120 | + text: "-" |
121 | + } |
122 | + |
123 | + Label { |
124 | + text: "Comment" |
125 | + color: "#7CA1E4" |
126 | + MouseArea { |
127 | + anchors.top: parent.top |
128 | + anchors.left: parent.left |
129 | + anchors.right: parent.right |
130 | + height: likeLabels.height + units.gu(1) |
131 | + |
132 | + onClicked: openReplyPanel() |
133 | + } |
134 | + } |
135 | + } |
136 | + |
137 | + Row { |
138 | + anchors.right: parent.right |
139 | + anchors.top: parent.top |
140 | + anchors.rightMargin: units.gu(1) |
141 | + anchors.topMargin: units.gu(1) |
142 | + |
143 | + spacing: units.gu(1) |
144 | + |
145 | + Row { |
146 | + visible: (postLikes > 0) |
147 | + Image { |
148 | + source: Qt.resolvedUrl("images/like.png") |
149 | + } |
150 | + |
151 | + Label { |
152 | + text: postLikes |
153 | + } |
154 | + } |
155 | + |
156 | + |
157 | + Row { |
158 | + id: commentsCountWidget |
159 | + visible: false |
160 | + |
161 | + Image { |
162 | + source: Qt.resolvedUrl("images/comment.png") |
163 | + } |
164 | + |
165 | + Label { |
166 | + text: commentsCountProp |
167 | + } |
168 | + } |
169 | + } |
170 | + |
171 | + |
172 | + Item { |
173 | + anchors.top: likeLabels.bottom |
174 | + anchors.left: parent.left |
175 | + anchors.right: parent.right |
176 | + id: replyPanel |
177 | + visible: false |
178 | + height: (visible?childrenRect.height+units.gu(1):0) |
179 | + |
180 | + TextArea { |
181 | + id: commentField |
182 | + anchors.top: parent.top |
183 | + anchors.topMargin: units.gu(1) |
184 | + anchors.left: parent.left |
185 | + anchors.leftMargin: units.gu(1) |
186 | + anchors.right: postButton.left |
187 | + anchors.rightMargin: units.gu(1) |
188 | + placeholderText: "Write a comment" |
189 | + font.pixelSize: FontUtils.sizeToPixels("medium") |
190 | + font.family: "Ubuntu" |
191 | + Keys.onReturnPressed: postButton.clicked(null) |
192 | + Keys.onEscapePressed: text = "" |
193 | + autoSize: true |
194 | + maximumLineCount: 0 |
195 | + } |
196 | + |
197 | + Button { |
198 | + id: postButton |
199 | + anchors.top: parent.top |
200 | + anchors.topMargin: units.gu(1) |
201 | + anchors.right: parent.right |
202 | + anchors.rightMargin: units.gu(1) |
203 | + text: "Post" |
204 | + |
205 | + onClicked: { |
206 | + console.log ("Reply to " + postMessageId + " from " + accountId + ": " + commentField.text); |
207 | + loadingIndicator.visible = true |
208 | + postButton.enabled = false |
209 | + commentField.enabled = false |
210 | + friends.sendReplyAsync(accountId, postMessageId, commentField.text); |
211 | + } |
212 | + } |
213 | + |
214 | + Item { |
215 | + id: loadingIndicator |
216 | + visible: true |
217 | + anchors.top: commentField.bottom |
218 | + anchors.left: parent.left |
219 | + anchors.leftMargin: units.gu(1) |
220 | + anchors.right: parent.right |
221 | + anchors.rightMargin: units.gu(1) |
222 | + height: units.gu(8) |
223 | + |
224 | + ActivityIndicator { |
225 | + anchors.centerIn: parent |
226 | + running: visible |
227 | + } |
228 | + } |
229 | + |
230 | + Loader { |
231 | + id: threadView |
232 | + anchors.top: commentField.bottom |
233 | + anchors.left: parent.left |
234 | + anchors.leftMargin: units.gu(1) |
235 | + anchors.right: parent.right |
236 | + anchors.rightMargin: units.gu(1) |
237 | + |
238 | + property alias loadingIndicator: loadingIndicator |
239 | + |
240 | + source: (replyPanel.visible?'ThreadView.qml':'') |
241 | + } |
242 | + } |
243 | + |
244 | + MouseArea { |
245 | + anchors.top: parent.top |
246 | + anchors.left: likeLabels.right |
247 | + anchors.right: parent.right |
248 | + height: likeLabels.height + units.gu(1) |
249 | + |
250 | + onClicked: openReplyPanel() |
251 | + } |
252 | + |
253 | + Component.onCompleted: { |
254 | + console.log('CommentsPanel loaded'); |
255 | + console.log('PostMessageId:'+postMessageId); |
256 | + FacebookFuncs.getCommentCount(token, postMessageId).done(function(commentsCount) { |
257 | + console.log('FacebookFuncs.getCommentCount:'+commentsCount); |
258 | + if (commentsCount>0) { |
259 | + commentsCountWidget.visible=true; |
260 | + commentsCountProp=commentsCount; |
261 | + } |
262 | + }).fail(function(e) { |
263 | + console.log('FacebookFuncs.getCommentCount:'+e); |
264 | + }); |
265 | + } |
266 | + |
267 | + function openReplyPanel() { |
268 | + replyPanel.visible = ! replyPanel.visible; |
269 | + if (replyPanel.visible) |
270 | + loadingIndicator.visible=true; |
271 | + } |
272 | +} |
273 | |
274 | === modified file 'LoginPopup.qml' |
275 | --- LoginPopup.qml 2013-03-30 01:52:44 +0000 |
276 | +++ LoginPopup.qml 2013-09-09 19:09:28 +0000 |
277 | @@ -42,7 +42,9 @@ |
278 | title: "Facebook login" |
279 | doneButton: true |
280 | anchors.fill: parent |
281 | - contentsWidth: units.gu(45) |
282 | + |
283 | + contentsWidth: facebookMainView.width |
284 | + contentsHeight: facebookMainView.height |
285 | |
286 | Component.onCompleted: { |
287 | __rightButton.visible = false; |
288 | @@ -78,7 +80,7 @@ |
289 | } |
290 | ListItem.Standard { |
291 | text: displayName |
292 | - icon: "image://gicon/"+accts.provider.iconName |
293 | + icon: "image://theme/"+accts.provider.iconName |
294 | |
295 | onClicked: { |
296 | if (accountsModel.count>0) { |
297 | |
298 | === modified file 'NewsPage.qml' |
299 | --- NewsPage.qml 2013-04-04 11:16:17 +0000 |
300 | +++ NewsPage.qml 2013-09-09 19:09:28 +0000 |
301 | @@ -2,11 +2,13 @@ |
302 | import Ubuntu.Components 0.1 |
303 | import Ubuntu.Components.ListItems 0.1 |
304 | import Friends 0.1 |
305 | +import "facebook.js" as FacebookFuncs |
306 | |
307 | Page { |
308 | id: newsPage |
309 | |
310 | - property int accountId: -1 |
311 | + property int accountId: facebookMainView.accountId |
312 | + property string token: facebookMainView.token |
313 | |
314 | FriendsUtils { |
315 | id: friendsUtils |
316 | @@ -19,6 +21,9 @@ |
317 | ListView { |
318 | id: listView |
319 | anchors.fill: parent |
320 | + anchors.leftMargin: units.gu(1) |
321 | + anchors.rightMargin: units.gu(1) |
322 | + |
323 | cacheBuffer: parent.height |
324 | opacity: 0.0 |
325 | |
326 | @@ -26,24 +31,33 @@ |
327 | account: newsPage.accountId |
328 | } |
329 | |
330 | - delegate: Item { |
331 | + delegate: Rectangle { |
332 | id: tile |
333 | - height: newsItem.height + actionsBar.height + units.gu(3) |
334 | + height: childrenRect.height |
335 | width: parent.width |
336 | - anchors { |
337 | - margins: units.gu(1) |
338 | - } |
339 | - |
340 | - /**************************************** |
341 | - Columns name / id |
342 | - |
343 | - sender name = 4 or 6 ? |
344 | - message = 9 |
345 | - data/time = 8 |
346 | - avatar image (cached file) = 10 |
347 | - shared image comment = 18 |
348 | - shared image uri = 14 |
349 | - *****************************************/ |
350 | + color: "#FFFFFF" |
351 | + |
352 | + property string postService: column_0 |
353 | + property string postAccountId: column_1 |
354 | + property string postMessageId: column_2 |
355 | + property string postStream: column_3 |
356 | + property string postSender: column_4 |
357 | + property bool postFromMe: column_7 |
358 | + property string postTimeString: friendsUtils.createTimeString(column_8) |
359 | + property string postMessage: column_9 |
360 | + property string postAvatar: column_10 |
361 | + property string postUrl: column_11 |
362 | + property int postLikes: column_12 > 0 ? column_12 : postLiked ? 1 : 0 |
363 | + property bool postLiked: column_13 |
364 | + property string postLinkPicture: column_14 |
365 | + property string postLinkName: column_15 |
366 | + property string postLLinkUrl: column_16 |
367 | + property string postDesc: column_17 |
368 | + property string postLinkCaption: column_18 |
369 | + property string postLinkIcon: column_19 |
370 | + property string postLocation: column_20 |
371 | + property string postLatitude: column_21 |
372 | + property string postLongitude: column_22 |
373 | |
374 | UbuntuShape { |
375 | id: avatarImage |
376 | @@ -54,11 +68,11 @@ |
377 | left: parent.left |
378 | top: parent.top |
379 | leftMargin: units.gu(1) |
380 | - topMargin: units.gu(1) |
381 | + topMargin: units.gu(3) |
382 | } |
383 | image: Image { |
384 | anchors.fill: parent |
385 | - source: Qt.resolvedUrl(column_10) |
386 | + source: Qt.resolvedUrl(postAvatar) |
387 | asynchronous: true |
388 | fillMode: Image.PreserveAspectFit |
389 | } |
390 | @@ -66,17 +80,22 @@ |
391 | |
392 | Item { |
393 | id: newsItem |
394 | + |
395 | anchors { |
396 | left: avatarImage.right |
397 | right: parent.right |
398 | top: parent.top |
399 | - topMargin: units.gu(1) |
400 | + topMargin: units.gu(3) |
401 | leftMargin: units.gu(1) |
402 | bottomMargin: units.gu(1) |
403 | rightMargin: units.gu(1) |
404 | } |
405 | + |
406 | height: childrenRect.height + units.gu(2) |
407 | + |
408 | Column { |
409 | + id: messageColumn |
410 | + |
411 | spacing: units.gu(1) |
412 | anchors { |
413 | left: parent.left; |
414 | @@ -85,7 +104,7 @@ |
415 | } |
416 | Label { |
417 | id: senderName |
418 | - text: column_4 |
419 | + text: postSender |
420 | fontSize: "medium" |
421 | font.bold: true |
422 | font.family: "Ubuntu" |
423 | @@ -94,31 +113,24 @@ |
424 | |
425 | Label { |
426 | id: message |
427 | - text: column_9 |
428 | - onLinkActivated: Qt.openUrlExternally(link) |
429 | - wrapMode: Text.WrapAtWordBoundaryOrAnywhere |
430 | - width: parent.width - units.gu(3) |
431 | - font.family: "Ubuntu" |
432 | - } |
433 | - |
434 | - Image { |
435 | - source: Qt.resolvedUrl(column_14) |
436 | - asynchronous: true |
437 | - fillMode: Image.PreserveAspectFit |
438 | - width: (implicitWidth<parent.width - units.gu(3)?implicitWidth:parent.width - units.gu(3)) |
439 | - } |
440 | - |
441 | - Label { |
442 | - id: imageComment |
443 | - color: "#a0a0a0" |
444 | - width: parent.width - units.gu(3) |
445 | - wrapMode: Text.WrapAtWordBoundaryOrAnywhere |
446 | - text: decorateLinks(column_18) |
447 | - onLinkActivated: Qt.openUrlExternally(link) |
448 | - fontSize: "small" |
449 | - font.family: "Ubuntu" |
450 | - } |
451 | - } |
452 | + text: postMessage |
453 | + onLinkActivated: Qt.openUrlExternally(link) |
454 | + wrapMode: Text.WrapAtWordBoundaryOrAnywhere |
455 | + width: parent.width - units.gu(3) |
456 | + font.family: "Ubuntu" |
457 | + } |
458 | + } |
459 | + |
460 | + Image { |
461 | + source: Qt.resolvedUrl(postLinkPicture.replace("_s.jpg", "_b.jpg")) |
462 | + asynchronous: true |
463 | + fillMode: Image.PreserveAspectCrop |
464 | + width: tile.width + units.gu(2) |
465 | + height: (tile.width + units.gu(2)) * (implicitHeight/implicitWidth) |
466 | + x: 0 - newsItem.x - units.gu(1) |
467 | + y: messageColumn.height + units.gu(2) |
468 | + } |
469 | + |
470 | Row { |
471 | anchors.right: parent.right |
472 | anchors.rightMargin: units.gu(1) |
473 | @@ -127,40 +139,32 @@ |
474 | |
475 | Label { |
476 | id: time |
477 | - text: friendsUtils.createTimeString(column_8) |
478 | + text: friendsUtils.createTimeString(postTimeString) |
479 | fontSize: "small" |
480 | font.family: "Ubuntu" |
481 | } |
482 | } |
483 | } |
484 | |
485 | - Row { |
486 | + |
487 | + |
488 | + Loader { |
489 | id: actionsBar |
490 | - |
491 | anchors.top: newsItem.bottom |
492 | anchors.left: parent.left |
493 | anchors.right: parent.right |
494 | - anchors.leftMargin: units.gu(1) |
495 | - spacing: units.gu(1) |
496 | - |
497 | - Button { |
498 | - width: parent.width * 0.31 |
499 | - text: "like" |
500 | - } |
501 | - |
502 | - Button { |
503 | - width: parent.width * 0.31 |
504 | - text: "comment" |
505 | - } |
506 | - |
507 | - Button { |
508 | - width: parent.width * 0.31 |
509 | - text: "share" |
510 | - } |
511 | + property int postLikes: (column_12 > 0 ? column_12 : column_13 ? 1 : 0) |
512 | + property string postMessageId: column_2 |
513 | + property string token: newsPage.token |
514 | + |
515 | + visible: (index > listView.indexAt(listView.contentX, listView.contentY)-4) && (index < listView.indexAt(listView.contentX, listView.contentY)+4) |
516 | + source: (visible?'CommentsPanel.qml':'') |
517 | } |
518 | |
519 | + |
520 | ThinDivider { |
521 | id: divider |
522 | + height: units.gu(2) |
523 | } |
524 | } |
525 | } |
526 | @@ -189,8 +193,10 @@ |
527 | } |
528 | |
529 | function jumpToTop () { |
530 | + /* |
531 | listView.currentIndex = listView.count-1; |
532 | listView.positionViewAtIndex(listView.currentIndex, ListView.Beginning); |
533 | + */ |
534 | } |
535 | |
536 | function decorateLinks(message) { |
537 | |
538 | === added file 'StatusUpdatePopup.qml' |
539 | --- StatusUpdatePopup.qml 1970-01-01 00:00:00 +0000 |
540 | +++ StatusUpdatePopup.qml 2013-09-09 19:09:28 +0000 |
541 | @@ -0,0 +1,138 @@ |
542 | +/* |
543 | + * Copyright 2013 Canonical Ltd. |
544 | + * |
545 | + * |
546 | + * This program is free software; you can redistribute it and/or modify |
547 | + * it under the terms of the GNU Lesser General Public License as published by |
548 | + * the Free Software Foundation; version 3. |
549 | + * |
550 | + * This program is distributed in the hope that it will be useful, |
551 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
552 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
553 | + * GNU Lesser General Public License for more details. |
554 | + * |
555 | + * You should have received a copy of the GNU Lesser General Public License |
556 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
557 | + */ |
558 | + |
559 | +import QtQuick 2.0 |
560 | +import Ubuntu.Components 0.1 |
561 | +import Ubuntu.Components.ListItems 0.1 as ListItem |
562 | +import Friends 0.1 |
563 | +import Ubuntu.Components.Popups 0.1 |
564 | +import "facebook.js" as FacebookFuncs |
565 | + |
566 | +Item { |
567 | + id: statusPopup |
568 | + |
569 | + property int accountId: facebookMainView.accountId |
570 | + property string token: facebookMainView.token |
571 | + |
572 | + FriendsDispatcher { |
573 | + id: friends |
574 | + |
575 | + onSendComplete: { |
576 | + if (success) { |
577 | + activitySpinner.visible = false; |
578 | + entryArea.text = ""; |
579 | + console.log ("Send completed successfully"); |
580 | + statusSheet.hide() |
581 | + } else { |
582 | + activitySpinner.visible = false; |
583 | + console.log ("Send failed: " + errorMessage); |
584 | + } |
585 | + } |
586 | + } |
587 | + |
588 | + Component { |
589 | + id: statusComponent |
590 | + |
591 | + ComposerSheet { |
592 | + id: statusSheet |
593 | + title: "Write Post" |
594 | + |
595 | + anchors.fill: parent |
596 | + |
597 | + contentsWidth: facebookMainView.width |
598 | + contentsHeight: facebookMainView.height |
599 | + |
600 | + onConfirmClicked: { |
601 | + activitySpinner.visible = true |
602 | + friends.sendForAccountAsync(accountId, postField.text); |
603 | + } |
604 | + |
605 | + Item { |
606 | + width: parent.width |
607 | + height: parent.height |
608 | + |
609 | + UbuntuShape { |
610 | + id: avatarImage |
611 | + radius: "medium" |
612 | + height: units.dp(48) |
613 | + width: units.dp(48) |
614 | + |
615 | + anchors { |
616 | + left: parent.left |
617 | + top: parent.top |
618 | + leftMargin: units.gu(1) |
619 | + topMargin: units.gu(1) |
620 | + } |
621 | + |
622 | + image: Image { |
623 | + anchors.fill: parent |
624 | + source: FacebookFuncs.getProfilePictureUrl(token) |
625 | + asynchronous: true |
626 | + fillMode: Image.PreserveAspectFit |
627 | + } |
628 | + } |
629 | + |
630 | + TextArea { |
631 | + id: postField |
632 | + |
633 | + anchors { |
634 | + top: parent.top |
635 | + topMargin: units.gu(1) |
636 | + left: avatarImage.right |
637 | + leftMargin: units.gu(1) |
638 | + right: parent.right |
639 | + rightMargin: units.gu(1) |
640 | + } |
641 | + |
642 | + placeholderText: "What's on your mind?" |
643 | + font.pixelSize: FontUtils.sizeToPixels("medium") |
644 | + font.family: "Ubuntu" |
645 | + autoSize: true |
646 | + maximumLineCount: 0 |
647 | + } |
648 | + |
649 | + ActivityIndicator { |
650 | + id: activitySpinner |
651 | + anchors.centerIn: postField |
652 | + visible: false |
653 | + running: visible |
654 | + } |
655 | + |
656 | + } |
657 | + |
658 | + Component.onCompleted: { |
659 | + } |
660 | + } |
661 | + } |
662 | + |
663 | + Timer { |
664 | + id: initTimer |
665 | + interval: 500 |
666 | + repeat: false |
667 | + triggeredOnStart: false |
668 | + running: false |
669 | + |
670 | + onTriggered: { |
671 | + PopupUtils.open(statusComponent); |
672 | + console.log("StatusUpdatePopup.open") |
673 | + } |
674 | + } |
675 | + |
676 | + function open() { |
677 | + initTimer.start(); |
678 | + } |
679 | +} |
680 | |
681 | === added file 'ThreadView.qml' |
682 | --- ThreadView.qml 1970-01-01 00:00:00 +0000 |
683 | +++ ThreadView.qml 2013-09-09 19:09:28 +0000 |
684 | @@ -0,0 +1,132 @@ |
685 | +import QtQuick 2.0 |
686 | +import Ubuntu.Components 0.1 |
687 | +import Friends 0.1 |
688 | + |
689 | +Item { |
690 | + id: threadView |
691 | + height: threadListView.height |
692 | + |
693 | + property int commentsCount: 0 |
694 | + |
695 | + StreamModel { |
696 | + id: streamModel |
697 | + stream: "reply_to/"+postMessageId |
698 | + } |
699 | + |
700 | + |
701 | + FriendsUtils { |
702 | + id: friendsUtils |
703 | + } |
704 | + |
705 | + Column { |
706 | + id: threadListView |
707 | + width: parent.width |
708 | + Repeater { |
709 | + width: parent.width |
710 | + model: streamModel |
711 | + delegate: Item { |
712 | + id: threadItem |
713 | + width: parent.width |
714 | + anchors { |
715 | + left: parent.left |
716 | + bottomMargin: units.gu(2) |
717 | + } |
718 | + height: status_update_content.height |
719 | + |
720 | + UbuntuShape { |
721 | + id: avatarImage |
722 | + radius: "small" |
723 | + height: units.dp(32) |
724 | + width: units.dp(32) |
725 | + anchors { |
726 | + left: parent.left |
727 | + top: parent.top |
728 | + leftMargin: units.gu(1) |
729 | + topMargin: units.gu(1) |
730 | + } |
731 | + image: Image { |
732 | + source: Qt.resolvedUrl(column_10) |
733 | + asynchronous: true |
734 | + fillMode: Image.PreserveAspectFit |
735 | + } |
736 | + } |
737 | + |
738 | + Item { |
739 | + id: status_update_content |
740 | + anchors { |
741 | + left: avatarImage.right |
742 | + right: parent.right |
743 | + top: parent.top |
744 | + topMargin: units.gu(1) |
745 | + leftMargin: units.gu(1) |
746 | + bottomMargin: units.gu(1) |
747 | + rightMargin: units.gu(1) |
748 | + } |
749 | + width: parent.width - avatarImage.width |
750 | + height: childrenRect.height + units.gu(1) |
751 | + |
752 | + Column { |
753 | + width: parent.width |
754 | + spacing: 0 |
755 | + anchors { |
756 | + left: parent.left; |
757 | + right: parent.right |
758 | + bottomMargin: units.gu(2) |
759 | + } |
760 | + Label { |
761 | + text: column_4 |
762 | + fontSize: "small" |
763 | + font.bold: true |
764 | + width: parent.width |
765 | + } |
766 | + Label { |
767 | + id: messageText |
768 | + text: column_9 |
769 | + wrapMode: Text.WrapAtWordBoundaryOrAnywhere |
770 | + width: parent.width - units.gu(3) |
771 | + fontSize: "small" |
772 | + onLinkActivated: { |
773 | + console.log(link + " link activated"); |
774 | + Qt.openUrlExternally(link); |
775 | + } |
776 | + } |
777 | + } |
778 | + Row { |
779 | + anchors.right: parent.right |
780 | + anchors.rightMargin: units.gu(1) |
781 | + anchors.top: parent.top |
782 | + spacing: units.gu(1) |
783 | + |
784 | + Text { |
785 | + id: time |
786 | + text: friendsUtils.createTimeString(column_8) |
787 | + font.family: "Ubuntu" |
788 | + font.pointSize: 8 |
789 | + color: "gray" |
790 | + } |
791 | + } |
792 | + } |
793 | + } |
794 | + } |
795 | + } |
796 | + |
797 | + Timer { |
798 | + id: waitTimer |
799 | + interval: 500 |
800 | + repeat: true |
801 | + triggeredOnStart: false |
802 | + running: false |
803 | + onTriggered: { |
804 | + if (commentsCount !== streamModel.count) |
805 | + commentsCount=streamModel.count; |
806 | + else { |
807 | + waitTimer.stop() |
808 | + loadingIndicator.visible = false; |
809 | + } |
810 | + } |
811 | + } |
812 | + |
813 | + Component.onCompleted: { |
814 | + waitTimer.start() |
815 | + } |
816 | +} |
817 | |
818 | === added directory 'artwork' |
819 | === added file 'artwork/CheckMark@18.png' |
820 | Binary files artwork/CheckMark@18.png 1970-01-01 00:00:00 +0000 and artwork/CheckMark@18.png 2013-09-09 19:09:28 +0000 differ |
821 | === added file 'artwork/Cross@18.png' |
822 | Binary files artwork/Cross@18.png 1970-01-01 00:00:00 +0000 and artwork/Cross@18.png 2013-09-09 19:09:28 +0000 differ |
823 | === added file 'artwork/DownArrow@18.png' |
824 | Binary files artwork/DownArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/DownArrow@18.png 2013-09-09 19:09:28 +0000 differ |
825 | === added file 'artwork/LeftArrow@18.png' |
826 | Binary files artwork/LeftArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/LeftArrow@18.png 2013-09-09 19:09:28 +0000 differ |
827 | === added file 'artwork/PageHeaderBaseDivider@18.png' |
828 | Binary files artwork/PageHeaderBaseDivider@18.png 1970-01-01 00:00:00 +0000 and artwork/PageHeaderBaseDivider@18.png 2013-09-09 19:09:28 +0000 differ |
829 | === added file 'artwork/PageHeaderBaseDivider@18.sci' |
830 | --- artwork/PageHeaderBaseDivider@18.sci 1970-01-01 00:00:00 +0000 |
831 | +++ artwork/PageHeaderBaseDivider@18.sci 2013-09-09 19:09:28 +0000 |
832 | @@ -0,0 +1,5 @@ |
833 | +border.top: 4 |
834 | +border.bottom: 4 |
835 | +border.left: 0 |
836 | +border.right: 0 |
837 | +source: PageHeaderBaseDivider@18.png |
838 | |
839 | === added file 'artwork/PageHeaderBaseDividerBottom@18.png' |
840 | Binary files artwork/PageHeaderBaseDividerBottom@18.png 1970-01-01 00:00:00 +0000 and artwork/PageHeaderBaseDividerBottom@18.png 2013-09-09 19:09:28 +0000 differ |
841 | === added file 'artwork/PageHeaderBaseDividerLight@18.png' |
842 | Binary files artwork/PageHeaderBaseDividerLight@18.png 1970-01-01 00:00:00 +0000 and artwork/PageHeaderBaseDividerLight@18.png 2013-09-09 19:09:28 +0000 differ |
843 | === added file 'artwork/PageHeaderBaseDividerLight@18.sci' |
844 | --- artwork/PageHeaderBaseDividerLight@18.sci 1970-01-01 00:00:00 +0000 |
845 | +++ artwork/PageHeaderBaseDividerLight@18.sci 2013-09-09 19:09:28 +0000 |
846 | @@ -0,0 +1,5 @@ |
847 | +border.top: 4 |
848 | +border.bottom: 0 |
849 | +border.left: 0 |
850 | +border.right: 0 |
851 | +source: PageHeaderBaseDividerLight@18.png |
852 | |
853 | === added file 'artwork/RightArrow@18.png' |
854 | Binary files artwork/RightArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/RightArrow@18.png 2013-09-09 19:09:28 +0000 differ |
855 | === added file 'artwork/ScrollbarBottomIdle@8.png' |
856 | Binary files artwork/ScrollbarBottomIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarBottomIdle@8.png 2013-09-09 19:09:28 +0000 differ |
857 | === added file 'artwork/ScrollbarBottomPressed@8.png' |
858 | Binary files artwork/ScrollbarBottomPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarBottomPressed@8.png 2013-09-09 19:09:28 +0000 differ |
859 | === added file 'artwork/ScrollbarLeftIdle@8.png' |
860 | Binary files artwork/ScrollbarLeftIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarLeftIdle@8.png 2013-09-09 19:09:28 +0000 differ |
861 | === added file 'artwork/ScrollbarLeftPressed@8.png' |
862 | Binary files artwork/ScrollbarLeftPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarLeftPressed@8.png 2013-09-09 19:09:28 +0000 differ |
863 | === added file 'artwork/ScrollbarRightIdle@8.png' |
864 | Binary files artwork/ScrollbarRightIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarRightIdle@8.png 2013-09-09 19:09:28 +0000 differ |
865 | === added file 'artwork/ScrollbarRightPressed@8.png' |
866 | Binary files artwork/ScrollbarRightPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarRightPressed@8.png 2013-09-09 19:09:28 +0000 differ |
867 | === added file 'artwork/ScrollbarTopIdle@8.png' |
868 | Binary files artwork/ScrollbarTopIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarTopIdle@8.png 2013-09-09 19:09:28 +0000 differ |
869 | === added file 'artwork/ScrollbarTopPressed@8.png' |
870 | Binary files artwork/ScrollbarTopPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarTopPressed@8.png 2013-09-09 19:09:28 +0000 differ |
871 | === added file 'artwork/TabLeftSelected@8.png' |
872 | Binary files artwork/TabLeftSelected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabLeftSelected@8.png 2013-09-09 19:09:28 +0000 differ |
873 | === added file 'artwork/TabLeftSelected@8.sci' |
874 | --- artwork/TabLeftSelected@8.sci 1970-01-01 00:00:00 +0000 |
875 | +++ artwork/TabLeftSelected@8.sci 2013-09-09 19:09:28 +0000 |
876 | @@ -0,0 +1,7 @@ |
877 | +source: TabLeftSelected@8.png |
878 | +border.left: 9 |
879 | +border.right: 2 |
880 | +border.top: 9 |
881 | +border.bottom: 0 |
882 | +horizontalTileMode: Stretch |
883 | +verticalTileMode: Stretch |
884 | |
885 | === added file 'artwork/TabLeftUnselected@8.png' |
886 | Binary files artwork/TabLeftUnselected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabLeftUnselected@8.png 2013-09-09 19:09:28 +0000 differ |
887 | === added file 'artwork/TabLeftUnselected@8.sci' |
888 | --- artwork/TabLeftUnselected@8.sci 1970-01-01 00:00:00 +0000 |
889 | +++ artwork/TabLeftUnselected@8.sci 2013-09-09 19:09:28 +0000 |
890 | @@ -0,0 +1,7 @@ |
891 | +source: TabLeftUnselected@8.png |
892 | +border.left: 9 |
893 | +border.right: 2 |
894 | +border.top: 9 |
895 | +border.bottom: 0 |
896 | +horizontalTileMode: Stretch |
897 | +verticalTileMode: Stretch |
898 | |
899 | === added file 'artwork/TabMiddleSelected@8.png' |
900 | Binary files artwork/TabMiddleSelected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabMiddleSelected@8.png 2013-09-09 19:09:28 +0000 differ |
901 | === added file 'artwork/TabMiddleSelected@8.sci' |
902 | --- artwork/TabMiddleSelected@8.sci 1970-01-01 00:00:00 +0000 |
903 | +++ artwork/TabMiddleSelected@8.sci 2013-09-09 19:09:28 +0000 |
904 | @@ -0,0 +1,7 @@ |
905 | +source: TabMiddleSelected@8.png |
906 | +border.left: 1 |
907 | +border.right: 2 |
908 | +border.top: 2 |
909 | +border.bottom: 0 |
910 | +horizontalTileMode: Stretch |
911 | +verticalTileMode: Stretch |
912 | |
913 | === added file 'artwork/TabMiddleUnselected@8.png' |
914 | Binary files artwork/TabMiddleUnselected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabMiddleUnselected@8.png 2013-09-09 19:09:28 +0000 differ |
915 | === added file 'artwork/TabMiddleUnselected@8.sci' |
916 | --- artwork/TabMiddleUnselected@8.sci 1970-01-01 00:00:00 +0000 |
917 | +++ artwork/TabMiddleUnselected@8.sci 2013-09-09 19:09:28 +0000 |
918 | @@ -0,0 +1,7 @@ |
919 | +source: TabMiddleUnselected@8.png |
920 | +border.left: 1 |
921 | +border.right: 2 |
922 | +border.top: 2 |
923 | +border.bottom: 0 |
924 | +horizontalTileMode: Stretch |
925 | +verticalTileMode: Stretch |
926 | |
927 | === added file 'artwork/TabRightSelected@8.png' |
928 | Binary files artwork/TabRightSelected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabRightSelected@8.png 2013-09-09 19:09:28 +0000 differ |
929 | === added file 'artwork/TabRightSelected@8.sci' |
930 | --- artwork/TabRightSelected@8.sci 1970-01-01 00:00:00 +0000 |
931 | +++ artwork/TabRightSelected@8.sci 2013-09-09 19:09:28 +0000 |
932 | @@ -0,0 +1,7 @@ |
933 | +source: TabRightSelected@8.png |
934 | +border.left: 1 |
935 | +border.right: 9 |
936 | +border.top: 10 |
937 | +border.bottom: 0 |
938 | +horizontalTileMode: Stretch |
939 | +verticalTileMode: Stretch |
940 | |
941 | === added file 'artwork/TabRightUnselected@8.png' |
942 | Binary files artwork/TabRightUnselected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabRightUnselected@8.png 2013-09-09 19:09:28 +0000 differ |
943 | === added file 'artwork/TabRightUnselected@8.sci' |
944 | --- artwork/TabRightUnselected@8.sci 1970-01-01 00:00:00 +0000 |
945 | +++ artwork/TabRightUnselected@8.sci 2013-09-09 19:09:28 +0000 |
946 | @@ -0,0 +1,7 @@ |
947 | +source: TabRightUnselected@8.png |
948 | +border.left: 1 |
949 | +border.right: 9 |
950 | +border.top: 10 |
951 | +border.bottom: 0 |
952 | +horizontalTileMode: Stretch |
953 | +verticalTileMode: Stretch |
954 | |
955 | === added file 'artwork/TextFieldClear@8.png' |
956 | Binary files artwork/TextFieldClear@8.png 1970-01-01 00:00:00 +0000 and artwork/TextFieldClear@8.png 2013-09-09 19:09:28 +0000 differ |
957 | === added file 'artwork/UpArrow@18.png' |
958 | Binary files artwork/UpArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/UpArrow@18.png 2013-09-09 19:09:28 +0000 differ |
959 | === added file 'artwork/background_paper@30.png' |
960 | Binary files artwork/background_paper@30.png 1970-01-01 00:00:00 +0000 and artwork/background_paper@30.png 2013-09-09 19:09:28 +0000 differ |
961 | === added file 'artwork/chevron@18.png' |
962 | Binary files artwork/chevron@18.png 1970-01-01 00:00:00 +0000 and artwork/chevron@18.png 2013-09-09 19:09:28 +0000 differ |
963 | === added file 'artwork/icon_clear@20.png' |
964 | Binary files artwork/icon_clear@20.png 1970-01-01 00:00:00 +0000 and artwork/icon_clear@20.png 2013-09-09 19:09:28 +0000 differ |
965 | === added file 'artwork/spinner@30.png' |
966 | Binary files artwork/spinner@30.png 1970-01-01 00:00:00 +0000 and artwork/spinner@30.png 2013-09-09 19:09:28 +0000 differ |
967 | === added file 'artwork/spinner@8.png' |
968 | Binary files artwork/spinner@8.png 1970-01-01 00:00:00 +0000 and artwork/spinner@8.png 2013-09-09 19:09:28 +0000 differ |
969 | === added file 'artwork/toolbar_dropshadow@20.png' |
970 | Binary files artwork/toolbar_dropshadow@20.png 1970-01-01 00:00:00 +0000 and artwork/toolbar_dropshadow@20.png 2013-09-09 19:09:28 +0000 differ |
971 | === added file 'artwork/ubuntushape_medium_radius_idle@18.png' |
972 | Binary files artwork/ubuntushape_medium_radius_idle@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_medium_radius_idle@18.png 2013-09-09 19:09:28 +0000 differ |
973 | === added file 'artwork/ubuntushape_medium_radius_idle@18.sci' |
974 | --- artwork/ubuntushape_medium_radius_idle@18.sci 1970-01-01 00:00:00 +0000 |
975 | +++ artwork/ubuntushape_medium_radius_idle@18.sci 2013-09-09 19:09:28 +0000 |
976 | @@ -0,0 +1,5 @@ |
977 | +border.left: 44 |
978 | +border.top: 54 |
979 | +border.bottom: 44 |
980 | +border.right: 52 |
981 | +source: ubuntushape_medium_radius_idle@18.png |
982 | \ No newline at end of file |
983 | |
984 | === added file 'artwork/ubuntushape_medium_radius_pressed@18.png' |
985 | Binary files artwork/ubuntushape_medium_radius_pressed@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_medium_radius_pressed@18.png 2013-09-09 19:09:28 +0000 differ |
986 | === added file 'artwork/ubuntushape_medium_radius_pressed@18.sci' |
987 | --- artwork/ubuntushape_medium_radius_pressed@18.sci 1970-01-01 00:00:00 +0000 |
988 | +++ artwork/ubuntushape_medium_radius_pressed@18.sci 2013-09-09 19:09:28 +0000 |
989 | @@ -0,0 +1,5 @@ |
990 | +border.left: 44 |
991 | +border.top: 54 |
992 | +border.bottom: 44 |
993 | +border.right: 52 |
994 | +source: ubuntushape_medium_radius_pressed@18.png |
995 | \ No newline at end of file |
996 | |
997 | === added file 'artwork/ubuntushape_medium_radius_shape@18.png' |
998 | Binary files artwork/ubuntushape_medium_radius_shape@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_medium_radius_shape@18.png 2013-09-09 19:09:28 +0000 differ |
999 | === added file 'artwork/ubuntushape_medium_radius_shape@18.sci' |
1000 | --- artwork/ubuntushape_medium_radius_shape@18.sci 1970-01-01 00:00:00 +0000 |
1001 | +++ artwork/ubuntushape_medium_radius_shape@18.sci 2013-09-09 19:09:28 +0000 |
1002 | @@ -0,0 +1,5 @@ |
1003 | +border.left: 44 |
1004 | +border.top: 54 |
1005 | +border.bottom: 44 |
1006 | +border.right: 52 |
1007 | +source: ubuntushape_medium_radius_shape@18.png |
1008 | \ No newline at end of file |
1009 | |
1010 | === added file 'artwork/ubuntushape_small_radius_idle@18.png' |
1011 | Binary files artwork/ubuntushape_small_radius_idle@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_small_radius_idle@18.png 2013-09-09 19:09:28 +0000 differ |
1012 | === added file 'artwork/ubuntushape_small_radius_idle@18.sci' |
1013 | --- artwork/ubuntushape_small_radius_idle@18.sci 1970-01-01 00:00:00 +0000 |
1014 | +++ artwork/ubuntushape_small_radius_idle@18.sci 2013-09-09 19:09:28 +0000 |
1015 | @@ -0,0 +1,5 @@ |
1016 | +border.left: 20 |
1017 | +border.top: 32 |
1018 | +border.bottom: 32 |
1019 | +border.right: 20 |
1020 | +source: ubuntushape_small_radius_idle@18.png |
1021 | \ No newline at end of file |
1022 | |
1023 | === added file 'artwork/ubuntushape_small_radius_pressed@18.png' |
1024 | Binary files artwork/ubuntushape_small_radius_pressed@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_small_radius_pressed@18.png 2013-09-09 19:09:28 +0000 differ |
1025 | === added file 'artwork/ubuntushape_small_radius_pressed@18.sci' |
1026 | --- artwork/ubuntushape_small_radius_pressed@18.sci 1970-01-01 00:00:00 +0000 |
1027 | +++ artwork/ubuntushape_small_radius_pressed@18.sci 2013-09-09 19:09:28 +0000 |
1028 | @@ -0,0 +1,5 @@ |
1029 | +border.left: 20 |
1030 | +border.top: 32 |
1031 | +border.bottom: 32 |
1032 | +border.right: 20 |
1033 | +source: ubuntushape_small_radius_pressed@18.png |
1034 | \ No newline at end of file |
1035 | |
1036 | === added file 'artwork/ubuntushape_small_radius_shape@18.png' |
1037 | Binary files artwork/ubuntushape_small_radius_shape@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_small_radius_shape@18.png 2013-09-09 19:09:28 +0000 differ |
1038 | === added file 'artwork/ubuntushape_small_radius_shape@18.sci' |
1039 | --- artwork/ubuntushape_small_radius_shape@18.sci 1970-01-01 00:00:00 +0000 |
1040 | +++ artwork/ubuntushape_small_radius_shape@18.sci 2013-09-09 19:09:28 +0000 |
1041 | @@ -0,0 +1,5 @@ |
1042 | +border.left: 20 |
1043 | +border.top: 32 |
1044 | +border.bottom: 32 |
1045 | +border.right: 20 |
1046 | +source: ubuntushape_small_radius_shape@18.png |
1047 | \ No newline at end of file |
1048 | |
1049 | === modified file 'auth.js' |
1050 | --- auth.js 2013-03-19 03:40:58 +0000 |
1051 | +++ auth.js 2013-09-09 19:09:28 +0000 |
1052 | @@ -51,10 +51,6 @@ |
1053 | }) |
1054 | } |
1055 | |
1056 | -function getFaceApiUrl() { |
1057 | - return "https://graph.facebook.com/"; |
1058 | -} |
1059 | - |
1060 | // Reads the auth token and checks its validity with Facebook |
1061 | function validateToken() { |
1062 | var token=getAuthToken(); |
1063 | @@ -69,18 +65,24 @@ |
1064 | |
1065 | var req=new XMLHttpRequest(); |
1066 | req.onreadystatechange = function() { |
1067 | - if ( (req.readyState == req.DONE) && (req.status == 200) ) { |
1068 | - var result = JSON.parse(req.responseText); |
1069 | - if (result.error === null) { |
1070 | - console.log("validateToken:invalid token"); |
1071 | + if (req.readyState == req.DONE) { |
1072 | + try { |
1073 | + var result = JSON.parse(req.responseText); |
1074 | + if (result.error) { |
1075 | + console.log("validateToken:"+result.error.message); |
1076 | + invalidAuth(); |
1077 | + } else { |
1078 | + console.log("validateToken:valid token"); |
1079 | + validAuth(token, getAccountId()); |
1080 | + } |
1081 | + } catch (e) { |
1082 | + console.log("validateToken:"+e); |
1083 | invalidAuth(); |
1084 | - } else { |
1085 | - console.log("validateToken:valid token"); |
1086 | - validAuth(token, getAccountId()); |
1087 | } |
1088 | } |
1089 | } |
1090 | - req.open("GET", getFaceApiUrl()+"me?access_token="+token, true); |
1091 | + |
1092 | + req.open("GET", FacebookFuncs.getFaceApiUrl()+"me?access_token="+token, true); |
1093 | req.send(); |
1094 | } |
1095 | |
1096 | @@ -97,7 +99,10 @@ |
1097 | } |
1098 | |
1099 | function getAuthToken() { |
1100 | - return getSetting("authtoken"); |
1101 | + var authToken=getSetting("authtoken"); |
1102 | + |
1103 | + console.log("Facebook AuthToken:"+authToken) |
1104 | + return authToken; |
1105 | } |
1106 | |
1107 | function getAccountId() { |
1108 | |
1109 | === removed file 'avatar@8.png' |
1110 | Binary files avatar@8.png 2013-02-12 16:18:48 +0000 and avatar@8.png 1970-01-01 00:00:00 +0000 differ |
1111 | === modified file 'debian/compat' |
1112 | --- debian/compat 2013-02-12 16:18:48 +0000 |
1113 | +++ debian/compat 2013-09-09 19:09:28 +0000 |
1114 | @@ -1,1 +1,1 @@ |
1115 | -8 |
1116 | +9 |
1117 | |
1118 | === modified file 'debian/control' |
1119 | --- debian/control 2013-04-04 20:12:47 +0000 |
1120 | +++ debian/control 2013-09-09 19:09:28 +0000 |
1121 | @@ -1,19 +1,20 @@ |
1122 | Source: ubuntu-facebook-app |
1123 | Priority: extra |
1124 | -Maintainer: Ugo Riboni <ugo.riboni@canonical.com> |
1125 | -Build-Depends: debhelper (>= 8.0.0), |
1126 | -Standards-Version: 3.9.3 |
1127 | +Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net> |
1128 | +Build-Depends: debhelper (>= 9), |
1129 | +Standards-Version: 3.9.4 |
1130 | Section: misc |
1131 | Homepage: https://launchpad.net/ubuntu-facebook-app |
1132 | +Vcs-Bzr: https://code.launchpad.net/~ubuntu-facebook-dev/ubuntu-facebook-app/trunk |
1133 | |
1134 | Package: ubuntu-facebook-app |
1135 | Section: misc |
1136 | Architecture: all |
1137 | Depends: ${misc:Depends}, |
1138 | qmlscene, |
1139 | - qt-components-ubuntu, |
1140 | + qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu, |
1141 | qtdeclarative5-qtquick2-plugin, |
1142 | - qtdeclarative5-friends-plugin (>= 0.1.0bzr13.03.15) |
1143 | + qtdeclarative5-friends-plugin, |
1144 | + qtdeclarative5-accounts-plugin |
1145 | Description: Facebook application |
1146 | Core Facebook application |
1147 | - |
1148 | |
1149 | === modified file 'debian/copyright' |
1150 | --- debian/copyright 2013-02-12 16:27:40 +0000 |
1151 | +++ debian/copyright 2013-09-09 19:09:28 +0000 |
1152 | @@ -1,16 +1,16 @@ |
1153 | -Format: http://dep.debian.net/deps/dep5 |
1154 | +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
1155 | Upstream-Name: ubuntu-facebook-app |
1156 | Source: |
1157 | |
1158 | Files: * |
1159 | Copyright: 2013 Canonical Ltd. |
1160 | -License: GPL-3.0 |
1161 | +License: GPL-3 |
1162 | |
1163 | Files: debian/* |
1164 | Copyright: 2013 Canonical Ltd. |
1165 | -License: LGPL-3.0 |
1166 | +License: LGPL-3 |
1167 | |
1168 | -License: GPL-3.0 |
1169 | +License: GPL-3 |
1170 | This package is free software; you can redistribute it and/or |
1171 | modify it under the terms of the GNU General Public |
1172 | License as published by the Free Software Foundation; either |
1173 | @@ -27,7 +27,7 @@ |
1174 | On Debian systems, the complete text of the GNU General |
1175 | Public License can be found in "/usr/share/common-licenses/GPL-3". |
1176 | |
1177 | -License: LGPL-3.0 |
1178 | +License: LGPL-3 |
1179 | This package is free software; you can redistribute it and/or |
1180 | modify it under the terms of the GNU Lesser General Public |
1181 | License as published by the Free Software Foundation; either |
1182 | |
1183 | === removed file 'debian/docs' |
1184 | === modified file 'debian/rules' |
1185 | --- debian/rules 2013-02-12 16:27:40 +0000 |
1186 | +++ debian/rules 2013-09-09 19:09:28 +0000 |
1187 | @@ -1,29 +1,11 @@ |
1188 | #!/usr/bin/make -f |
1189 | # -*- makefile -*- |
1190 | -# Sample debian/rules that uses debhelper. |
1191 | -# This file was originally written by Joey Hess and Craig Small. |
1192 | -# As a special exception, when this file is copied by dh-make into a |
1193 | -# dh-make output file, you may use that output file without restriction. |
1194 | -# This special exception was added by Craig Small in version 0.37 of dh-make. |
1195 | |
1196 | # Uncomment this to turn on verbose mode. |
1197 | #export DH_VERBOSE=1 |
1198 | |
1199 | -# Work-around for some machines where INSTALL_ROOT is not set properly by |
1200 | -# dh_auto_install |
1201 | -override_dh_auto_install: |
1202 | - dh_auto_install -- INSTALL_ROOT=$(CURDIR)/debian/tmp |
1203 | - |
1204 | -# Workaround a bug in that debhelper package version |
1205 | -override_dh_install: |
1206 | - mkdir -p $(CURDIR)/debian/tmp/usr/share/applications/ |
1207 | - mkdir -p $(CURDIR)/debian/tmp/usr/bin/ |
1208 | - mkdir -p $(CURDIR)/debian/tmp/usr/share/ubuntu-facebook-app/ |
1209 | - cp ubuntu-facebook-app.desktop $(CURDIR)/debian/tmp/usr/share/applications/ |
1210 | - cp ubuntu-facebook-app $(CURDIR)/debian/tmp/usr/bin/ |
1211 | - cp -r *.qml *.png $(CURDIR)/debian/tmp/usr/share/ubuntu-facebook-app/ |
1212 | - |
1213 | - dh_install --sourcedir=debian/tmp --fail-missing |
1214 | - |
1215 | %: |
1216 | dh $@ |
1217 | + |
1218 | +override_dh_install: |
1219 | + dh_install --fail-missing |
1220 | |
1221 | === modified file 'debian/source/format' |
1222 | --- debian/source/format 2013-02-12 16:18:48 +0000 |
1223 | +++ debian/source/format 2013-09-09 19:09:28 +0000 |
1224 | @@ -1,1 +1,1 @@ |
1225 | -3.0 (native) |
1226 | +1.0 |
1227 | |
1228 | === modified file 'debian/ubuntu-facebook-app.install' |
1229 | --- debian/ubuntu-facebook-app.install 2013-02-12 16:27:40 +0000 |
1230 | +++ debian/ubuntu-facebook-app.install 2013-09-09 19:09:28 +0000 |
1231 | @@ -1,3 +1,4 @@ |
1232 | -usr/share/applications |
1233 | -usr/bin |
1234 | -usr/share/ubuntu-facebook-app |
1235 | +ubuntu-facebook-app usr/bin/ |
1236 | +ubuntu-facebook-app.desktop usr/share/applications/ |
1237 | +*.qml usr/share/ubuntu-facebook-app/ |
1238 | +*.png usr/share/ubuntu-facebook-app/ |
1239 | |
1240 | === added file 'facebook.js' |
1241 | --- facebook.js 1970-01-01 00:00:00 +0000 |
1242 | +++ facebook.js 2013-09-09 19:09:28 +0000 |
1243 | @@ -0,0 +1,49 @@ |
1244 | +// Facebook Graph API Functions |
1245 | + |
1246 | +function getFaceApiUrl() { |
1247 | + return "https://graph.facebook.com/"; |
1248 | +} |
1249 | + |
1250 | +function Promise() { |
1251 | + var self=this; |
1252 | + |
1253 | + this.done = function(callback) { |
1254 | + self.doneCallback=callback; |
1255 | + return self; |
1256 | + }; |
1257 | + |
1258 | + this.fail = function(callback) { |
1259 | + self.failCallback=callback; |
1260 | + return self; |
1261 | + } |
1262 | +} |
1263 | + |
1264 | +function getCommentCount(token, postId) { |
1265 | + var req=new XMLHttpRequest(); |
1266 | + var promise = new Promise(); |
1267 | + |
1268 | + req.onreadystatechange = function() { |
1269 | + if (req.readyState == req.DONE) { |
1270 | + try { |
1271 | + var result = JSON.parse(req.responseText); |
1272 | + if (result.error) { |
1273 | + if (promise.failCallback) promise.failCallback(); |
1274 | + } else { |
1275 | + if (promise.doneCallback && result.data.length>0) promise.doneCallback(result.data[0].comments.count); |
1276 | + } |
1277 | + } catch (e) { |
1278 | + if (promise.failCallback) promise.failCallback(e); |
1279 | + } |
1280 | + } |
1281 | + } |
1282 | + |
1283 | + var requestUrl=getFaceApiUrl()+"fql?q=select+likes.count%2C+comments.count+FROM+stream+WHERE+post_id%3D'"+postId+"'&access_token="+token; |
1284 | + req.open("GET", requestUrl, true); |
1285 | + req.send(); |
1286 | + |
1287 | + return promise; |
1288 | +} |
1289 | + |
1290 | +function getProfilePictureUrl(token) { |
1291 | + return getFaceApiUrl()+'/me/picture?access_token='+token; |
1292 | +} |
1293 | |
1294 | === modified file 'facebook.qmlproject' |
1295 | --- facebook.qmlproject 2013-03-16 13:43:11 +0000 |
1296 | +++ facebook.qmlproject 2013-09-09 19:09:28 +0000 |
1297 | @@ -3,7 +3,7 @@ |
1298 | import QmlProject 1.1 |
1299 | |
1300 | Project { |
1301 | - mainFile: "facebook.qml" |
1302 | + mainFile: "ubuntu-facebook-app.qml" |
1303 | |
1304 | /* Include .qml, .js, and image files from current directory and subdirectories */ |
1305 | QmlFiles { |
1306 | |
1307 | === renamed file 'facebook.qmlproject.user' => 'facebook.qmlproject.user.THIS' |
1308 | === modified file 'facebook64.png' |
1309 | Binary files facebook64.png 2013-02-12 16:27:40 +0000 and facebook64.png 2013-09-09 19:09:28 +0000 differ |
1310 | === added directory 'images' |
1311 | === added file 'images/avatar@8.png' |
1312 | Binary files images/avatar@8.png 1970-01-01 00:00:00 +0000 and images/avatar@8.png 2013-09-09 19:09:28 +0000 differ |
1313 | === added file 'images/comment.png' |
1314 | Binary files images/comment.png 1970-01-01 00:00:00 +0000 and images/comment.png 2013-09-09 19:09:28 +0000 differ |
1315 | === added file 'images/facebook.png' |
1316 | Binary files images/facebook.png 1970-01-01 00:00:00 +0000 and images/facebook.png 2013-09-09 19:09:28 +0000 differ |
1317 | === added file 'images/go-top@30.png' |
1318 | Binary files images/go-top@30.png 1970-01-01 00:00:00 +0000 and images/go-top@30.png 2013-09-09 19:09:28 +0000 differ |
1319 | === added file 'images/like.png' |
1320 | Binary files images/like.png 1970-01-01 00:00:00 +0000 and images/like.png 2013-09-09 19:09:28 +0000 differ |
1321 | === added file 'images/new@30.png' |
1322 | Binary files images/new@30.png 1970-01-01 00:00:00 +0000 and images/new@30.png 2013-09-09 19:09:28 +0000 differ |
1323 | === added file 'images/reload@30.png' |
1324 | Binary files images/reload@30.png 1970-01-01 00:00:00 +0000 and images/reload@30.png 2013-09-09 19:09:28 +0000 differ |
1325 | === added file 'images/search@30.png' |
1326 | Binary files images/search@30.png 1970-01-01 00:00:00 +0000 and images/search@30.png 2013-09-09 19:09:28 +0000 differ |
1327 | === modified file 'ubuntu-facebook-app' |
1328 | --- ubuntu-facebook-app 2013-03-18 01:28:18 +0000 |
1329 | +++ ubuntu-facebook-app 2013-09-09 19:09:28 +0000 |
1330 | @@ -1,2 +1,2 @@ |
1331 | #!/bin/bash |
1332 | -qmlscene /usr/share/ubuntu-facebook-app/facebook.qml |
1333 | +qmlscene /usr/share/ubuntu-facebook-app/ubuntu-facebook-app.qml |
1334 | |
1335 | === modified file 'ubuntu-facebook-app.desktop' |
1336 | --- ubuntu-facebook-app.desktop 2013-04-04 11:10:26 +0000 |
1337 | +++ ubuntu-facebook-app.desktop 2013-09-09 19:09:28 +0000 |
1338 | @@ -3,7 +3,7 @@ |
1339 | Version=1.0 |
1340 | Type=Application |
1341 | Terminal=false |
1342 | -Exec=qmlscene /usr/share/ubuntu-facebook-app/facebook.qml |
1343 | +Exec=qmlscene /usr/share/ubuntu-facebook-app/ubuntu-facebook-app.qml |
1344 | Icon=/usr/share/ubuntu-facebook-app/facebook64.png |
1345 | Name=Facebook |
1346 | X-Ubuntu-Touch=true |
1347 | |
1348 | === renamed file 'facebook.qml' => 'ubuntu-facebook-app.qml' |
1349 | --- facebook.qml 2013-03-30 01:52:44 +0000 |
1350 | +++ ubuntu-facebook-app.qml 2013-09-09 19:09:28 +0000 |
1351 | @@ -9,10 +9,15 @@ |
1352 | // objectName for functional testing purposes (autopilot-qt5) |
1353 | id: facebookMainView |
1354 | objectName: "facebook" |
1355 | + applicationName: "ubuntu-facebook-app" |
1356 | width: units.gu(50) |
1357 | height: units.gu(75) |
1358 | state: "loading" |
1359 | |
1360 | + |
1361 | + property int accountId: -1 |
1362 | + property string token |
1363 | + |
1364 | signal refresh() |
1365 | signal invalidAuth() |
1366 | |
1367 | @@ -22,15 +27,20 @@ |
1368 | onAuthenticated: authModel.saveAccountInfo(token, accountId); |
1369 | } |
1370 | |
1371 | + StatusUpdatePopup { |
1372 | + id: statusPopup |
1373 | + } |
1374 | + |
1375 | Tabs { |
1376 | id: tabNav |
1377 | height: 0 |
1378 | width: 0 |
1379 | + visible: false |
1380 | |
1381 | // News tab |
1382 | Tab { |
1383 | id: newsTab |
1384 | - title: i18n.tr("Facebook News") |
1385 | + title: i18n.tr("News") |
1386 | page: NewsPage { |
1387 | id: newsPage |
1388 | anchors.margins: units.gu(2) |
1389 | @@ -41,7 +51,7 @@ |
1390 | // Events tab |
1391 | Tab { |
1392 | id: eventsTab |
1393 | - title: i18n.tr("Facebook Events") |
1394 | + title: i18n.tr("Events") |
1395 | page: EventsPage { |
1396 | id: eventsPage |
1397 | anchors.margins: units.gu(2) |
1398 | @@ -52,7 +62,7 @@ |
1399 | // Wall tab |
1400 | Tab { |
1401 | id: wallTab |
1402 | - title: i18n.tr("Facebook Wall") |
1403 | + title: i18n.tr("Wall") |
1404 | page: WallPage { |
1405 | id: wallPage |
1406 | anchors.margins: units.gu(2) |
1407 | @@ -63,21 +73,30 @@ |
1408 | |
1409 | ToolbarActions { |
1410 | id: mainActions |
1411 | + lock: true |
1412 | + active: tabNav.visible |
1413 | + |
1414 | + Action { |
1415 | + id: statusUpdateAction |
1416 | + iconSource: Qt.resolvedUrl("images/new.png") |
1417 | + text: i18n.tr("Status") |
1418 | + onTriggered: { |
1419 | + updateStatus(); |
1420 | + } |
1421 | + } |
1422 | Action { |
1423 | id: refreshAccountAction |
1424 | - iconSource: Qt.resolvedUrl("refresh.png") |
1425 | + iconSource: Qt.resolvedUrl("images/reload.png") |
1426 | text: i18n.tr("Refresh") |
1427 | onTriggered: { |
1428 | - mainActions.active = false; |
1429 | facebookMainView.refresh(); |
1430 | } |
1431 | } |
1432 | Action { |
1433 | id: resetAccountAction |
1434 | - iconSource: Qt.resolvedUrl("avatar.png") |
1435 | + iconSource: Qt.resolvedUrl("images/avatar.png") |
1436 | text: i18n.tr("Logout") |
1437 | onTriggered: { |
1438 | - mainActions.active = false; |
1439 | authModel.resetAccountInfo(); |
1440 | } |
1441 | } |
1442 | @@ -95,6 +114,10 @@ |
1443 | target: loadingPane |
1444 | visible: true |
1445 | } |
1446 | + PropertyChanges { |
1447 | + target: tabNav |
1448 | + visible: false |
1449 | + } |
1450 | }, |
1451 | |
1452 | State { |
1453 | @@ -103,6 +126,10 @@ |
1454 | target: loadingPane |
1455 | visible: false |
1456 | } |
1457 | + PropertyChanges { |
1458 | + target: tabNav |
1459 | + visible: true |
1460 | + } |
1461 | }, |
1462 | |
1463 | State { |
1464 | @@ -111,6 +138,10 @@ |
1465 | target: loadingPane |
1466 | visible: false |
1467 | } |
1468 | + PropertyChanges { |
1469 | + target: tabNav |
1470 | + visible: false |
1471 | + } |
1472 | } |
1473 | ] |
1474 | |
1475 | @@ -124,8 +155,9 @@ |
1476 | } |
1477 | |
1478 | onValidAuth: { |
1479 | - console.log("Facebook::accountId::"+accountId); |
1480 | - newsPage.accountId = accountId |
1481 | + console.log("Facebook::accountId:"+accountId); |
1482 | + facebookMainView.accountId = accountId; |
1483 | + facebookMainView.token = token; |
1484 | facebookMainView.state = "validauth" |
1485 | } |
1486 | } |
1487 | @@ -142,7 +174,13 @@ |
1488 | } |
1489 | } |
1490 | |
1491 | + |
1492 | Component.onCompleted: { |
1493 | initTimer.start(); |
1494 | } |
1495 | + |
1496 | + function updateStatus() { |
1497 | + statusPopup.open(); |
1498 | + } |
1499 | + |
1500 | } |