[totem] main: Make menu items for sidebars work



commit 0153c055d5ba88c65a7b22a729ba46805ed4eb42
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 9 18:52:16 2011 +0100

    main: Make menu items for sidebars work

 src/totem-sidebar.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-sidebar.c b/src/totem-sidebar.c
index b94fc24..d6edbc7 100644
--- a/src/totem-sidebar.c
+++ b/src/totem-sidebar.c
@@ -158,6 +158,15 @@ totem_sidebar_setup (Totem *totem, gboolean visible, const char *page_id)
 		gtk_widget_hide (totem->sidebar);
 }
 
+static void
+action_activated (GtkAction *action,
+		  Totem     *totem)
+{
+	totem_sidebar_set_current_page (totem,
+					gtk_action_get_name (action),
+					TRUE);
+}
+
 void
 totem_sidebar_add_page (Totem *totem,
 			const char *page_id,
@@ -188,6 +197,8 @@ totem_sidebar_add_page (Totem *totem,
 				 label,
 				 NULL,
 				 NULL);
+	g_signal_connect (G_OBJECT (action), "activate",
+			  G_CALLBACK (action_activated), totem);
 
 	uimanager = totem_get_ui_manager (totem);
 	merge_id = gtk_ui_manager_new_merge_id (uimanager);



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