[anjuta] tools: Remove warning action group already exist



commit eac67c5da966be77caaa4b2673b35d9dd2a346b4
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Tue Jan 19 21:46:02 2010 +0100

    tools: Remove warning action group already exist

 plugins/tools/plugin.c |    6 ++++++
 plugins/tools/plugin.h |    1 +
 plugins/tools/tool.c   |   13 ++++---------
 plugins/tools/tool.h   |    2 +-
 4 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/plugins/tools/plugin.c b/plugins/tools/plugin.c
index bfa7dad..b9f1c6c 100644
--- a/plugins/tools/plugin.c
+++ b/plugins/tools/plugin.c
@@ -285,6 +285,12 @@ atp_plugin_get_app_window (const ATPPlugin *this)
 	return GTK_WINDOW (ANJUTA_PLUGIN (this)->shell);
 }
 
+GtkActionGroup*
+atp_plugin_get_action_group (const ATPPlugin *this)
+{
+	return this->action_group;
+}
+
 ATPToolList*
 atp_plugin_get_tool_list (const ATPPlugin* this)
 {
diff --git a/plugins/tools/plugin.h b/plugins/tools/plugin.h
index 65c2e50..d73cbd1 100644
--- a/plugins/tools/plugin.h
+++ b/plugins/tools/plugin.h
@@ -52,5 +52,6 @@ struct _ATPToolDialog* atp_plugin_get_tool_dialog (const ATPPlugin *this);
 struct _ATPVariable* atp_plugin_get_variable (const ATPPlugin *this);
 struct _ATPContextList* atp_plugin_get_context_list (const ATPPlugin *this);
 GtkWindow* atp_plugin_get_app_window (const ATPPlugin *this);
+GtkActionGroup* atp_plugin_get_action_group (const ATPPlugin *this);
 
 #endif
diff --git a/plugins/tools/tool.c b/plugins/tools/tool.c
index 82f3a34..bfe3e25 100644
--- a/plugins/tools/tool.c
+++ b/plugins/tools/tool.c
@@ -720,12 +720,12 @@ atp_user_tool_deactivate (ATPUserTool* this, AnjutaUI *ui)
 	if (this->merge_id != 0)	
 	{
 		gtk_ui_manager_remove_ui (GTK_UI_MANAGER (ui), this->merge_id);
-		gtk_ui_manager_remove_action_group (GTK_UI_MANAGER (ui), this->action_group);
+		gtk_action_group_remove_action (this->action_group, this->action);
 	}
 }
 
 gboolean
-atp_user_tool_activate (ATPUserTool *this, GtkAccelGroup *group, AnjutaUI *ui)
+atp_user_tool_activate (ATPUserTool *this, GtkActionGroup *action_group, AnjutaUI *ui)
 {
 	gchar *menuitem_path;	
 
@@ -734,7 +734,7 @@ atp_user_tool_activate (ATPUserTool *this, GtkAccelGroup *group, AnjutaUI *ui)
 
 	/* Create new menu item */
 	this->action = gtk_action_new (this->name, this->name, this->name, NULL);
-	this->action_group = gtk_action_group_new ("ActionGroupTools");
+	this->action_group = action_group;
 
 	if (this->accel_key != 0)
 	{
@@ -748,8 +748,6 @@ atp_user_tool_activate (ATPUserTool *this, GtkAccelGroup *group, AnjutaUI *ui)
 		gtk_action_group_add_action (this->action_group, this->action);
 	}
 
-	gtk_ui_manager_insert_action_group (GTK_UI_MANAGER (ui), this->action_group, 0);
-
 	this->merge_id = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (ui));
 	gtk_ui_manager_add_ui (GTK_UI_MANAGER (ui), 
 							this->merge_id,
@@ -924,13 +922,10 @@ gboolean
 atp_tool_list_activate (ATPToolList *this)
 {
 	ATPUserTool *next;
-	GtkAccelGroup* group;
-
-	group = anjuta_ui_get_accel_group (this->ui);
 
 	for (next = atp_tool_list_first (this); next != NULL; next = atp_user_tool_next (next))
 	{
-		atp_user_tool_activate (next, group, this->ui);
+		atp_user_tool_activate (next, atp_plugin_get_action_group (this->plugin), this->ui);
 	}
 
 	return TRUE;
diff --git a/plugins/tools/tool.h b/plugins/tools/tool.h
index 8fd5a2c..ea3de18 100644
--- a/plugins/tools/tool.h
+++ b/plugins/tools/tool.h
@@ -116,7 +116,7 @@ void atp_user_tool_free(ATPUserTool *tool);
 ATPUserTool *atp_user_tool_append_new (ATPUserTool* this, const gchar *name, ATPToolStore storage);
 ATPUserTool *atp_user_tool_clone_new (ATPUserTool* this, ATPToolStore storage);
 
-gboolean atp_user_tool_activate (ATPUserTool* this, GtkAccelGroup* group, AnjutaUI *ui);
+gboolean atp_user_tool_activate (ATPUserTool* this, GtkActionGroup *action_group, AnjutaUI *ui);
 void atp_user_tool_deactivate (ATPUserTool* this, AnjutaUI *ui);
 
 gboolean atp_user_tool_move_after (ATPUserTool* this, ATPUserTool* position);



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