Merge lp:~ivaldi/midori/manydowns into lp:~kalikiana/midori/manydowns

Proposed by André Stösel
Status: Merged
Merged at revision: 6183
Proposed branch: lp:~ivaldi/midori/manydowns
Merge into: lp:~kalikiana/midori/manydowns
Diff against target: 40 lines (+14/-9)
1 file modified
extensions/transfers.vala (+14/-9)
To merge this branch: bzr merge lp:~ivaldi/midori/manydowns
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+166567@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

That's a nice tweak to avoid delaying a single download.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extensions/transfers.vala'
2--- extensions/transfers.vala 2013-05-30 11:12:51 +0000
3+++ extensions/transfers.vala 2013-05-30 18:17:26 +0000
4@@ -423,14 +423,17 @@
5 }
6
7 bool notification_timeout_triggered () {
8- string filename = notifications.nth_data(0);
9- string msg;
10- if (notifications.length () == 1)
11- msg = _("The file '<b>%s</b>' has been downloaded.").printf (filename);
12- else
13- msg = _("'<b>%s</b>' and %d other files have been downloaded.").printf (filename, notifications.length ());
14- get_app ().send_notification (_("Transfer completed"), msg);
15- notifications = new GLib.List<string> ();
16+ notification_timeout = 0;
17+ if (notifications.length () > 0) {
18+ string filename = notifications.nth_data(0);
19+ string msg;
20+ if (notifications.length () == 1)
21+ msg = _("The file '<b>%s</b>' has been downloaded.").printf (filename);
22+ else
23+ msg = _("'<b>%s</b>' and %d other files have been downloaded.").printf (filename, notifications.length ());
24+ get_app ().send_notification (_("Transfer completed"), msg);
25+ notifications = new GLib.List<string> ();
26+ }
27 return false;
28 }
29
30@@ -452,8 +455,10 @@
31 Gtk.RecentManager.get_default ().add_item (uri);
32
33 notifications.append (filename);
34- if (notification_timeout == 0)
35+ if (notification_timeout == 0) {
36+ notification_timeout_triggered ();
37 notification_timeout = Midori.Timeout.add_seconds (60, notification_timeout_triggered);
38+ }
39 }
40 }
41

Subscribers

People subscribed via source and target branches

to all changes: