Merge lp:~super-friends/unity-lens-friends/raring into lp:unity-lens-friends
- raring
- Merge into trunk
Proposed by
Ken VanDine
Status: | Merged |
---|---|
Approved by: | Ken VanDine |
Approved revision: | 47 |
Merged at revision: | 47 |
Proposed branch: | lp:~super-friends/unity-lens-friends/raring |
Merge into: | lp:unity-lens-friends |
Diff against target: |
262 lines (+99/-98) 4 files modified
debian/changelog (+8/-0) debian/control (+3/-1) src/daemon.vala (+81/-95) src/schemas.vala (+7/-2) |
To merge this branch: | bzr merge lp:~super-friends/unity-lens-friends/raring |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ken VanDine | Approve | ||
Review via email: mp+154375@code.launchpad.net |
Commit message
Description of the change
Merge queued up changes for raring to trunk now that the FFe bug 1156979 was approved
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2013-02-25 15:18:38 +0000 | |||
3 | +++ debian/changelog 2013-03-20 13:50:55 +0000 | |||
4 | @@ -1,3 +1,11 @@ | |||
5 | 1 | unity-lens-friends (0.1.1bzr13.03.20-0ubuntu1) UNRELEASED; urgency=low | ||
6 | 2 | |||
7 | 3 | * Ported to the flatter schema | ||
8 | 4 | * debian/control | ||
9 | 5 | - depend on friends (>= 0.1.3) for schema changes (LP: #1156941) | ||
10 | 6 | |||
11 | 7 | -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Mar 2013 10:12:48 -0400 | ||
12 | 8 | |||
13 | 1 | unity-lens-friends (0.1.1bzr13.02.25-0ubuntu1) raring; urgency=low | 9 | unity-lens-friends (0.1.1bzr13.02.25-0ubuntu1) raring; urgency=low |
14 | 2 | 10 | ||
15 | 3 | * Dropped src/stream-model-schema.vala, the schema is defined | 11 | * Dropped src/stream-model-schema.vala, the schema is defined |
16 | 4 | 12 | ||
17 | === modified file 'debian/control' | |||
18 | --- debian/control 2013-02-22 00:09:33 +0000 | |||
19 | +++ debian/control 2013-03-20 13:50:55 +0000 | |||
20 | @@ -19,7 +19,9 @@ | |||
21 | 19 | 19 | ||
22 | 20 | Package: unity-lens-friends | 20 | Package: unity-lens-friends |
23 | 21 | Architecture: any | 21 | Architecture: any |
25 | 22 | Depends: ${shlibs:Depends}, ${misc:Depends} | 22 | Depends: ${shlibs:Depends}, |
26 | 23 | ${misc:Depends}, | ||
27 | 24 | friends (>= 0.1.3), | ||
28 | 23 | Description: Friends Lens for unity | 25 | Description: Friends Lens for unity |
29 | 24 | This package contains the "friends" lens which can be used | 26 | This package contains the "friends" lens which can be used |
30 | 25 | in Unity to view streams from Friends. | 27 | in Unity to view streams from Friends. |
31 | 26 | 28 | ||
32 | === modified file 'src/daemon.vala' | |||
33 | --- src/daemon.vala 2013-02-14 14:13:05 +0000 | |||
34 | +++ src/daemon.vala 2013-03-20 13:50:55 +0000 | |||
35 | @@ -521,14 +521,9 @@ | |||
36 | 521 | 521 | ||
37 | 522 | if (account_ids.size > 0) | 522 | if (account_ids.size > 0) |
38 | 523 | { | 523 | { |
47 | 524 | var _message_ids = model.get_value (iter, StreamModelColumn.MESSAGE_IDS); | 524 | var _account = (uint)model.get_uint64 (iter, StreamModelColumn.ACCOUNT_ID); |
48 | 525 | foreach (var _message_id in _message_ids) | 525 | if (!(_account.to_string() in account_ids)) |
49 | 526 | { | 526 | account_match = false; |
42 | 527 | var _message_id_item = (string[])_message_id; | ||
43 | 528 | var _account = _message_id_item[1]; | ||
44 | 529 | if (!(_account in account_ids)) | ||
45 | 530 | account_match = false; | ||
46 | 531 | } | ||
50 | 532 | } | 527 | } |
51 | 533 | 528 | ||
52 | 534 | var _stream = model.get_string (iter, StreamModelColumn.STREAM); | 529 | var _stream = model.get_string (iter, StreamModelColumn.STREAM); |
53 | @@ -635,7 +630,7 @@ | |||
54 | 635 | var avatar = Icon.new_for_string (icon_uri); | 630 | var avatar = Icon.new_for_string (icon_uri); |
55 | 636 | 631 | ||
56 | 637 | //var avatar = new FileIcon (File.new_for_path (get_avatar_path (icon_uri))); | 632 | //var avatar = new FileIcon (File.new_for_path (get_avatar_path (icon_uri))); |
58 | 638 | var likes = model.get_double (iter, StreamModelColumn.LIKES); | 633 | var likes = model.get_uint64 (iter, StreamModelColumn.LIKES); |
59 | 639 | var sender = model.get_string (iter, StreamModelColumn.SENDER); | 634 | var sender = model.get_string (iter, StreamModelColumn.SENDER); |
60 | 640 | var timestring = utils.create_time_string (model.get_string (iter, StreamModelColumn.TIMESTAMP)); | 635 | var timestring = utils.create_time_string (model.get_string (iter, StreamModelColumn.TIMESTAMP)); |
61 | 641 | var content = model.get_string (iter, StreamModelColumn.MESSAGE); | 636 | var content = model.get_string (iter, StreamModelColumn.MESSAGE); |
62 | @@ -661,96 +656,87 @@ | |||
63 | 661 | iter = model.next (iter); | 656 | iter = model.next (iter); |
64 | 662 | } | 657 | } |
65 | 663 | 658 | ||
108 | 664 | uint[] _seen = null; | 659 | uint _account_id = (uint)model.get_uint64(iter, StreamModelColumn.ACCOUNT_ID); |
109 | 665 | var _message_ids = model.get_value (iter, StreamModelColumn.MESSAGE_IDS); | 660 | debug ("account_id: %u", _account_id); |
110 | 666 | foreach (var _message_id in _message_ids) | 661 | var _account_service = model.get_string (iter, StreamModelColumn.PROTOCOL); |
111 | 667 | { | 662 | var _status_id = model.get_string (iter, StreamModelColumn.MESSAGE_ID); |
112 | 668 | var _message_id_item = (string[])_message_id; | 663 | var icon_str = icon_dir.get_child ("service-" + _account_service + ".svg"); |
113 | 669 | uint _account_id = (uint)uint64.parse(_message_id_item[1]); | 664 | if (icon_str.query_exists ()) |
114 | 670 | debug ("account_id: %u", _account_id); | 665 | icon = new FileIcon (icon_str); |
115 | 671 | if (_account_id in _seen) | 666 | else |
116 | 672 | continue; | 667 | icon = null; |
117 | 673 | _seen += _account_id; | 668 | |
118 | 674 | var _account_service = _message_id_item[0]; | 669 | string[] _features = null; |
119 | 675 | var _status_id = _message_id_item[2]; | 670 | if (featureMap.has_key(_account_service)) |
120 | 676 | var icon_str = icon_dir.get_child ("service-" + _account_service + ".svg"); | 671 | { |
121 | 677 | if (icon_str.query_exists ()) | 672 | _features = featureMap[_account_service].dup_strv (); |
122 | 678 | icon = new FileIcon (icon_str); | 673 | } |
123 | 679 | else | 674 | |
124 | 680 | icon = null; | 675 | parse_comments (preview, _status_id); |
125 | 681 | 676 | ||
126 | 682 | string[] _features = null; | 677 | var view_action = new Unity.PreviewAction ("view", _("View"), icon); |
127 | 683 | if (featureMap.has_key(_account_service)) | 678 | preview.add_action (view_action); |
128 | 684 | { | 679 | |
129 | 685 | _features = featureMap[_account_service].dup_strv (); | 680 | view_action.activated.connect ((source) => { |
130 | 686 | } | 681 | try |
131 | 687 | 682 | { | |
132 | 688 | parse_comments (preview, _status_id); | 683 | if (GLib.AppInfo.launch_default_for_uri (uri, null)) |
133 | 689 | 684 | { | |
134 | 690 | var view_action = new Unity.PreviewAction ("view", _("View"), icon); | 685 | return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH); |
135 | 691 | preview.add_action (view_action); | 686 | } |
136 | 692 | 687 | } | |
137 | 693 | view_action.activated.connect ((source) => { | 688 | catch (GLib.Error e) |
138 | 694 | try | 689 | { |
139 | 695 | { | 690 | warning ("Failed to launch default application for uri '%s': %s", uri, e.message); |
140 | 696 | if (GLib.AppInfo.launch_default_for_uri (uri, null)) | 691 | } |
141 | 697 | { | 692 | return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED); |
142 | 698 | return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH); | 693 | }); |
143 | 699 | } | 694 | |
144 | 700 | } | 695 | if ("retweet" in _features) |
145 | 701 | catch (GLib.Error e) | 696 | { |
146 | 702 | { | 697 | if (_account_service == "twitter") |
147 | 703 | warning ("Failed to launch default application for uri '%s': %s", uri, e.message); | 698 | retweet_str = _("Retweet"); |
148 | 704 | } | 699 | else |
149 | 705 | return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED); | 700 | retweet_str = _("Share"); |
150 | 701 | var retweet_action = new Unity.PreviewAction ("retweet", retweet_str, icon); | ||
151 | 702 | preview.add_action (retweet_action); | ||
152 | 703 | retweet_action.activated.connect ((source) => { | ||
153 | 704 | Idle.add (() => { | ||
154 | 705 | var dispatcher = new Friends.Dispatcher (); | ||
155 | 706 | dispatcher.retweet (_account_id, _status_id); | ||
156 | 707 | return false; | ||
157 | 708 | }); | ||
158 | 709 | return new Unity.ActivationResponse (Unity.HandledType.SHOW_PREVIEW); | ||
159 | 706 | }); | 710 | }); |
178 | 707 | 711 | } | |
161 | 708 | if ("retweet" in _features) | ||
162 | 709 | { | ||
163 | 710 | if (_account_service == "twitter") | ||
164 | 711 | retweet_str = _("Retweet"); | ||
165 | 712 | else | ||
166 | 713 | retweet_str = _("Share"); | ||
167 | 714 | var retweet_action = new Unity.PreviewAction ("retweet", retweet_str, icon); | ||
168 | 715 | preview.add_action (retweet_action); | ||
169 | 716 | retweet_action.activated.connect ((source) => { | ||
170 | 717 | Idle.add (() => { | ||
171 | 718 | var dispatcher = new Friends.Dispatcher (); | ||
172 | 719 | dispatcher.retweet (_account_id, _status_id); | ||
173 | 720 | return false; | ||
174 | 721 | }); | ||
175 | 722 | return new Unity.ActivationResponse (Unity.HandledType.SHOW_PREVIEW); | ||
176 | 723 | }); | ||
177 | 724 | } | ||
179 | 725 | 712 | ||
190 | 726 | bool from_me = model.get_bool (iter, StreamModelColumn.FROM_ME); | 713 | bool from_me = model.get_bool (iter, StreamModelColumn.FROM_ME); |
191 | 727 | // REPLY | 714 | // REPLY |
192 | 728 | //if ("reply" in _features && !from_me) | 715 | //if ("reply" in _features && !from_me) |
193 | 729 | //{ | 716 | //{ |
194 | 730 | // var reply_action = new Unity.PreviewAction ("reply", _("Reply"), icon); | 717 | // var reply_action = new Unity.PreviewAction ("reply", _("Reply"), icon); |
195 | 731 | // preview.add_action (reply_action); | 718 | // preview.add_action (reply_action); |
196 | 732 | // reply_action.activated.connect ((source) => { | 719 | // reply_action.activated.connect ((source) => { |
197 | 733 | // return new Unity.ActivationResponse(Unity.HandledType.HIDE_DASH); | 720 | // return new Unity.ActivationResponse(Unity.HandledType.HIDE_DASH); |
198 | 734 | // }); | 721 | // }); |
199 | 735 | //} | 722 | //} |
200 | 736 | 723 | ||
216 | 737 | bool liked = model.get_bool (iter, StreamModelColumn.LIKED); | 724 | bool liked = model.get_bool (iter, StreamModelColumn.LIKED); |
217 | 738 | if ("like" in _features && "unlike" in _features && !from_me) | 725 | if ("like" in _features && "unlike" in _features && !from_me) |
218 | 739 | { | 726 | { |
219 | 740 | like_str = liked ? _("Unlike") : _("Like"); | 727 | like_str = liked ? _("Unlike") : _("Like"); |
220 | 741 | var like_action = new Unity.PreviewAction ("like", like_str, icon); | 728 | var like_action = new Unity.PreviewAction ("like", like_str, icon); |
221 | 742 | preview.add_action (like_action); | 729 | preview.add_action (like_action); |
222 | 743 | like_action.activated.connect ((source) => { | 730 | like_action.activated.connect ((source) => { |
223 | 744 | Idle.add (() => { | 731 | Idle.add (() => { |
224 | 745 | var dispatcher = new Friends.Dispatcher (); | 732 | var dispatcher = new Friends.Dispatcher (); |
225 | 746 | var ret = liked ? dispatcher.unlike (_account_id, _status_id) : dispatcher.like (_account_id, _status_id); | 733 | var ret = liked ? dispatcher.unlike (_account_id, _status_id) : dispatcher.like (_account_id, _status_id); |
226 | 747 | return false; | 734 | return false; |
212 | 748 | }); | ||
213 | 749 | model.set_value (iter, StreamModelColumn.LIKED, !liked); | ||
214 | 750 | Unity.Preview new_preview = this.preview (uri); | ||
215 | 751 | return new Unity.ActivationResponse.with_preview (new_preview); | ||
227 | 752 | }); | 735 | }); |
229 | 753 | } | 736 | model.set_value (iter, StreamModelColumn.LIKED, !liked); |
230 | 737 | Unity.Preview new_preview = this.preview (uri); | ||
231 | 738 | return new Unity.ActivationResponse.with_preview (new_preview); | ||
232 | 739 | }); | ||
233 | 754 | } | 740 | } |
234 | 755 | 741 | ||
235 | 756 | return preview; | 742 | return preview; |
236 | 757 | 743 | ||
237 | === modified file 'src/schemas.vala' | |||
238 | --- src/schemas.vala 2013-02-25 15:09:57 +0000 | |||
239 | +++ src/schemas.vala 2013-03-20 13:50:55 +0000 | |||
240 | @@ -51,7 +51,9 @@ | |||
241 | 51 | /* Dee.Model schema */ | 51 | /* Dee.Model schema */ |
242 | 52 | public enum StreamModelColumn | 52 | public enum StreamModelColumn |
243 | 53 | { | 53 | { |
245 | 54 | MESSAGE_IDS, | 54 | PROTOCOL, |
246 | 55 | ACCOUNT_ID, | ||
247 | 56 | MESSAGE_ID, | ||
248 | 55 | STREAM, | 57 | STREAM, |
249 | 56 | SENDER, | 58 | SENDER, |
250 | 57 | SENDER_ID, | 59 | SENDER_ID, |
251 | @@ -68,7 +70,10 @@ | |||
252 | 68 | LINK_URL, | 70 | LINK_URL, |
253 | 69 | LINK_DESC, | 71 | LINK_DESC, |
254 | 70 | LINK_CAPTION, | 72 | LINK_CAPTION, |
256 | 71 | LINK_ICON | 73 | LINK_ICON, |
257 | 74 | LOCATION, | ||
258 | 75 | LATITUDE, | ||
259 | 76 | LONGITUDE | ||
260 | 72 | } | 77 | } |
261 | 73 | 78 | ||
262 | 74 | } /* end UnityFriends namespace */ | 79 | } /* end UnityFriends namespace */ |
This was reviewed before merging into the raring branch