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
=== modified file 'extensions/transfers.vala'
--- extensions/transfers.vala 2013-05-30 18:07:54 +0000
+++ extensions/transfers.vala 2013-05-31 11:02:29 +0000
@@ -420,6 +420,15 @@
420 transfer.changed.connect (transfer_changed);420 transfer.changed.connect (transfer_changed);
421 array.remove_item.connect (transfer_removed);421 array.remove_item.connect (transfer_removed);
422 array.add_item (transfer);422 array.add_item (transfer);
423 add_dock_item_count (1);
424 }
425
426 void add_dock_item_count (int count_diff) {
427#if HAVE_UNITY
428 var dock = Unity.LauncherEntry.get_for_desktop_id (PACKAGE_NAME + ".desktop");
429 dock.count += count_diff;
430 dock.count_visible = dock.count > 0;
431#endif
423 }432 }
424433
425 bool notification_timeout_triggered () {434 bool notification_timeout_triggered () {
@@ -438,6 +447,8 @@
438 }447 }
439448
440 void transfer_changed (Transfer transfer) {449 void transfer_changed (Transfer transfer) {
450 if (transfer.finished)
451 add_dock_item_count (-1);
441 if (transfer.succeeded) {452 if (transfer.succeeded) {
442 /* FIXME: The following 2 blocks ought to be done in core */453 /* FIXME: The following 2 blocks ought to be done in core */
443 if (transfer.action == Midori.DownloadType.OPEN) {454 if (transfer.action == Midori.DownloadType.OPEN) {
444455
=== modified file 'extensions/wscript_build'
--- extensions/wscript_build 2013-05-14 17:52:15 +0000
+++ extensions/wscript_build 2013-05-31 11:02:29 +0000
@@ -35,7 +35,7 @@
35 obj.target = target35 obj.target = target
36 obj.includes = '.. ../katze ../midori'36 obj.includes = '.. ../katze ../midori'
37 obj.source = source37 obj.source = source
38 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:39 if 'vala' in source:
40 obj.env.append_value ('CCFLAGS', '-w')40 obj.env.append_value ('CCFLAGS', '-w')
41 obj.vapi_dirs = '../midori ../katze'41 obj.vapi_dirs = '../midori ../katze'
@@ -50,6 +50,8 @@
50 obj.packages += ' webkitgtk-3.0'50 obj.packages += ' webkitgtk-3.0'
51 if bld.env['HAVE_GRANITE']:51 if bld.env['HAVE_GRANITE']:
52 obj.packages += ' granite'52 obj.packages += ' granite'
53 if bld.env['HAVE_UNITY']:
54 obj.packages += ' unity'
53 obj.install_path = '${LIBDIR}/midori'55 obj.install_path = '${LIBDIR}/midori'
54 # See LINKFLAGS in wscript: w/ o it we get several "undefined reference" errors56 # See LINKFLAGS in wscript: w/ o it we get several "undefined reference" errors
55 if bld.env['platform'] == 'win32':57 if bld.env['platform'] == 'win32':
5658
=== modified file 'midori/midori-view.c'
--- midori/midori-view.c 2013-05-30 16:40:15 +0000
+++ midori/midori-view.c 2013-05-31 11:02:29 +0000
@@ -4067,7 +4067,8 @@
4067 LIBNOTIFY_VERSION));4067 LIBNOTIFY_VERSION));
4068 midori_view_add_version (markup, html, g_strdup_printf ("gcr %s\tgranite %s",4068 midori_view_add_version (markup, html, g_strdup_printf ("gcr %s\tgranite %s",
4069 GCR_VERSION, GRANITE_VERSION));4069 GCR_VERSION, GRANITE_VERSION));
4070 midori_view_add_version (markup, html, g_strdup_printf ("single instance %s",4070 midori_view_add_version (markup, html, g_strdup_printf ("unity %s\tsingle instance %s",
4071 UNITY_VERSION,
4071 #if HAVE_UNIQUE4072 #if HAVE_UNIQUE
4072 "libunique " UNIQUE_VERSION4073 "libunique " UNIQUE_VERSION
4073 #else4074 #else
40744075
=== modified file 'wscript'
--- wscript 2013-05-30 19:20:29 +0000
+++ wscript 2013-05-31 11:02:29 +0000
@@ -212,6 +212,16 @@
212 conf.define ('GRANITE_VERSION', 'No')212 conf.define ('GRANITE_VERSION', 'No')
213 conf.check_message_custom ('granite', '', 'disabled')213 conf.check_message_custom ('granite', '', 'disabled')
214214
215 if option_enabled ('unity'):
216 if not check_pkg ('unity', mandatory=False):
217 option_checkfatal ('unity', 'dock badges')
218 else:
219 conf.env.append_value ('VALAFLAGS', '-D HAVE_UNITY')
220 else:
221 conf.define ('UNITY_VERSION', 'No')
222 conf.check_message_custom ('unity', '', 'disabled')
223 conf.define ('HAVE_UNITY', [0,1][conf.env['UNITY_VERSION'] != 'No'])
224
215 if option_enabled ('zeitgeist'):225 if option_enabled ('zeitgeist'):
216 check_pkg ('zeitgeist-1.0', '0.3.14')226 check_pkg ('zeitgeist-1.0', '0.3.14')
217 else:227 else:
@@ -423,6 +433,7 @@
423 add_enable_option ('tests', 'install tests', group, disable=True)433 add_enable_option ('tests', 'install tests', group, disable=True)
424 add_enable_option ('gtk3', 'GTK+3 and WebKitGTK+3 support', group, disable=True)434 add_enable_option ('gtk3', 'GTK+3 and WebKitGTK+3 support', group, disable=True)
425 add_enable_option ('webkit2', 'WebKit2 support', group, disable=True)435 add_enable_option ('webkit2', 'WebKit2 support', group, disable=True)
436 add_enable_option ('unity', 'dock badges', group)
426 add_enable_option ('zeitgeist', 'Zeitgeist history integration', group, disable=is_win32 (os.environ))437 add_enable_option ('zeitgeist', 'Zeitgeist history integration', group, disable=is_win32 (os.environ))
427438
428 # Provided for compatibility439 # Provided for compatibility

Subscribers

People subscribed via source and target branches

to all changes: