adde images for notifications
authortanya <tanyshk@gmail.com>
Wed, 9 Jun 2010 13:57:21 +0000 (16:57 +0300)
committertanya <tanyshk@gmail.com>
Wed, 9 Jun 2010 13:57:21 +0000 (16:57 +0300)
applet/data/theme/Modern/call.png [new file with mode: 0644]
applet/data/theme/Modern/chat.png [new file with mode: 0644]
applet/data/theme/Modern/mail.png [new file with mode: 0644]
applet/data/theme/Modern/sms.png [new file with mode: 0644]
applet/src/livewp-actor.c
applet/src/livewp-home-widget.c
applet/src/livewp-scene.c

diff --git a/applet/data/theme/Modern/call.png b/applet/data/theme/Modern/call.png
new file mode 100644 (file)
index 0000000..80a22b7
Binary files /dev/null and b/applet/data/theme/Modern/call.png differ
diff --git a/applet/data/theme/Modern/chat.png b/applet/data/theme/Modern/chat.png
new file mode 100644 (file)
index 0000000..7abe8b9
Binary files /dev/null and b/applet/data/theme/Modern/chat.png differ
diff --git a/applet/data/theme/Modern/mail.png b/applet/data/theme/Modern/mail.png
new file mode 100644 (file)
index 0000000..b1861e5
Binary files /dev/null and b/applet/data/theme/Modern/mail.png differ
diff --git a/applet/data/theme/Modern/sms.png b/applet/data/theme/Modern/sms.png
new file mode 100644 (file)
index 0000000..70f7aa3
Binary files /dev/null and b/applet/data/theme/Modern/sms.png differ
index 83ce172..f169e0b 100644 (file)
@@ -185,19 +185,51 @@ change_billboard(Actor * actor, AWallpaperPlugin *desktop_plugin)
     GtkWidget *label;
     gchar *mes = NULL, *message = NULL;
     PangoFontDescription *pfd = NULL;
+    gint count = 0;
+    Actor *a = NULL;
      
     fprintf(stderr, "change_billboard\n");   
+    
     if (desktop_plugin->priv->scene->notification < time(NULL)){
+        count = get_notify_count("general_missed");
+        a = g_ptr_array_index(actor->child, 0);
+        if (count > 0){
+            set_actor_visible(a, TRUE);            
+        }else {
+            set_actor_visible(a, FALSE);
+        }
+        count = get_notify_count("general_sms");
+        a = g_ptr_array_index(actor->child, 3);
+        if (count > 0){
+            set_actor_visible(a, TRUE);            
+        }else {
+            set_actor_visible(a, FALSE);
+        }
+        count = get_notify_count("general_chat");
+        a = g_ptr_array_index(actor->child, 1);
+        if (count > 0){
+            set_actor_visible(a, TRUE);            
+        }else {
+            set_actor_visible(a, FALSE);
+        }
+        count = get_notify_count("qgn_list_messagin");
+        a = g_ptr_array_index(actor->child, 2);
+        if (count > 0){
+            set_actor_visible(a, TRUE);            
+        }else {
+            set_actor_visible(a, FALSE);
+        }
+
+        #if 0
         message = read_notification();
         label = actor->image;
-        mes = g_markup_printf_escaped("<span bgcolor=\"%s\" foreground=\"%s\">%s</span>", "#FFFFFF", "#000000", 
-                                      message);
+        mes = g_markup_printf_escaped("<span bgcolor=\"%s\" foreground=\"%s\">%s</span>", "#FFFFFF", "#000000", message);
         gtk_label_set_markup(GTK_LABEL(label), mes);
         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);
-
+#endif
         desktop_plugin->priv->scene->notification = FALSE;
     }
     actor->time_start_animation = time(NULL) + 20;    
index 4702ba8..aa10397 100644 (file)
@@ -174,8 +174,7 @@ create_hildon_actor_text(Actor *actor, AWallpaperPlugin *desktop_plugin)
   label = gtk_label_new(NULL);  
 
   if (label){
-    g_signal_connect(G_OBJECT(label), "expose_event",
-                           G_CALLBACK(expose_event), NULL);
+    //g_signal_connect(G_OBJECT(label), "expose_event", G_CALLBACK(expose_event), NULL);
 
     gtk_container_add (GTK_CONTAINER (ha), label);
   }  
index 30638d8..d25eed8 100644 (file)
@@ -149,6 +149,7 @@ init_scene_Modern(AWallpaperPlugin *desktop_plugin)
   gint now = time(NULL);
   gint i;
   gint winds[13][2];
+  GPtrArray *child; 
 
   //fprintf(stderr, "init scene \n");
   scene = g_new0(Scene, 1);
@@ -221,10 +222,40 @@ init_scene_Modern(AWallpaperPlugin *desktop_plugin)
   change_static_actor(actor, desktop_plugin);
   scene->actors = g_slist_append(scene->actors, actor);
 
+
+  child = g_ptr_array_sized_new(4);
+  actor = init_object(desktop_plugin, "call", "call.png", 
+                      480, 190, 9, 50, 58, 
+                      FALSE, TRUE, 100, 255, 
+                      NULL, NULL, NULL);
+  scene->actors = g_slist_append(scene->actors, actor);
+  g_ptr_array_add(child, actor);
+
+  actor = init_object(desktop_plugin, "chat", "chat.png", 
+                      540, 190, 9, 50, 58, 
+                      FALSE, TRUE, 100, 255, 
+                      NULL, NULL, NULL);
+  scene->actors = g_slist_append(scene->actors, actor);
+  g_ptr_array_add(child, actor);
+
+  actor = init_object(desktop_plugin, "mail", "mail.png", 
+                      600, 190, 9, 50, 58, 
+                      FALSE, TRUE, 100, 255, 
+                      NULL, NULL, NULL);
+  scene->actors = g_slist_append(scene->actors, actor);
+  g_ptr_array_add(child, actor);
+  
+  actor = init_object(desktop_plugin, "sms", "sms.png", 
+                      660, 190, 9, 50, 58, 
+                      FALSE, TRUE, 100, 255, 
+                      NULL, NULL, NULL);
+  scene->actors = g_slist_append(scene->actors, actor);
+  g_ptr_array_add(child, actor);
+
   actor = init_object(desktop_plugin, "billboard_text", "",
                       470, 174, 9, 300, 108,
-                      TRUE, FALSE, 100, 255,
-                      (gpointer)&change_billboard, NULL, NULL);
+                      FALSE, FALSE, 100, 255,
+                      (gpointer)&change_billboard, NULL, child);
   create_hildon_actor_text(actor, desktop_plugin);
   //actor->time_start_animation = time(NULL) + 20;
   change_billboard(actor, desktop_plugin);