[anjuta] project-manager: Enable project action if at least one node is able to do it
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] project-manager: Enable project action if at least one node is able to do it
- Date: Thu, 3 Feb 2011 21:59:27 +0000 (UTC)
commit 7286d9edf7bc995ace31d6ccbbbf1951f3816fce
Author: Sébastien Granjoux <seb sfo free fr>
Date: Thu Feb 3 22:54:47 2011 +0100
project-manager: Enable project action if at least one node is able to do it
plugins/project-manager/project.c | 9 ++++++++-
plugins/project-manager/project.h | 2 ++
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/plugins/project-manager/project.c b/plugins/project-manager/project.c
index ca0296a..6908f28 100644
--- a/plugins/project-manager/project.c
+++ b/plugins/project-manager/project.c
@@ -51,6 +51,9 @@ static void
on_pm_project_load_incomplete (AnjutaProjectNode *node, AnjutaPmProject *project)
{
gint state = anjuta_project_node_get_state (node);
+
+ /* Get capabilities for all existing node */
+ project->node_capabilities |= state;
if ((state & ANJUTA_PROJECT_INCOMPLETE) && !(state & ANJUTA_PROJECT_LOADING))
{
@@ -229,7 +232,8 @@ anjuta_pm_project_unload (AnjutaPmProject *project, GError **error)
if (project->project) g_object_unref (project->project);
project->project = NULL;
project->loaded = FALSE;
-
+ project->node_capabilities = 0;
+
/* Remove project properties dialogs */
if (project->properties_dialog != NULL) gtk_widget_destroy (project->properties_dialog);
project->properties_dialog = NULL;
@@ -281,6 +285,9 @@ anjuta_pm_project_get_capabilities (AnjutaPmProject *project)
}
}
+ /* Make sure that at least one node can do it */
+ caps &= project->node_capabilities;
+
return caps;
}
diff --git a/plugins/project-manager/project.h b/plugins/project-manager/project.h
index 4238c63..a5c8bb8 100644
--- a/plugins/project-manager/project.h
+++ b/plugins/project-manager/project.h
@@ -63,6 +63,8 @@ struct _AnjutaPmProject
guint incomplete_node;
gboolean loaded;
+
+ gint node_capabilities;
/* project properties dialog */
GtkWidget *properties_dialog;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]