[frogr] Fixed mistake that broke account selection mechanism



commit b99899fb87e8c5ea614c8ddbc586f7bbf2552f01
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Sun Apr 24 19:40:29 2011 -0700

    Fixed mistake that broke account selection mechanism

 src/frogr-main-view.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 76e7c51..d29fac6 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -164,6 +164,7 @@ gboolean _on_icon_view_button_press_event (GtkWidget *widget,
                                            GdkEventButton *event,
                                            gpointer data);
 
+void _on_account_menu_item_activate (GtkWidget *widget, gpointer self);
 void _on_menu_item_activate (GtkWidget *widget, gpointer self);
 void _on_check_menu_item_toggled (GtkCheckMenuItem *item, gpointer self);
 
@@ -514,7 +515,7 @@ _populate_accounts_submenu (FrogrMainView *self)
 
       g_object_set_data (G_OBJECT (menu_item), "frogr-account", account);
       g_signal_connect (G_OBJECT (menu_item), "activate",
-                        G_CALLBACK (_on_menu_item_activate),
+                        G_CALLBACK (_on_account_menu_item_activate),
                         self);
       gtk_menu_shell_append (GTK_MENU_SHELL (priv->accounts_menu), menu_item); 
     }
@@ -852,6 +853,24 @@ _on_icon_view_button_press_event (GtkWidget *widget,
 }
 
 void
+_on_account_menu_item_activate (GtkWidget *widget, gpointer self)
+{
+  FrogrMainViewPrivate *priv = NULL;
+  FrogrAccount *account = NULL;
+
+  priv = FROGR_MAIN_VIEW_GET_PRIVATE (self);
+  account = g_object_get_data (G_OBJECT (widget), "frogr-account");
+
+  if (account && FROGR_IS_ACCOUNT (account))
+    {
+      frogr_controller_set_active_account (priv->controller, account);
+      DEBUG ("Selected account %s (%s)",
+             frogr_account_get_id (account),
+             frogr_account_get_username (account));
+    }
+}
+
+void
 _on_menu_item_activate (GtkWidget *widget, gpointer self)
 {
   FrogrMainView *mainview = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]