← Back to team overview

ayatana-commits team mailing list archive

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

 

Ken VanDine has proposed merging lp:~ken-vandine/evolution-indicator/unity_counter into lp:evolution-indicator.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)

For more details, see:
https://code.launchpad.net/~ken-vandine/evolution-indicator/unity_counter/+merge/50821

* Added the total count to the unity launcher
* updated to use libnotify >= 0.7.0
-- 
https://code.launchpad.net/~ken-vandine/evolution-indicator/unity_counter/+merge/50821
Your team ayatana-commits is subscribed to branch lp:evolution-indicator.
=== modified file 'configure.ac'
--- configure.ac	2011-02-07 15:30:00 +0000
+++ configure.ac	2011-02-22 22:23:54 +0000
@@ -63,9 +63,10 @@
                   evolution-plugin
                   dbus-1
                   dbus-glib-1
-                  libnotify
+                  libnotify >= 0.7.0
                   libcanberra
                   gtkhtml-editor-3.14
+                  unity
                   )
 AC_SUBST(DEPS_CFLAGS)
 AC_SUBST(DEPS_LIBS)

=== modified file 'src/evolution-indicator.c'
--- src/evolution-indicator.c	2011-02-07 15:30:00 +0000
+++ src/evolution-indicator.c	2011-02-22 22:23:54 +0000
@@ -46,6 +46,8 @@
 #include <libindicate/indicator.h>
 #include <libindicate/indicator-messages.h>
 
+#include <unity.h>
+
 #include "xutils.h"
 
 #define CONF_DIR          "/apps/evolution/eplugin/evolution_indicator"
@@ -71,6 +73,8 @@
 static GSList         *indicators = NULL;
 static gint            n_accounts = 0;
 
+static UnityLauncherEntry       *launcher = NULL;
+
 static NotifyNotification *notification   = NULL;
 static ca_context         *canberra_cxt   = NULL;
 static ca_proplist        *canberra_props = NULL;
@@ -276,6 +280,8 @@
       }
     }
 
+  update_unity_launcher_count ();
+
   /* Show bubble */
   if (show_bubble)
   {
@@ -285,7 +291,7 @@
 
     if (notification == NULL)
     {
-      notification = notify_notification_new (" ", " ", "mail-unread", NULL);
+      notification = notify_notification_new (" ", " ", "mail-unread");
     }
 
     trans = g_dngettext (PACKAGE, 
@@ -358,9 +364,37 @@
     }
   message_count = 0;
 
+  update_unity_launcher_count ();
+
   g_static_mutex_unlock (&mlock);
 }
 
+void
+update_unity_launcher_count ()
+{
+  GSList *i;
+  int count = 0;
+
+  g_debug ("EI: update_unity_launcher_count");
+
+  for (i = indicators; i; i = i->next)
+  {
+    IndicateIndicator *indicator = i->data;
+
+    count = count + get_indicator_unread_count (indicator);
+
+    g_debug ("EI: Setting count to %d unread messages", count);
+
+  }
+  unity_launcher_entry_set_count (launcher, count);
+  if (count > 0)
+  {
+    unity_launcher_entry_set_count_visible (launcher, TRUE);
+  } else {
+    unity_launcher_entry_set_count_visible (launcher, FALSE);
+  }
+}
+
 /*
  * GCONF CLIENTS
  */
@@ -731,6 +765,8 @@
 	dbusmenu_server_set_root(menu_server, root);
 	indicate_server_set_menu(server, menu_server);
 
+    launcher = unity_launcher_entry_get_for_desktop_file (EVOLUTION_DESKTOP_FILE);
+
     client = gconf_client_get_default ();
     gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);
 
@@ -998,6 +1034,7 @@
 
     }
     message_count = 0;
+    update_unity_launcher_count ();
   }
   else
   {


Follow ups