[anjuta] am-project: bgo #681050 - Double click on folder in project view open properties window



commit 1deef8e58e6eb644594bb991f4cdc254b281a03f
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Mon Oct 15 21:57:20 2012 +0200

    am-project: bgo #681050 - Double click on folder in project view open properties window

 plugins/project-manager/plugin.c       |    4 ++--
 plugins/project-manager/project-view.c |   25 ++++++++++++++++++++++---
 2 files changed, 24 insertions(+), 5 deletions(-)
---
diff --git a/plugins/project-manager/plugin.c b/plugins/project-manager/plugin.c
index d36c87d..058e8b0 100644
--- a/plugins/project-manager/plugin.c
+++ b/plugins/project-manager/plugin.c
@@ -866,7 +866,7 @@ on_popup_add_to_project (GtkAction *action, ProjectManagerPlugin *plugin)
 }
 
 static void
-on_node_selected (GtkWidget *widget, AnjutaProjectNode *node,
+on_node_activated (GtkWidget *widget, AnjutaProjectNode *node,
 				  ProjectManagerPlugin *plugin)
 {
 	IAnjutaFileLoader *loader;
@@ -1575,7 +1575,7 @@ project_manager_plugin_activate_plugin (AnjutaPlugin *plugin)
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
 	gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
 	g_signal_connect (view, "node-selected",
-					  G_CALLBACK (on_node_selected), plugin);
+					  G_CALLBACK (on_node_activated), plugin);
 	g_signal_connect (selection, "changed",
 					  G_CALLBACK (on_treeview_selection_changed), plugin);
 	g_signal_connect (view, "button-press-event",
diff --git a/plugins/project-manager/project-view.c b/plugins/project-manager/project-view.c
index 278560c..d68c4d8 100644
--- a/plugins/project-manager/project-view.c
+++ b/plugins/project-manager/project-view.c
@@ -316,9 +316,28 @@ row_activated (GtkTreeView       *tree_view,
 	node = gbf_tree_data_get_node (data);
 	if (node)
 	{
-		g_signal_emit (G_OBJECT (tree_view),
-			       signals [NODE_SELECTED], 0,
-			       node);
+		switch (anjuta_project_node_get_node_type (node))
+		{
+		case ANJUTA_PROJECT_GROUP:
+		case ANJUTA_PROJECT_ROOT:
+		case ANJUTA_PROJECT_TARGET:
+		case ANJUTA_PROJECT_MODULE:
+		case ANJUTA_PROJECT_PACKAGE:
+			if (!gtk_tree_view_row_expanded (tree_view, path))
+			{
+				gtk_tree_view_expand_row (tree_view, path, FALSE);
+			}
+			else
+			{
+				gtk_tree_view_collapse_row (tree_view, path);
+			}
+			break;
+		default:	
+			g_signal_emit (G_OBJECT (tree_view),
+			               signals [NODE_SELECTED], 0,
+			               node);
+			break;
+		}
 	}
 }
 



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