Hide the Profile button.
authorSalvatore Iovene <siovene@mini.(none)>
Sun, 10 Jan 2010 12:57:46 +0000 (14:57 +0200)
committerSalvatore Iovene <siovene@mini.(none)>
Sun, 10 Jan 2010 12:57:46 +0000 (14:57 +0200)
modules/tweakr-profile-status-menu-widget.c

index 75e2634..8ccce3e 100644 (file)
@@ -173,10 +173,27 @@ _button_clicked (HildonButton *b, TweakrProfileStatusPlugin *plugin)
 }
 
 static void
+_hide_profile_button (GtkWidget *widget,
+                      TweakrProfileStatusPlugin *plugin)
+{
+    if (HILDON_IS_BUTTON (widget))
+    {
+        const gchar *title;
+
+        title = hildon_button_get_title (HILDON_BUTTON (widget));
+        if (g_strcmp0 (title, dgettext ("Hildon", "general_profile")) == 0)
+        {
+            gtk_widget_hide (widget);
+        }
+    }
+}
+
+static void
 _create_main_button (TweakrProfileStatusPlugin *plugin)
 {
     gchar *current;
     GtkWidget *image;
+    GtkWidget *container;
 
     plugin->priv->button = hildon_button_new
         (HILDON_SIZE_AUTO | HILDON_SIZE_FINGER_HEIGHT,
@@ -200,6 +217,13 @@ _create_main_button (TweakrProfileStatusPlugin *plugin)
                       G_CALLBACK (_button_clicked), plugin);
 
     gtk_container_add (GTK_CONTAINER (plugin), plugin->priv->button);
+
+    /* Now go ahead and hide the real Profile button. Nasty, I know. */
+    container = gtk_widget_get_ancestor (plugin->priv->button,
+                                         GTK_TYPE_CONTAINER);
+    gtk_container_foreach (GTK_CONTAINER (container),
+                           (GtkCallback) _hide_profile_button,
+                           plugin);
     gtk_widget_show_all (plugin->priv->button);
 }