[gnumeric] GUI: Action debug code.



commit 3e85b843727cdbc9100578fbf05c5644a63033e3
Author: Morten Welinder <terra gnome org>
Date:   Wed Feb 1 15:57:16 2012 -0500

    GUI: Action debug code.

 src/wbc-gtk-actions.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index c4bc9f9..6db2b45 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -65,6 +65,7 @@
 #include "print.h"
 #include "print-info.h"
 #include "gnm-pane-impl.h"
+#include "gutils.h"
 
 #include <goffice/goffice.h>
 #include <goffice/component/goffice-component.h>
@@ -3001,6 +3002,21 @@ wbc_gtk_init_alignments (WBCGtk *wbcg)
 	gtk_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->valignment));
 }
 
+static void
+list_actions (GtkActionGroup *group)
+{
+	GList *actions = gtk_action_group_list_actions (group);
+	GList *l;
+
+	for (l = actions; l; l = l->next) {
+		GtkAction *act = l->data;
+		const char *name = gtk_action_get_name (act);
+		g_printerr ("Action %s\n", name);
+	}
+
+	g_list_free (actions);
+}
+
 /****************************************************************************/
 
 void
@@ -3033,4 +3049,16 @@ wbc_gtk_init_actions (WBCGtk *wbcg)
 		semi_permanent_toggle_actions, G_N_ELEMENTS (semi_permanent_toggle_actions), wbcg);
 
 	wbc_gtk_init_alignments (wbcg);
+
+	if (gnm_debug_flag ("actions")) {
+		list_actions (wbcg->permanent_actions);
+		list_actions (wbcg->actions);
+		list_actions (wbcg->font_actions);
+		list_actions (wbcg->data_only_actions);
+		list_actions (wbcg->semi_permanent_actions);
+		list_actions (wbcg->file_history.actions);
+		list_actions (wbcg->toolbar.actions);
+		list_actions (wbcg->windows.actions);
+		list_actions (wbcg->templates.actions);
+	}
 }



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