remaked take notification with dbus
[livewp] / applet / src / livewp-actor.c
index f37ea91..916880f 100644 (file)
@@ -141,16 +141,12 @@ int get_notify_count(gchar *notify_type)
     }
     return result;
 }
-
-void 
-change_billboard(Actor * actor, AWallpaperPlugin *desktop_plugin)
+void read_notification(AWallpaperPlugin *desktop_plugin)
 {
-    GtkWidget *label;
-    gchar *message = NULL, *mes = NULL;
-    PangoFontDescription *pfd = NULL;
+    gchar *message = NULL;
     gint count = 0;
     
-    label = actor->image;
+    fprintf(stderr, "read notification \n");
     count = get_notify_count("missed");
     if (count > 0){
         message = g_strdup_printf("%s: %d", _("Missed calls"), count);
@@ -179,18 +175,29 @@ change_billboard(Actor * actor, AWallpaperPlugin *desktop_plugin)
             message = g_strdup_printf("%s: %d", _("Missed mail"), count);
         }
     }
+    desktop_plugin->priv->scene->notification = g_strdup(message);
+    g_free(message);
+}
 
-    //fprintf(stderr, "message = %s", message);
-    if (message){
-        mes = g_markup_printf_escaped("<span bgcolor=\"%s\" foreground=\"%s\">%s</span>", "#FFFFFF", "#000000", message);
+void 
+change_billboard(Actor * actor, AWallpaperPlugin *desktop_plugin)
+{
+    GtkWidget *label;
+    gchar *mes = NULL;
+    PangoFontDescription *pfd = NULL;
+    
+    
+    if (desktop_plugin->priv->scene->notification){
+        label = actor->image;
+        mes = g_markup_printf_escaped("<span bgcolor=\"%s\" foreground=\"%s\">%s</span>", "#FFFFFF", "#000000", 
+                                      desktop_plugin->priv->scene->notification);
         gtk_label_set_markup(GTK_LABEL(label), mes);
-        g_free(message);
-        pfd = pango_font_description_from_string("Sans 14");
+        pfd = pango_font_description_from_string("Sans 16");
         gtk_widget_modify_font(GTK_WIDGET(label), NULL);
         gtk_widget_modify_font(GTK_WIDGET(label), pfd);
         pango_font_description_free(pfd);
-        actor->time_start_animation = time(NULL) + 20;    
     }
+    actor->time_start_animation = time(NULL) + 20;    
 }