[anjuta] pm: Add package and module properties dialog



commit 782bf1adb6c46f05f9f5de98f3d7304770792d75
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Thu Nov 25 22:51:32 2010 +0100

    pm: Add package and module properties dialog

 plugins/project-manager/dialogs.c       |   21 ++++++++++++++++--
 plugins/project-manager/project-model.c |    4 +-
 plugins/project-manager/project.c       |   35 +------------------------------
 plugins/project-manager/project.h       |    1 -
 4 files changed, 21 insertions(+), 40 deletions(-)
---
diff --git a/plugins/project-manager/dialogs.c b/plugins/project-manager/dialogs.c
index b8e5143..3563fa1 100644
--- a/plugins/project-manager/dialogs.c
+++ b/plugins/project-manager/dialogs.c
@@ -490,6 +490,7 @@ create_properties_table (IAnjutaProject *project, AnjutaProjectNode *node)
 	GtkWidget *main_table;
 	GtkWidget *extra_table;
 	GtkWidget *extra_expand;
+	GFile *file;
 
 	gint main_pos;
 	gint extra_pos;
@@ -517,9 +518,17 @@ create_properties_table (IAnjutaProject *project, AnjutaProjectNode *node)
 	extra_pos = 0;
 
 	/* Always display node name */
-	path = g_file_get_path (anjuta_project_node_get_file (node));
-	add_label (_("Full Name:"), path, main_table, &main_pos);
-	g_free (path);
+	file = anjuta_project_node_get_file (node);
+	if (file != NULL)
+	{
+		path = g_file_get_path (file);
+		add_label (_("Path:"), path, main_table, &main_pos);
+		g_free (path);
+	}
+	else
+	{
+		add_label (_("Name:"), anjuta_project_node_get_name (node), main_table, &main_pos);
+	}
 
 	/* Display node type only if several types are possible */
 	node_info = NULL;
@@ -674,6 +683,12 @@ pm_project_create_properties_dialog (AnjutaPmProject *project, GtkWindow *parent
 	case ANJUTA_PROJECT_SOURCE:
 		title = _("Source properties");
 		break;
+	case ANJUTA_PROJECT_MODULE:
+		title = _("Module properties");
+		break;
+	case ANJUTA_PROJECT_PACKAGE:
+		title = _("Package properties");
+		break;
 	default:
 		return NULL;
 	}
diff --git a/plugins/project-manager/project-model.c b/plugins/project-manager/project-model.c
index ab3005c..34b0839 100644
--- a/plugins/project-manager/project-model.c
+++ b/plugins/project-manager/project-model.c
@@ -516,7 +516,7 @@ add_target_shortcut (GbfProjectModel *model,
 			    -1);
 	
 	/* add sources */
-	parent = anjuta_pm_project_get_node (model->priv->proj, target);
+	parent = gbf_tree_data_get_node (target);
 	for (node = anjuta_project_node_first_child (parent); node; node = anjuta_project_node_next_sibling (node))
 		add_source (model, node, &iter);
 
@@ -574,7 +574,7 @@ move_target_shortcut (GbfProjectModel *model,
 				    -1);
 
 		/* add sources */
-		parent = anjuta_pm_project_get_node (model->priv->proj, shortcut->shortcut);
+		parent = gbf_tree_data_get_node (shortcut->shortcut);
 		for (node = anjuta_project_node_first_child (parent); node; node = anjuta_project_node_next_sibling (node))
 			add_source (model, node, iter);
 	}
diff --git a/plugins/project-manager/project.c b/plugins/project-manager/project.c
index 627455c..fc2974f 100644
--- a/plugins/project-manager/project.c
+++ b/plugins/project-manager/project.c
@@ -418,39 +418,6 @@ anjuta_pm_project_get_model (AnjutaPmProject *project)
 }
 
 AnjutaProjectNode *
-anjuta_pm_project_get_node (AnjutaPmProject *project, GbfTreeData *data)
-{
-	AnjutaProjectNode *node = NULL;
-	
-	if (data != NULL)
-	{
-		AnjutaProjectNode *root = NULL;
-		AnjutaProjectNode *group = NULL;
-		AnjutaProjectNode *target = NULL;
-
-		root = anjuta_pm_project_get_root (project);
-		if ((root != NULL) && (data->group != NULL))
-		{
-			group = anjuta_project_group_get_node_from_file (root, data->group);
-			node = group;
-		}
-
-		if ((group != NULL) && (data->target != NULL))
-		{
-			target = anjuta_project_target_get_node_from_name (group, data->target);
-			node = target;
-		}
-
-		if (((group != NULL) || (target != NULL)) && (data->source != NULL))
-		{
-			node = anjuta_project_source_get_node_from_file (target != NULL ? target : group, data->source);
-		}
-	}
-
-	return node;
-}
-
-AnjutaProjectNode *
 anjuta_pm_project_get_node_from_file (AnjutaPmProject *project, AnjutaProjectNodeType type, GFile *file)
 {
 	GtkTreeIter iter;
@@ -516,7 +483,7 @@ anjuta_pm_project_show_properties_dialog (AnjutaPmProject *project, GbfTreeData
 	{
 		/* Show node properties dialog */
 		dialog_ptr = &data->properties_dialog;
-		node = anjuta_pm_project_get_node (project, data);
+		node = gbf_tree_data_get_node (data);
 	}
 	
 	if (*dialog_ptr != NULL)
diff --git a/plugins/project-manager/project.h b/plugins/project-manager/project.h
index a84bdde..386875a 100644
--- a/plugins/project-manager/project.h
+++ b/plugins/project-manager/project.h
@@ -97,7 +97,6 @@ gboolean anjuta_pm_project_is_open (AnjutaPmProject *project);
 IAnjutaProject *anjuta_pm_project_get_project (AnjutaPmProject *project);
 GbfProjectModel *anjuta_pm_project_get_model (AnjutaPmProject *project);
 
-AnjutaProjectNode *anjuta_pm_project_get_node (AnjutaPmProject *project, GbfTreeData *data);
 AnjutaProjectNode *anjuta_pm_project_get_node_from_file (AnjutaPmProject *project, AnjutaProjectNodeType type, GFile *file);
 AnjutaProjectNode *anjuta_pm_project_get_module (AnjutaPmProject *project, const gchar *name);
 



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