Merge lp:~ken-vandine/evolution-indicator/unity_counter into lp:evolution-indicator

Proposed by Ken VanDine
Status: Merged
Approved by: Ted Gould
Approved revision: 80
Merged at revision: 77
Proposed branch: lp:~ken-vandine/evolution-indicator/unity_counter
Merge into: lp:evolution-indicator
Diff against target: 97 lines (+38/-0)
2 files modified
configure.ac (+1/-0)
src/evolution-indicator.c (+37/-0)
To merge this branch: bzr merge lp:~ken-vandine/evolution-indicator/unity_counter
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+50821@code.launchpad.net

Description of the change

* Added the total count to the unity launcher
* updated to use libnotify >= 0.7.0

To post a comment you must log in.
80. By Ken VanDine

Revert change to move to libnotify >= 0.7.0, until evolution is ported it appears the plugins need to use the same libnotify.

Revision history for this message
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2011-02-07 15:30:00 +0000
+++ configure.ac 2011-02-25 18:26:44 +0000
@@ -66,6 +66,7 @@
66 libnotify66 libnotify
67 libcanberra67 libcanberra
68 gtkhtml-editor-3.1468 gtkhtml-editor-3.14
69 unity
69 )70 )
70AC_SUBST(DEPS_CFLAGS)71AC_SUBST(DEPS_CFLAGS)
71AC_SUBST(DEPS_LIBS)72AC_SUBST(DEPS_LIBS)
7273
=== modified file 'src/evolution-indicator.c'
--- src/evolution-indicator.c 2011-02-07 15:30:00 +0000
+++ src/evolution-indicator.c 2011-02-25 18:26:44 +0000
@@ -46,6 +46,8 @@
46#include <libindicate/indicator.h>46#include <libindicate/indicator.h>
47#include <libindicate/indicator-messages.h>47#include <libindicate/indicator-messages.h>
4848
49#include <unity.h>
50
49#include "xutils.h"51#include "xutils.h"
5052
51#define CONF_DIR "/apps/evolution/eplugin/evolution_indicator"53#define CONF_DIR "/apps/evolution/eplugin/evolution_indicator"
@@ -71,6 +73,8 @@
71static GSList *indicators = NULL;73static GSList *indicators = NULL;
72static gint n_accounts = 0;74static gint n_accounts = 0;
7375
76static UnityLauncherEntry *launcher = NULL;
77
74static NotifyNotification *notification = NULL;78static NotifyNotification *notification = NULL;
75static ca_context *canberra_cxt = NULL;79static ca_context *canberra_cxt = NULL;
76static ca_proplist *canberra_props = NULL;80static ca_proplist *canberra_props = NULL;
@@ -276,6 +280,8 @@
276 }280 }
277 }281 }
278282
283 update_unity_launcher_count ();
284
279 /* Show bubble */285 /* Show bubble */
280 if (show_bubble)286 if (show_bubble)
281 {287 {
@@ -358,9 +364,37 @@
358 }364 }
359 message_count = 0;365 message_count = 0;
360366
367 update_unity_launcher_count ();
368
361 g_static_mutex_unlock (&mlock);369 g_static_mutex_unlock (&mlock);
362}370}
363371
372void
373update_unity_launcher_count ()
374{
375 GSList *i;
376 int count = 0;
377
378 g_debug ("EI: update_unity_launcher_count");
379
380 for (i = indicators; i; i = i->next)
381 {
382 IndicateIndicator *indicator = i->data;
383
384 count = count + get_indicator_unread_count (indicator);
385
386 g_debug ("EI: Setting count to %d unread messages", count);
387
388 }
389 unity_launcher_entry_set_count (launcher, count);
390 if (count > 0)
391 {
392 unity_launcher_entry_set_count_visible (launcher, TRUE);
393 } else {
394 unity_launcher_entry_set_count_visible (launcher, FALSE);
395 }
396}
397
364/*398/*
365 * GCONF CLIENTS399 * GCONF CLIENTS
366 */400 */
@@ -731,6 +765,8 @@
731 dbusmenu_server_set_root(menu_server, root);765 dbusmenu_server_set_root(menu_server, root);
732 indicate_server_set_menu(server, menu_server);766 indicate_server_set_menu(server, menu_server);
733767
768 launcher = unity_launcher_entry_get_for_desktop_file (EVOLUTION_DESKTOP_FILE);
769
734 client = gconf_client_get_default ();770 client = gconf_client_get_default ();
735 gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);771 gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);
736772
@@ -998,6 +1034,7 @@
9981034
999 }1035 }
1000 message_count = 0;1036 message_count = 0;
1037 update_unity_launcher_count ();
1001 }1038 }
1002 else1039 else
1003 {1040 {

Subscribers

People subscribed via source and target branches