Merge lp:~kalikiana/midori/dock into lp:midori

Proposed by Cris Dywan
Status: Work in progress
Proposed branch: lp:~kalikiana/midori/dock
Merge into: lp:midori
Diff against target: 93 lines (+27/-2)
4 files modified
extensions/transfers.vala (+11/-0)
extensions/wscript_build (+3/-1)
midori/midori-view.c (+2/-1)
wscript (+11/-0)
To merge this branch: bzr merge lp:~kalikiana/midori/dock
Reviewer Review Type Date Requested Status
Midori Devs Pending
Review via email: mp+166497@code.launchpad.net

Description of the change

Show a counter in the dock for in-progress downloads

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

There's no progress at this point. This will require some refactoring beyond this feature.

Revision history for this message
gue5t gue5t (gue5t) wrote :

A minor question I have is why "libunity" vs. "unity" is chosen in different contexts; all external references seem to have no "lib" prefix.

I haven't tested the code but it looks ok--a nitpick on naming is that the function name "update_dock_item" is not very descriptive of how it works; to me it seems like "add/increase_dock_item_count" would explain the behavior of its parameter.

Revision history for this message
Julián Unrrein (junrrein) wrote :

Acording to the HIG (http://www.elementaryos.org/docs/human-interface-guidelines/desktop-integration/dock-integration) the purpose of dock badges "is to inform the user that there is something that requires attention without being obtrusive".

I don't think that's the case here. The user is already notified about the download in the main window.

Revision history for this message
Julián Unrrein (junrrein) wrote :

They would make sense to indicate finished downloads.

Revision history for this message
Cris Dywan (kalikiana) wrote :

The dock is used specifically when the user doesn't see the window. I'm not sure what's obtrusive here.

Unmerged revisions

6186. By Cris Dywan

Drop urgent hint which is redundant with notifications

6185. By Cris Dywan

Decrease dock count when download stops, it may remain in the list

6184. By Cris Dywan

REname update_dock_item to add_dock_item_count for clarity

6183. By Cris Dywan

Always refer to unity, there's no lib prefix

6182. By Cris Dywan

Show a counter in the dock for in-progress downloads

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 18:07:54 +0000
3+++ extensions/transfers.vala 2013-05-31 11:02:29 +0000
4@@ -420,6 +420,15 @@
5 transfer.changed.connect (transfer_changed);
6 array.remove_item.connect (transfer_removed);
7 array.add_item (transfer);
8+ add_dock_item_count (1);
9+ }
10+
11+ void add_dock_item_count (int count_diff) {
12+#if HAVE_UNITY
13+ var dock = Unity.LauncherEntry.get_for_desktop_id (PACKAGE_NAME + ".desktop");
14+ dock.count += count_diff;
15+ dock.count_visible = dock.count > 0;
16+#endif
17 }
18
19 bool notification_timeout_triggered () {
20@@ -438,6 +447,8 @@
21 }
22
23 void transfer_changed (Transfer transfer) {
24+ if (transfer.finished)
25+ add_dock_item_count (-1);
26 if (transfer.succeeded) {
27 /* FIXME: The following 2 blocks ought to be done in core */
28 if (transfer.action == Midori.DownloadType.OPEN) {
29
30=== modified file 'extensions/wscript_build'
31--- extensions/wscript_build 2013-05-14 17:52:15 +0000
32+++ extensions/wscript_build 2013-05-31 11:02:29 +0000
33@@ -35,7 +35,7 @@
34 obj.target = target
35 obj.includes = '.. ../katze ../midori'
36 obj.source = source
37- obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML GRANITE'
38+ obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML GRANITE UNITY'
39 if 'vala' in source:
40 obj.env.append_value ('CCFLAGS', '-w')
41 obj.vapi_dirs = '../midori ../katze'
42@@ -50,6 +50,8 @@
43 obj.packages += ' webkitgtk-3.0'
44 if bld.env['HAVE_GRANITE']:
45 obj.packages += ' granite'
46+ if bld.env['HAVE_UNITY']:
47+ obj.packages += ' unity'
48 obj.install_path = '${LIBDIR}/midori'
49 # See LINKFLAGS in wscript: w/ o it we get several "undefined reference" errors
50 if bld.env['platform'] == 'win32':
51
52=== modified file 'midori/midori-view.c'
53--- midori/midori-view.c 2013-05-30 16:40:15 +0000
54+++ midori/midori-view.c 2013-05-31 11:02:29 +0000
55@@ -4067,7 +4067,8 @@
56 LIBNOTIFY_VERSION));
57 midori_view_add_version (markup, html, g_strdup_printf ("gcr %s\tgranite %s",
58 GCR_VERSION, GRANITE_VERSION));
59- midori_view_add_version (markup, html, g_strdup_printf ("single instance %s",
60+ midori_view_add_version (markup, html, g_strdup_printf ("unity %s\tsingle instance %s",
61+ UNITY_VERSION,
62 #if HAVE_UNIQUE
63 "libunique " UNIQUE_VERSION
64 #else
65
66=== modified file 'wscript'
67--- wscript 2013-05-30 19:20:29 +0000
68+++ wscript 2013-05-31 11:02:29 +0000
69@@ -212,6 +212,16 @@
70 conf.define ('GRANITE_VERSION', 'No')
71 conf.check_message_custom ('granite', '', 'disabled')
72
73+ if option_enabled ('unity'):
74+ if not check_pkg ('unity', mandatory=False):
75+ option_checkfatal ('unity', 'dock badges')
76+ else:
77+ conf.env.append_value ('VALAFLAGS', '-D HAVE_UNITY')
78+ else:
79+ conf.define ('UNITY_VERSION', 'No')
80+ conf.check_message_custom ('unity', '', 'disabled')
81+ conf.define ('HAVE_UNITY', [0,1][conf.env['UNITY_VERSION'] != 'No'])
82+
83 if option_enabled ('zeitgeist'):
84 check_pkg ('zeitgeist-1.0', '0.3.14')
85 else:
86@@ -423,6 +433,7 @@
87 add_enable_option ('tests', 'install tests', group, disable=True)
88 add_enable_option ('gtk3', 'GTK+3 and WebKitGTK+3 support', group, disable=True)
89 add_enable_option ('webkit2', 'WebKit2 support', group, disable=True)
90+ add_enable_option ('unity', 'dock badges', group)
91 add_enable_option ('zeitgeist', 'Zeitgeist history integration', group, disable=is_win32 (os.environ))
92
93 # Provided for compatibility

Subscribers

People subscribed via source and target branches

to all changes: