[anjuta] am-project: bgo #645076 - Run dialog doesn't work with python project
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] am-project: bgo #645076 - Run dialog doesn't work with python project
- Date: Sat, 19 Mar 2011 21:34:39 +0000 (UTC)
commit 801c2cdd47e1613777398f3a771adb1a2fc98235
Author: Sébastien Granjoux <seb sfo free fr>
Date: Sat Mar 19 21:44:16 2011 +0100
am-project: bgo #645076 - Run dialog doesn't work with python project
plugins/am-project/am-project.c | 12 +++++++-----
plugins/project-manager/plugin.c | 20 +++++++++++++++++++-
plugins/project-manager/project-util.c | 2 +-
plugins/run-program/parameters.c | 4 ++--
4 files changed, 29 insertions(+), 9 deletions(-)
---
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index a9f1cff..1cc9bf6 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -178,7 +178,7 @@ static AmpNodeInfo AmpNodeInformations[] = {
"_DATA",
"data"},
- {{ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_EXECUTABLE | ANJUTA_PROJECT_SCRIPT,
+ {{ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_SCRIPT,
N_("Script"),
"text/x-shellscript"},
AM_TOKEN__SCRIPTS,
@@ -1030,7 +1030,7 @@ project_load_sources (AmpProject *project, AnjutaProjectNode *parent, AnjutaToke
}
static AnjutaToken*
-project_load_data (AmpProject *project, AnjutaProjectNode *parent, AnjutaToken *variable, GHashTable *orphan_properties)
+project_load_data (AmpProject *project, AnjutaProjectNode *parent, AnjutaToken *variable, GHashTable *orphan_properties, gint data_flags)
{
gchar *install = NULL;
AmpTargetNode *target;
@@ -1091,7 +1091,7 @@ project_load_data (AmpProject *project, AnjutaProjectNode *parent, AnjutaToken *
/* Create source */
src_file = g_file_get_child (parent_file, value);
- source = amp_node_new (parent, ANJUTA_PROJECT_SOURCE | ANJUTA_PROJECT_PROJECT, src_file, NULL, NULL);
+ source = amp_node_new (parent, ANJUTA_PROJECT_SOURCE | ANJUTA_PROJECT_PROJECT | data_flags, src_file, NULL, NULL);
g_object_unref (src_file);
if (source != NULL)
{
@@ -1304,9 +1304,11 @@ amp_project_set_am_variable (AmpProject* project, AmpGroupNode* group, AnjutaTok
case AM_TOKEN__MANS:
case AM_TOKEN__PYTHON:
case AM_TOKEN__JAVA:
- case AM_TOKEN__SCRIPTS:
case AM_TOKEN__TEXINFOS:
- project_load_data (project, ANJUTA_PROJECT_NODE (group), variable, orphan_properties);
+ project_load_data (project, ANJUTA_PROJECT_NODE (group), variable, orphan_properties, 0);
+ break;
+ case AM_TOKEN__SCRIPTS:
+ project_load_data (project, ANJUTA_PROJECT_NODE (group), variable, orphan_properties, ANJUTA_PROJECT_EXECUTABLE);
break;
case AM_TOKEN__LIBRARIES:
case AM_TOKEN__LTLIBRARIES:
diff --git a/plugins/project-manager/plugin.c b/plugins/project-manager/plugin.c
index 6f44a4c..3357bd0 100644
--- a/plugins/project-manager/plugin.c
+++ b/plugins/project-manager/plugin.c
@@ -1860,13 +1860,31 @@ iproject_manager_get_elements (IAnjutaProjectManager *project_manager,
AnjutaProjectNodeType element_type,
GError **err)
{
+ GList *nodes, *node;
ProjectManagerPlugin *plugin;
g_return_val_if_fail (ANJUTA_IS_PLUGIN (project_manager), NULL);
plugin = ANJUTA_PLUGIN_PROJECT_MANAGER (G_OBJECT (project_manager));
- return gbf_project_util_replace_by_file (gbf_project_util_node_all (anjuta_pm_project_get_root (plugin->project), element_type));
+ /* Get all nodes */
+ nodes = gbf_project_util_node_all (anjuta_pm_project_get_root (plugin->project), element_type);
+
+ /* Replace all nodes by their corresponding URI */
+ for (node = g_list_first (nodes); node != NULL; node = g_list_next (node))
+ {
+ if (anjuta_project_node_get_node_type (ANJUTA_PROJECT_NODE (node->data)) == ANJUTA_PROJECT_TARGET)
+ {
+ /* Take care of different build directory */
+ node->data = get_element_file_from_node (plugin, ANJUTA_PROJECT_NODE (node->data), IANJUTA_BUILDER_ROOT_URI);
+ }
+ else
+ {
+ node->data = g_object_ref (anjuta_project_node_get_file (ANJUTA_PROJECT_NODE (node->data)));
+ }
+ }
+
+ return nodes;
}
static AnjutaProjectNodeType
diff --git a/plugins/project-manager/project-util.c b/plugins/project-manager/project-util.c
index 70fd6cf..1beb7c5 100644
--- a/plugins/project-manager/project-util.c
+++ b/plugins/project-manager/project-util.c
@@ -68,7 +68,7 @@ gbf_project_util_node_all (AnjutaProjectNode *parent, AnjutaProjectNodeType type
{
GList *child_list;
- if (anjuta_project_node_get_node_type (node) == type_type)
+ if ((type_type == 0) || (anjuta_project_node_get_node_type (node) == type_type))
{
gint type;
diff --git a/plugins/run-program/parameters.c b/plugins/run-program/parameters.c
index 592864a..39648df 100644
--- a/plugins/run-program/parameters.c
+++ b/plugins/run-program/parameters.c
@@ -681,8 +681,8 @@ run_dialog_init (RunDialog *dlg, RunProgramPlugin *plugin)
IAnjutaProjectManager, NULL);
if (pm != NULL)
{
- exec_targets = ianjuta_project_manager_get_targets (pm,
- ANJUTA_PROJECT_TARGET | ANJUTA_PROJECT_EXECUTABLE,
+ exec_targets = ianjuta_project_manager_get_elements (pm,
+ ANJUTA_PROJECT_EXECUTABLE,
NULL);
}
if (exec_targets != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]