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
1=== modified file 'configure.ac'
2--- configure.ac 2011-02-07 15:30:00 +0000
3+++ configure.ac 2011-02-25 18:26:44 +0000
4@@ -66,6 +66,7 @@
5 libnotify
6 libcanberra
7 gtkhtml-editor-3.14
8+ unity
9 )
10 AC_SUBST(DEPS_CFLAGS)
11 AC_SUBST(DEPS_LIBS)
12
13=== modified file 'src/evolution-indicator.c'
14--- src/evolution-indicator.c 2011-02-07 15:30:00 +0000
15+++ src/evolution-indicator.c 2011-02-25 18:26:44 +0000
16@@ -46,6 +46,8 @@
17 #include <libindicate/indicator.h>
18 #include <libindicate/indicator-messages.h>
19
20+#include <unity.h>
21+
22 #include "xutils.h"
23
24 #define CONF_DIR "/apps/evolution/eplugin/evolution_indicator"
25@@ -71,6 +73,8 @@
26 static GSList *indicators = NULL;
27 static gint n_accounts = 0;
28
29+static UnityLauncherEntry *launcher = NULL;
30+
31 static NotifyNotification *notification = NULL;
32 static ca_context *canberra_cxt = NULL;
33 static ca_proplist *canberra_props = NULL;
34@@ -276,6 +280,8 @@
35 }
36 }
37
38+ update_unity_launcher_count ();
39+
40 /* Show bubble */
41 if (show_bubble)
42 {
43@@ -358,9 +364,37 @@
44 }
45 message_count = 0;
46
47+ update_unity_launcher_count ();
48+
49 g_static_mutex_unlock (&mlock);
50 }
51
52+void
53+update_unity_launcher_count ()
54+{
55+ GSList *i;
56+ int count = 0;
57+
58+ g_debug ("EI: update_unity_launcher_count");
59+
60+ for (i = indicators; i; i = i->next)
61+ {
62+ IndicateIndicator *indicator = i->data;
63+
64+ count = count + get_indicator_unread_count (indicator);
65+
66+ g_debug ("EI: Setting count to %d unread messages", count);
67+
68+ }
69+ unity_launcher_entry_set_count (launcher, count);
70+ if (count > 0)
71+ {
72+ unity_launcher_entry_set_count_visible (launcher, TRUE);
73+ } else {
74+ unity_launcher_entry_set_count_visible (launcher, FALSE);
75+ }
76+}
77+
78 /*
79 * GCONF CLIENTS
80 */
81@@ -731,6 +765,8 @@
82 dbusmenu_server_set_root(menu_server, root);
83 indicate_server_set_menu(server, menu_server);
84
85+ launcher = unity_launcher_entry_get_for_desktop_file (EVOLUTION_DESKTOP_FILE);
86+
87 client = gconf_client_get_default ();
88 gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);
89
90@@ -998,6 +1034,7 @@
91
92 }
93 message_count = 0;
94+ update_unity_launcher_count ();
95 }
96 else
97 {

Subscribers

People subscribed via source and target branches