[maemo-commits] [maemo-commits] r9683 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . data libhildondesktop src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Feb 6 15:38:30 EET 2007
Author: moimart
Date: 2007-02-06 15:38:28 +0200 (Tue, 06 Feb 2007)
New Revision: 9683

Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c
Log:

	* src/hd-panel-window-dialog.c:
        - Listening to new signal "queued-button" instead GtkContainer's "add"
        * libhildondesktop/hildon-desktop-panel.c:
        - Fixed "add-button" signal.
        * libhildondesktop/hildon-desktop-panel-expandable.c:
        - Emit new signal "queued-button" whenever a button is queued to be in
        the statusbar panel
        * data/statusbar.conf: add presence plugin
	* ChangeLog updated.



Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-02-06 13:33:58 UTC (rev 9682)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-02-06 13:38:28 UTC (rev 9683)
@@ -1,3 +1,14 @@
+2007-02-06  Moises Martinez  <moises.martinez at nokia.com>
+
+	* src/hd-panel-window-dialog.c:
+	- Listening to new signal "queued-button" instead GtkContainer's "add"
+	* libhildondesktop/hildon-desktop-panel.c:
+	- Fixed "add-button" signal.
+	* libhildondesktop/hildon-desktop-panel-expandable.c:
+	- Emit new signal "queued-button" whenever a button is queued to be in
+	the statusbar panel
+	* data/statusbar.conf: add presence plugin
+
 2007-02-06  Johan Bilien  <johan.bilien at nokia.com>
 
 	Ported from hildon-libs to libhildon-1 and GTK+ 2.10

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf	2007-02-06 13:33:58 UTC (rev 9682)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf	2007-02-06 13:38:28 UTC (rev 9683)
@@ -1,4 +1,4 @@
-[/usr/share/applications/hildon-status-bar/contact.desktop]
+[/usr/share/applications/hildon-status-bar/presence.desktop]
 [/usr/share/applications/hildon-status-bar/hildon-status-bar-battery.desktop]
 [/usr/share/applications/hildon-status-bar/hildon-status-bar-usb.desktop]
 [/usr/share/applications/hildon-status-bar/sound.desktop]

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c	2007-02-06 13:33:58 UTC (rev 9682)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c	2007-02-06 13:38:28 UTC (rev 9683)
@@ -38,6 +38,14 @@
 
 G_DEFINE_TYPE (HildonDesktopPanelExpandable, hildon_desktop_panel_expandable, HILDON_DESKTOP_TYPE_PANEL);
 
+enum 
+{
+  SIGNAL_QUEUED_BUTTON,
+  N_SIGNALS
+};
+
+static gint signals[N_SIGNALS];
+
 struct _HildonDesktopPanelExpandablePrivate
 {
   guint       items_p_row;
@@ -126,6 +134,14 @@
                                                      7,
                                                      G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
 
+  signals[SIGNAL_QUEUED_BUTTON] =
+        g_signal_new("queued-button",
+                     G_OBJECT_CLASS_TYPE(object_class),
+                     G_SIGNAL_RUN_FIRST,
+		     0, NULL, NULL,
+                     g_cclosure_marshal_VOID__OBJECT,
+                     G_TYPE_NONE, 1, GTK_TYPE_WIDGET);
+
 }
 
 static void 
@@ -283,6 +299,8 @@
   HildonDesktopPanelExpandable *ex_panel = HILDON_DESKTOP_PANEL_EXPANDABLE (panel);
   gint item_width,item_height;
 
+  g_signal_emit_by_name (ex_panel, "queued-button", button);
+
   g_debug ("Adding button in expandable %d %d",ex_panel->priv->items_p_row,ex_panel->priv->n_items+1);
 
   g_object_get (G_OBJECT (panel), "item_width", &item_width, "item_height", &item_height, NULL);
@@ -296,14 +314,6 @@
 
   g_object_set (G_OBJECT (item), "position", ex_panel->priv->current_position++, NULL);
 
-  if (STATUSBAR_IS_ITEM (button))
-  {
-    g_signal_connect_after (STATUSBAR_ITEM (item),
-		            "hildon-status-bar-update-conditional",
-		            G_CALLBACK (hildon_desktop_panel_expandable_arrange_items_cb),
-		            (gpointer)ex_panel);
-  }
-
   if ((ex_panel->priv->n_items+1) > ex_panel->priv->items_p_row)
   {
     if (ex_panel->priv->arrow == NULL)
@@ -334,6 +344,12 @@
   
   if (g_hash_table_lookup (ex_panel->priv->items, HILDON_DESKTOP_ITEM (item)->id) == NULL)
   {
+    if (STATUSBAR_IS_ITEM (button))
+      g_signal_connect_after (STATUSBAR_ITEM (item),
+		              "hildon-status-bar-update-conditional",
+		              G_CALLBACK (hildon_desktop_panel_expandable_arrange_items_cb),
+		              (gpointer)ex_panel);
+	  
     if (STATUSBAR_IS_ITEM (button) && !STATUSBAR_ITEM (button)->condition)
     {	  
       gtk_object_sink (GTK_OBJECT (item));
@@ -344,8 +360,6 @@
 			 HILDON_DESKTOP_ITEM (item)->id,
 			 (gpointer)item);
   }
-
-  g_debug ("Number of items: %d",ex_panel->priv->n_items);
 }
 
 static void 
@@ -440,7 +454,7 @@
 hildon_desktop_panel_expandable_arrange_items (HildonDesktopPanelExpandable *panel)
 {
   /*TODO: Improve this!! This horribly slow!!!!! */
-	
+  
   GList *children_panel, *children_table, *l;
 
   panel->priv->queued_items = children_panel = children_table = NULL;
@@ -475,9 +489,6 @@
      	         (GCompareFunc)hildon_desktop_panel_expandable_sort_items);
 
   for (l = panel->priv->queued_items; l; l = g_list_next (l))
-    g_debug ("position %s: %d",HILDON_DESKTOP_ITEM (l->data)->id, HILDON_DESKTOP_PANEL_ITEM (l->data)->position); 
-
-  for (l = panel->priv->queued_items; l; l = g_list_next (l))
   {
     hildon_desktop_panel_expandable_add_button (HILDON_DESKTOP_PANEL (panel),
 		      			        GTK_WIDGET (l->data));

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel.c	2007-02-06 13:33:58 UTC (rev 9682)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel.c	2007-02-06 13:38:28 UTC (rev 9683)
@@ -125,8 +125,8 @@
                      G_SIGNAL_RUN_FIRST,
 		     G_STRUCT_OFFSET (HildonDesktopPanelClass,add_button),
                      NULL, NULL,
-                     g_cclosure_marshal_VOID__POINTER,
-                     G_TYPE_NONE, 0);
+                     g_cclosure_marshal_VOID__OBJECT,
+                     G_TYPE_NONE, 1, GTK_TYPE_WIDGET);
  
 
   g_object_class_install_property (object_class,

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c	2007-02-06 13:33:58 UTC (rev 9682)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-panel-window-dialog.c	2007-02-06 13:38:28 UTC (rev 9683)
@@ -30,6 +30,7 @@
 #include <glib-object.h>
 #include <gtk/gtk.h>
 
+#include <libhildondesktop/hildon-desktop-panel-expandable.h>
 #include "hd-panel-window-dialog.h"
 
 #define HD_PANEL_WINDOW_DIALOG_GET_PRIVATE(obj) \
@@ -83,7 +84,7 @@
 #endif
 
 static void
-hd_panel_window_dialog_cadd (GtkContainer *container,
+hd_panel_window_dialog_cadd (HildonDesktopPanelExpandable *container,
 		      GtkWidget *widget,
 		      gpointer user_data)
 {
@@ -106,7 +107,7 @@
                                                                        params);
 
   g_signal_connect (G_OBJECT (HILDON_DESKTOP_WINDOW (object)->container), 
-                    "add",
+                    "queued-button",
                     G_CALLBACK (hd_panel_window_dialog_cadd),
                     NULL);
 


More information about the maemo-commits mailing list