Commit 109b017d authored by Naba Kumar's avatar Naba Kumar

Added two new prject attributes: project.config.blocked and

	* src/project_config.h, project_config.c,
	  src/project_dbase.h, project_dbase.h
	  scripts/anjuta_project.template:

	  Added two new prject attributes: project.config.blocked and
	  project.excluded.modules. The former will make sure that users
	  are not given any previlidge in enabling the 'overwrite build
	  files' flags and the later issues a list of modules in the project
	  to be skipped for symbol browsing and project listing.

	* configure.in, scripts/anjuta_import.sh, scripts/Makefile.am:

	  Modified script to read the template from the anjuta data dir
	  rather than from the directory in which the script exist. Otherwise,
	  Being transfered to the bin dir, the script will not be able to
	  find the template when it is run.

	  The script is also create with configure.in to set in the anjuta
	  data dir path inside the script.
parent 8e64f02c
......@@ -6,6 +6,26 @@
Added freeze() and thaw() for the message window class to
speed up the message manager update.
* src/project_config.h, project_config.c,
src/project_dbase.h, project_dbase.h
scripts/anjuta_project.template:
Added two new prject attributes: project.config.blocked and
project.excluded.modules. The former will make sure that users
are not given any previlidge in enabling the 'overwrite build
files' flags and the later issues a list of modules in the project
to be skipped for symbol browsing and project listing.
* configure.in, scripts/anjuta_import.sh, scripts/Makefile.am:
Modified script to read the template from the anjuta data dir
rather than from the directory in which the script exist. Otherwise,
Being transfered to the bin dir, the script will not be able to
find the template when it is run.
The script is also create with configure.in to set in the anjuta
data dir path inside the script.
2002-01-26 Stephane Demurget <demurgets@free.fr>
* po/fr.po: updated to the latest sources.
......
......@@ -380,10 +380,10 @@ data/Makefile
data/properties/Makefile
doc/Makefile
scripts/Makefile
scripts/anjuta_import.sh
launcher/Makefile
plugins/Makefile
plugins/sample1/Makefile
plugins/class-gen/Makefile
anjuta.desktop.in
])
......@@ -4,4 +4,4 @@ bin_SCRIPTS = anjuta_import.sh
anjuta_data_DATA = anjuta_project.template
EXTRA_DIST = $(anjuta_data_DATA) $(bin_SCRIPTS)
EXTRA_DIST = $(anjuta_data_DATA)
......@@ -5,7 +5,10 @@
# This file can be freely copied for any purpose. There are NO guarantees.
#
TEMPLATE="$(dirname $0)/anjuta_project.template"
# Template file is in data dir, so:
# TEMPLATE="$(dirname $0)/anjuta_project.template"
TEMPLATE="/usr/share/anjuta/anjuta_project.template"
PROGRAM=anjuta
DIR=${1:-"."}
TMPFILE=/tmp/$PROGRAM.$$.tmp
......
......@@ -32,6 +32,10 @@ project.version=${AN_PROJECT_VERSION:-"0.1"}
project.author=${AN_PROJECT_AUTHOR:-"$(whoami)"}
project.source.target=${AN_PROJECT_TARGET:-"unknown"}
'#' List of modules '('directory or files')' to be excluded from
'#' symbol browsing and project listing.
project.excluded.modules=intl
project.has.gettext=${AN_HAVE_GETTEXT:-"0"}
project.programming.language=${AN_PROJECT_LANGUAGE:-"C"}
......@@ -46,6 +50,11 @@ project.configure.options=
anjuta.program.arguments=
'#' This project has been blocked from overwriting the build files.
'#' To unblock it, set it to 0, but at the same time, please make
'#' sure to edit it properly.
project.config.blocked=1
project.config.disable.overwriting=1 1 1 1 1 1 1 1 1
project.config.extra.modules.before=
project.config.extra.modules.after=
......
......@@ -40,6 +40,7 @@ project_config_new (void)
{
pc->disable_overwrite[i] = FALSE;
}
pc->blocked = FALSE;
pc->description = NULL;
pc->config_progs = NULL;
pc->config_libs = NULL;
......@@ -169,6 +170,15 @@ project_config_sync (ProjectConfig * pc)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(pc->widgets.disable_overwrite_check[i]), pc->disable_overwrite[i]);
}
if (pc->blocked)
{
for (i = 0; i < BUILD_FILE_END_MARK; i++)
{
gtk_widget_set_sensitive (pc->widgets.disable_overwrite_check[i],
FALSE);
}
}
gtk_editable_delete_text (GTK_EDITABLE(pc->widgets.description_text), 0, -1);
if (pc->description)
gtk_text_insert (GTK_TEXT (pc->widgets.description_text), NULL, NULL, NULL, pc->description, -1);
......@@ -298,6 +308,9 @@ project_config_save (ProjectConfig * pc, FILE* stream)
g_return_val_if_fail (pc != NULL, FALSE);
g_return_val_if_fail (stream != NULL, FALSE);
if (fprintf (stream, "project.config.blocked=%d\n\n", (int) pc->blocked) <1)
return FALSE;
fprintf (stream, "project.config.disable.overwriting=");
for (i = 0; i < BUILD_FILE_END_MARK; i++)
{
......@@ -351,11 +364,16 @@ project_config_set_disable_overwrite_all (ProjectConfig* pc, gboolean disable)
gboolean
project_config_load (ProjectConfig * pc, PropsID props)
{
g_return_val_if_fail (pc != NULL, FALSE);
/* Is the project configuration blocked? */
pc->blocked = prop_get_int (props, "project.config.blocked", 0);
if (pc->blocked == 0)
{
GList *list, *node;
gint i;
g_return_val_if_fail (pc != NULL, FALSE);
/* Do not call project_config_clear() */
/* Because we have already loaded the scripts */
list = glist_from_data (props, "project.config.disable.overwriting");
......@@ -388,7 +406,13 @@ project_config_load (ProjectConfig * pc, PropsID props)
return FALSE;
}
glist_strings_free (list);
}
else
{
int i;
for (i = 0; i < BUILD_FILE_END_MARK; i++)
pc->disable_overwrite[i] = 1;
}
pc->extra_modules_before = prop_get (props, "project.config.extra.modules.before");
pc->extra_modules_after = prop_get (props, "project.config.extra.modules.after");
project_config_sync (pc);
......
......@@ -62,6 +62,8 @@ struct _ProjectConfig
{
ProjectConfigWidgets widgets;
gboolean blocked;
gboolean disable_overwrite[BUILD_FILE_END_MARK];
gchar* description;
......
......@@ -346,6 +346,7 @@ project_dbase_new (PropsID pr_props)
p->win_height = 400;
p->top_proj_dir = NULL;
p->current_file_data = NULL;
p->excluded_modules = NULL;
create_project_dbase_gui (p);
gtk_window_set_title (GTK_WINDOW (p->widgets.window),
......@@ -476,6 +477,10 @@ project_dbase_clear (ProjectDBase * p)
string_assign (&p->top_proj_dir, NULL);
string_assign (&p->proj_filename, NULL);
prop_clear (p->props);
if (p->excluded_modules) {
glist_strings_free(p->excluded_modules);
p->excluded_modules = NULL;
}
gtk_window_set_title (GTK_WINDOW (p->widgets.window),
_("Project: None"));
p->project_is_open = FALSE;
......@@ -828,6 +833,11 @@ done:
string_free (str);
p->is_saved = TRUE;
p->top_proj_dir = g_dirname (p->proj_filename);
if (p->excluded_modules)
glist_strings_free(p->excluded_modules);
p->excluded_modules = glist_from_data (p->props, "project.excluded.modules");
compiler_options_load (app->compiler_options, p->props);
src_paths_load (app->src_paths, p->props);
/* Project loading completed */
......@@ -942,6 +952,20 @@ project_dbase_save_project (ProjectDBase * p)
goto error_show;
g_free (str); str = NULL;
fprintf (fp, "project.excluded.modules=");
if (p->excluded_modules) {
GList* node;
node = p->excluded_modules;
while (node)
{
if (node->data)
if (fprintf (fp, "\\\n\t%s", (gchar*)node->data) < 1)
goto error_show;
node = g_list_next (node);
}
}
fprintf (fp, "\n\n");
str = prop_get (p->props, "project.has.gettext");
if (!str) str = g_strdup ("1");
if (fprintf (fp, "project.has.gettext=%s\n\n", str) < 1)
......
......@@ -139,6 +139,7 @@ struct _ProjectDBase
gdouble progress_state;
PrjModule sel_module;
gboolean m_prj_ShowLocal; /* Cfg to show local variables */
GList* excluded_modules;
};
extern gchar* module_map[];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment