Merge lp:~cando/activity-log-manager/appdialog-fixes into lp:~activity-log-manager/activity-log-manager/vala
- appdialog-fixes
- Merge into vala
Proposed by
Stefano Candori
Status: | Merged |
---|---|
Merged at revision: | 102 |
Proposed branch: | lp:~cando/activity-log-manager/appdialog-fixes |
Merge into: | lp:~activity-log-manager/activity-log-manager/vala |
Diff against target: |
516 lines (+342/-49) 3 files modified
po/activity-log-manager.pot (+252/-0) src/applications-widget.vala (+90/-35) src/blacklist-dbus.vala (+0/-14) |
To merge this branch: | bzr merge lp:~cando/activity-log-manager/appdialog-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Manish Sinha (मनीष सिन्हा) | Approve | ||
Review via email: mp+97629@code.launchpad.net |
Commit message
Description of the change
In this branch i've added a bunch of fixes regarding the ApplicationChoo
See the commit below for the explanation of the changes.
To post a comment you must log in.
- 106. By Stefano Candori
-
Added updated .pot file.
Revision history for this message
Stefano Candori (cando) wrote : | # |
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote : | # |
Yeah. We need to ask someone to up
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote : | # |
Sweet. Looks like already updated
https:/
Revision history for this message
Stefano Candori (cando) wrote : | # |
Cool..review on the branch? :)
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote : | # |
Everything looks fine.
Seif have a look
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'po/activity-log-manager.pot' |
2 | --- po/activity-log-manager.pot 1970-01-01 00:00:00 +0000 |
3 | +++ po/activity-log-manager.pot 2012-03-15 12:56:21 +0000 |
4 | @@ -0,0 +1,252 @@ |
5 | +# SOME DESCRIPTIVE TITLE. |
6 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
7 | +# This file is distributed under the same license as the PACKAGE package. |
8 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
9 | +# |
10 | +#, fuzzy |
11 | +msgid "" |
12 | +msgstr "" |
13 | +"Project-Id-Version: PACKAGE VERSION\n" |
14 | +"Report-Msgid-Bugs-To: \n" |
15 | +"POT-Creation-Date: 2012-03-15 13:52+0100\n" |
16 | +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
17 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
18 | +"Language-Team: LANGUAGE <LL@li.org>\n" |
19 | +"Language: \n" |
20 | +"MIME-Version: 1.0\n" |
21 | +"Content-Type: text/plain; charset=CHARSET\n" |
22 | +"Content-Transfer-Encoding: 8bit\n" |
23 | + |
24 | +#: ../data/activity-log-manager-ccpanel.desktop.in.h:1 |
25 | +msgid "Privacy" |
26 | +msgstr "" |
27 | + |
28 | +#: ../data/activity-log-manager-ccpanel.desktop.in.h:2 |
29 | +msgid "Privacy and Activity Manager" |
30 | +msgstr "" |
31 | + |
32 | +#. These keywords are used when searching for applications in dashes, etc. |
33 | +#: ../data/activity-log-manager-ccpanel.desktop.in.h:4 |
34 | +msgid "privacy;activity;log;zeitgeist;" |
35 | +msgstr "" |
36 | + |
37 | +#: ../data/activity-log-manager.desktop.in.h:1 |
38 | +msgid "Activities and Privacy Manager Tool" |
39 | +msgstr "" |
40 | + |
41 | +#: ../data/activity-log-manager.desktop.in.h:2 ../src/alm.vala:30 |
42 | +msgid "Activity Log Manager" |
43 | +msgstr "" |
44 | + |
45 | +#: ../data/activity-log-manager.desktop.in.h:3 |
46 | +msgid "Configure what gets logged in your Zeitgeist activity log" |
47 | +msgstr "" |
48 | + |
49 | +#: ../src/activity-log-manager.vala:45 |
50 | +msgid "Recent Items" |
51 | +msgstr "" |
52 | + |
53 | +#: ../src/activity-log-manager.vala:50 |
54 | +msgid "Files" |
55 | +msgstr "" |
56 | + |
57 | +#: ../src/activity-log-manager.vala:54 |
58 | +msgid "Applications" |
59 | +msgstr "" |
60 | + |
61 | +#: ../src/activity-log-manager.vala:61 |
62 | +#, c-format |
63 | +msgid "Record Activity" |
64 | +msgstr "" |
65 | + |
66 | +#: ../src/applications-widget.vala:86 |
67 | +msgid "Add Application" |
68 | +msgstr "" |
69 | + |
70 | +#: ../src/applications-widget.vala:90 |
71 | +msgid "Remove Application" |
72 | +msgstr "" |
73 | + |
74 | +#: ../src/applications-widget.vala:101 |
75 | +#, c-format |
76 | +msgid "Do not log activity from the following applications:" |
77 | +msgstr "" |
78 | + |
79 | +#: ../src/applications-widget.vala:120 ../src/applications-widget.vala:559 |
80 | +msgid "Select Application" |
81 | +msgstr "" |
82 | + |
83 | +#: ../src/applications-widget.vala:180 |
84 | +msgid "No description available" |
85 | +msgstr "" |
86 | + |
87 | +#: ../src/applications-widget.vala:489 ../src/files-widget.vala:354 |
88 | +msgid "Name" |
89 | +msgstr "" |
90 | + |
91 | +#: ../src/applications-widget.vala:504 |
92 | +msgid "Last Used" |
93 | +msgstr "" |
94 | + |
95 | +#: ../src/applications-widget.vala:517 |
96 | +msgid "Activity" |
97 | +msgstr "" |
98 | + |
99 | +#: ../src/applications-widget.vala:613 |
100 | +msgid "Today" |
101 | +msgstr "" |
102 | + |
103 | +#: ../src/applications-widget.vala:614 |
104 | +msgid "Yesterday" |
105 | +msgstr "" |
106 | + |
107 | +#: ../src/applications-widget.vala:627 |
108 | +msgid "Never" |
109 | +msgstr "" |
110 | + |
111 | +#: ../src/files-widget.vala:253 |
112 | +msgid "Audio" |
113 | +msgstr "" |
114 | + |
115 | +#: ../src/files-widget.vala:254 |
116 | +msgid "Video" |
117 | +msgstr "" |
118 | + |
119 | +#: ../src/files-widget.vala:255 |
120 | +msgid "Image" |
121 | +msgstr "" |
122 | + |
123 | +#: ../src/files-widget.vala:256 |
124 | +msgid "Text" |
125 | +msgstr "" |
126 | + |
127 | +#: ../src/files-widget.vala:257 |
128 | +msgid "Presentation" |
129 | +msgstr "" |
130 | + |
131 | +#: ../src/files-widget.vala:258 |
132 | +msgid "Spreadsheet" |
133 | +msgstr "" |
134 | + |
135 | +#: ../src/files-widget.vala:259 |
136 | +msgid "Instant Messaging" |
137 | +msgstr "" |
138 | + |
139 | +#: ../src/files-widget.vala:260 |
140 | +msgid "E-mail" |
141 | +msgstr "" |
142 | + |
143 | +#: ../src/files-widget.vala:261 |
144 | +msgid "Website" |
145 | +msgstr "" |
146 | + |
147 | +#: ../src/files-widget.vala:288 |
148 | +#, c-format |
149 | +msgid "Don't record activity for following type of files:" |
150 | +msgstr "" |
151 | + |
152 | +#: ../src/files-widget.vala:340 |
153 | +#, c-format |
154 | +msgid "Don't record activity in the following folders:" |
155 | +msgstr "" |
156 | + |
157 | +#: ../src/files-widget.vala:378 |
158 | +msgid "Add Folder" |
159 | +msgstr "" |
160 | + |
161 | +#: ../src/files-widget.vala:382 |
162 | +msgid "Remove Folder" |
163 | +msgstr "" |
164 | + |
165 | +#: ../src/files-widget.vala:402 |
166 | +msgid "Select a directory to blacklist" |
167 | +msgstr "" |
168 | + |
169 | +#: ../src/history-widget.vala:45 |
170 | +msgid "The past hour" |
171 | +msgstr "" |
172 | + |
173 | +#: ../src/history-widget.vala:46 |
174 | +msgid "The past day" |
175 | +msgstr "" |
176 | + |
177 | +#: ../src/history-widget.vala:47 |
178 | +msgid "The past week" |
179 | +msgstr "" |
180 | + |
181 | +#: ../src/history-widget.vala:48 |
182 | +msgid "All" |
183 | +msgstr "" |
184 | + |
185 | +#: ../src/history-widget.vala:49 |
186 | +msgid "Advanced" |
187 | +msgstr "" |
188 | + |
189 | +#: ../src/history-widget.vala:61 |
190 | +#, c-format |
191 | +msgid "Forget activities" |
192 | +msgstr "" |
193 | + |
194 | +#: ../src/history-widget.vala:68 |
195 | +#, c-format |
196 | +msgid "" |
197 | +"Every time a file or an application is used, some information can be stored. " |
198 | +"This activity can be used to retrieve files during searches or as history in " |
199 | +"applications." |
200 | +msgstr "" |
201 | + |
202 | +#: ../src/history-widget.vala:103 |
203 | +msgid "Delete history" |
204 | +msgstr "" |
205 | + |
206 | +#: ../src/history-widget.vala:148 |
207 | +msgid "" |
208 | +"This operation cannot be undone, are you sure you want to delete this " |
209 | +"activity?" |
210 | +msgstr "" |
211 | + |
212 | +#: ../src/history-widget.vala:285 |
213 | +msgid "From:" |
214 | +msgstr "" |
215 | + |
216 | +#: ../src/history-widget.vala:289 |
217 | +msgid "To:" |
218 | +msgstr "" |
219 | + |
220 | +#: ../src/history-widget.vala:300 |
221 | +#, c-format |
222 | +msgid "Invalid Timerange" |
223 | +msgstr "" |
224 | + |
225 | +#: ../src/diagnostics/com.ubuntu.whoopsiepreferences.policy.in.h:1 |
226 | +msgid "Privacy settings" |
227 | +msgstr "" |
228 | + |
229 | +#: ../src/diagnostics/com.ubuntu.whoopsiepreferences.policy.in.h:2 |
230 | +msgid "To change your privacy settings you need to authenticate." |
231 | +msgstr "" |
232 | + |
233 | +#: ../src/diagnostics/whoopsie.ui.h:1 |
234 | +msgid "" |
235 | +"<small>Error reports include information about what a program was doing when " |
236 | +"it failed. You always have the choice to send or cancel an error report.</" |
237 | +"small>" |
238 | +msgstr "" |
239 | + |
240 | +#: ../src/diagnostics/whoopsie.ui.h:2 |
241 | +msgid "People using this computer can:" |
242 | +msgstr "" |
243 | + |
244 | +#: ../src/diagnostics/whoopsie.ui.h:3 |
245 | +msgid "Privacy Policy" |
246 | +msgstr "" |
247 | + |
248 | +#: ../src/diagnostics/whoopsie.ui.h:4 |
249 | +msgid "Send error reports to Canonical" |
250 | +msgstr "" |
251 | + |
252 | +#: ../src/diagnostics/whoopsie.ui.h:5 |
253 | +msgid "" |
254 | +"Ubuntu can collect anonymous information that helps developers improve it. " |
255 | +"All information collected is covered by our privacy policy." |
256 | +msgstr "" |
257 | |
258 | === modified file 'src/applications-widget.vala' |
259 | --- src/applications-widget.vala 2012-03-12 14:45:32 +0000 |
260 | +++ src/applications-widget.vala 2012-03-15 12:56:21 +0000 |
261 | @@ -347,20 +347,34 @@ |
262 | this.pack_start (scroll); |
263 | } |
264 | |
265 | - public static Gdk.Pixbuf? get_pixbuf_from_gio_icon (Icon icon, int size=32) { |
266 | + public static Gdk.Pixbuf? get_pixbuf_from_gio_icon (Icon? icon, int size=32) { |
267 | Gdk.Pixbuf? pix = null; |
268 | - var icon_info = IconTheme.get_default ().lookup_by_gicon (icon , |
269 | - size, |
270 | - IconLookupFlags.FORCE_SVG); |
271 | - if (icon_info != null) { |
272 | - try { |
273 | - pix = icon_info.load_icon (); |
274 | - } |
275 | - catch (Error e){ |
276 | - return null; |
277 | - } |
278 | - } |
279 | - |
280 | + IconTheme theme = IconTheme.get_default (); |
281 | + IconInfo icon_info = null; |
282 | + /*If the application hasn't an icon in the current theme |
283 | + let's use the gtk-execute icon: |
284 | + http://developer.gnome.org/gtk3/3.2/gtk3-Stock-Items.html#GTK-STOCK-EXECUTE:CAPS |
285 | + */ |
286 | + if(icon == null) { |
287 | + icon_info = theme.lookup_icon ("gtk-execute" , |
288 | + size, |
289 | + IconLookupFlags.FORCE_SVG); |
290 | + } |
291 | + else { |
292 | + icon_info = theme.lookup_by_gicon (icon , |
293 | + size, |
294 | + IconLookupFlags.FORCE_SVG); |
295 | + if (icon_info == null) |
296 | + icon_info = theme.lookup_icon ("gtk-execute" , |
297 | + size, |
298 | + IconLookupFlags.FORCE_SVG); |
299 | + } |
300 | + try { |
301 | + pix = icon_info.load_icon (); |
302 | + } |
303 | + catch (Error e){ |
304 | + return null; |
305 | + } |
306 | return pix; |
307 | } |
308 | |
309 | @@ -375,7 +389,13 @@ |
310 | |
311 | // Insert only when it is empty |
312 | if(this.blocked_apps.lookup(app) == null) |
313 | - this.blocked_apps.insert(app, new AppChooseInfo(app_info.get_id(), app_info.get_name(), pix, "", 0)); |
314 | + this.blocked_apps.insert(app, new AppChooseInfo( |
315 | + app_info.get_id(), |
316 | + app_info.get_name(), |
317 | + pix, |
318 | + "", |
319 | + 0, |
320 | + 0)); |
321 | } |
322 | } |
323 | |
324 | @@ -466,7 +486,7 @@ |
325 | |
326 | private void set_up_ui () { |
327 | var column_pix_name = new TreeViewColumn (); |
328 | - column_pix_name.set_title ("Name"); |
329 | + column_pix_name.set_title (_("Name")); |
330 | this.treeview.append_column (column_pix_name); |
331 | var pix_rend = new CellRendererPixbuf (); |
332 | column_pix_name.pack_start (pix_rend, false); |
333 | @@ -477,10 +497,11 @@ |
334 | column_pix_name.add_attribute (name_rend, "text", 0); |
335 | column_pix_name.set_resizable (true); |
336 | column_pix_name.set_min_width (200); |
337 | + column_pix_name.set_max_width (400); |
338 | column_pix_name.set_sort_column_id (0); |
339 | |
340 | var column_used_name = new TreeViewColumn (); |
341 | - column_used_name.set_title ("Last Used"); |
342 | + column_used_name.set_title (_("Last Used")); |
343 | this.treeview.append_column (column_used_name); |
344 | var used_rend = new CellRendererText (); |
345 | used_rend.set_property ("ellipsize", Pango.EllipsizeMode.END); |
346 | @@ -488,11 +509,12 @@ |
347 | column_used_name.add_attribute (used_rend, "text", 3); |
348 | column_used_name.set_resizable (true); |
349 | column_used_name.set_min_width (200); |
350 | + column_used_name.set_max_width (400); |
351 | column_used_name.set_sort_column_id (4); |
352 | - used_rend.set_property("xalign", 1); |
353 | + used_rend.set_property("xalign", 0); |
354 | |
355 | var column_usage_name = new TreeViewColumn (); |
356 | - column_usage_name.set_title ("Activity"); |
357 | + column_usage_name.set_title (_("Activity")); |
358 | this.treeview.append_column (column_usage_name); |
359 | var usage_rend = new UsageCellRenderer (); |
360 | column_usage_name.pack_start (usage_rend, true); |
361 | @@ -557,6 +579,18 @@ |
362 | } |
363 | } |
364 | |
365 | + private int compare_dates(DateTime now, DateTime time) { |
366 | + int res = -1; |
367 | + int now_y, now_m, now_d, time_y, time_m, time_d; |
368 | + now.get_ymd(out now_y, out now_m, out now_d); |
369 | + time.get_ymd(out time_y, out time_m, out time_d); |
370 | + if (now_y == time_y && now_m == time_m && now_d == time_d) |
371 | + return 0; |
372 | + else if (now_y == time_y && now_m == time_m && now_d == time_d + 1) |
373 | + return 1; |
374 | + return res; |
375 | + } |
376 | + |
377 | public void handle_app_population(HashTable<string, int64?> all_actors) { |
378 | all_actors_list = all_actors; |
379 | |
380 | @@ -570,18 +604,27 @@ |
381 | { |
382 | string id = app_info.get_id (); |
383 | int64? last_accessed_time = all_actors.lookup(id); |
384 | - // |
385 | if(last_accessed_time != null) |
386 | { |
387 | var time = new DateTime.from_unix_local (last_accessed_time/1000); |
388 | - var last_accessed = time.format("%e %B %Y"); |
389 | + var now = new DateTime.now_local(); |
390 | + var res = this.compare_dates(now, time); |
391 | + string last_accessed = ""; |
392 | + string today = _("Today"); |
393 | + string yesterday = _("Yesterday"); |
394 | + if (res == 0) // Today |
395 | + last_accessed = time.format(today + ", %H:%M"); |
396 | + else if (res == 1) // Yesterday |
397 | + last_accessed = time.format(yesterday + ", %H:%M"); |
398 | + else |
399 | + last_accessed = time.format("%e %B %Y, %H:%M"); |
400 | |
401 | insert_liststore(app_info, last_accessed, last_accessed_time, |
402 | 0); |
403 | } |
404 | else { |
405 | other_appinfo.append(app_info); |
406 | - insert_liststore(app_info, "", 0, 0); |
407 | + insert_liststore(app_info, _("Never"), 0, 0); |
408 | } |
409 | } |
410 | /*foreach(AppInfo app_info in other_appinfo) |
411 | @@ -596,9 +639,7 @@ |
412 | var name = app_info.get_name (); |
413 | |
414 | var icon = app_info.get_icon (); |
415 | - Gdk.Pixbuf? pix = null; |
416 | - if(icon != null) |
417 | - pix = ApplicationsTreeView.get_pixbuf_from_gio_icon (icon); |
418 | + Gdk.Pixbuf? pix = ApplicationsTreeView.get_pixbuf_from_gio_icon (icon); |
419 | |
420 | AppChooseInfo app_choose_info = blocked_apps.lookup(id); |
421 | if(app_choose_info == null) |
422 | @@ -607,11 +648,13 @@ |
423 | this.treeview.liststore.append(out iter); |
424 | this.treeview.liststore.set(iter, 0, name, 1, pix, 2, id, |
425 | 3, last_accessed, 4, last_accessed_time, 5, 0, -1); |
426 | - this.blocked_apps.insert(id, new AppChooseInfo(id, name, pix, last_accessed, usage)); |
427 | + this.blocked_apps.insert(id, new AppChooseInfo(id, name, pix, |
428 | + last_accessed, |
429 | + last_accessed_time, |
430 | + usage)); |
431 | //this.actors_iter[id] = iter; |
432 | if (last_accessed_time > 0) |
433 | - this.app_blacklist.get_count_for_app(id, iter, this.treeview.liststore); |
434 | - |
435 | + this.app_blacklist.get_count_for_app(id, iter, this.treeview.liststore); |
436 | } |
437 | else |
438 | { |
439 | @@ -627,7 +670,8 @@ |
440 | TreeIter iter; |
441 | this.treeview.liststore.insert(out iter, 1); |
442 | this.treeview.liststore.set(iter, 0, app_choose_info.name, |
443 | - 1, app_choose_info.icon, 2, app, -1); |
444 | + 1, app_choose_info.icon, 2, app, 3, app_choose_info.last_accessed, |
445 | + 4, app_choose_info.last_accessed_time, -1); |
446 | this.app_blacklist.get_count_for_app(app_choose_info.get_id(), iter, this.treeview.liststore); |
447 | } |
448 | } |
449 | @@ -709,14 +753,16 @@ |
450 | private string app_id; |
451 | private string app_name; |
452 | private Gdk.Pixbuf? app_icon; |
453 | - private string last_accessed_time; |
454 | + private string last_accessed_time_s; |
455 | + private int64 last_accessed_time_i; |
456 | private uint usage_rating; |
457 | |
458 | public AppChooseInfo(string id, string app_name, Gdk.Pixbuf? app_icon, |
459 | - string last_accessed_time, uint usage_rating ) { |
460 | + string last_accessed_time_s, int64 last_accessed_time_i, uint usage_rating ) { |
461 | this.app_name = app_name; |
462 | this.app_icon = app_icon; |
463 | - this.last_accessed_time = last_accessed_time; |
464 | + this.last_accessed_time_s = last_accessed_time_s; |
465 | + this.last_accessed_time_i = last_accessed_time_i; |
466 | this.usage_rating = usage_rating; |
467 | this.app_id = id; |
468 | } |
469 | @@ -745,10 +791,19 @@ |
470 | |
471 | public string last_accessed { |
472 | get { |
473 | - return last_accessed_time; |
474 | - } |
475 | - set { |
476 | - last_accessed_time = value; |
477 | + return last_accessed_time_s; |
478 | + } |
479 | + set { |
480 | + last_accessed_time_s = value; |
481 | + } |
482 | + } |
483 | + |
484 | + public int64 last_accessed_time { |
485 | + get { |
486 | + return last_accessed_time_i; |
487 | + } |
488 | + set { |
489 | + last_accessed_time_i = value; |
490 | } |
491 | } |
492 | |
493 | |
494 | === modified file 'src/blacklist-dbus.vala' |
495 | --- src/blacklist-dbus.vala 2012-02-24 17:48:20 +0000 |
496 | +++ src/blacklist-dbus.vala 2012-03-15 12:56:21 +0000 |
497 | @@ -162,20 +162,6 @@ |
498 | null); |
499 | |
500 | var counter = results.length/100; |
501 | - int64 last_accessed = 0; |
502 | - var last_accessed_string = ""; |
503 | - if (counter > 0) { |
504 | - var ids= new Array<int>(); |
505 | - int event_id = results.index(0); |
506 | - ids.append_val(event_id); |
507 | - var results2 = yield log.get_events(ids, null); |
508 | - last_accessed = results2.next().get_timestamp(); |
509 | - var time = new DateTime.from_unix_local (last_accessed/1000); |
510 | - last_accessed_string = time.format("%e %B %Y"); |
511 | - } |
512 | - |
513 | - store.set_value(iter, 3, last_accessed_string); |
514 | - store.set_value(iter, 4, last_accessed); |
515 | store.set_value(iter, 5, counter); |
516 | } |
517 |
I've also added the udpated .pot files.
Currently launchpad is configured to import the pot file from the 0.8 series...we should udpate this, right?