[anjuta] build-basic-autotools: Update environment variables when the build configuration is changed
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] build-basic-autotools: Update environment variables when the build configuration is changed
- Date: Sat, 27 Oct 2012 07:55:57 +0000 (UTC)
commit 40a59af356a276560f3fdfd4ad845c4cd4216480
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Sat Oct 27 09:54:56 2012 +0200
build-basic-autotools: Update environment variables when the build configuration is changed
libanjuta/anjuta-environment-editor.c | 13 +++++++++++++
libanjuta/anjuta-environment-editor.h | 1 +
plugins/build-basic-autotools/build-options.c | 1 +
3 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libanjuta/anjuta-environment-editor.c b/libanjuta/anjuta-environment-editor.c
index 1f7997d..9a27f14 100644
--- a/libanjuta/anjuta-environment-editor.c
+++ b/libanjuta/anjuta-environment-editor.c
@@ -795,3 +795,16 @@ anjuta_environment_editor_get_modified_variables (AnjutaEnvironmentEditor *edito
return mod_var;
}
+
+/*
+ * anjuta_environment_editor_reset:
+ * @editor: A AnjutaEnvironmentEditor widget
+ *
+ * Remove all variables modified by the user
+ */
+void
+anjuta_environment_editor_reset (AnjutaEnvironmentEditor *editor)
+{
+ gtk_list_store_clear (GTK_LIST_STORE (editor->model));
+ load_environment_variables (editor, GTK_LIST_STORE (editor->model));
+}
diff --git a/libanjuta/anjuta-environment-editor.h b/libanjuta/anjuta-environment-editor.h
index 1da3ad6..76754b0 100644
--- a/libanjuta/anjuta-environment-editor.h
+++ b/libanjuta/anjuta-environment-editor.h
@@ -49,6 +49,7 @@ GtkWidget* anjuta_environment_editor_new (void);
void anjuta_environment_editor_set_variable (AnjutaEnvironmentEditor *editor, const gchar *variable);
gchar** anjuta_environment_editor_get_all_variables (AnjutaEnvironmentEditor *editor);
gchar** anjuta_environment_editor_get_modified_variables (AnjutaEnvironmentEditor *editor);
+void anjuta_environment_editor_reset (AnjutaEnvironmentEditor *editor);
G_END_DECLS
diff --git a/plugins/build-basic-autotools/build-options.c b/plugins/build-basic-autotools/build-options.c
index 4716103..cb89da5 100644
--- a/plugins/build-basic-autotools/build-options.c
+++ b/plugins/build-basic-autotools/build-options.c
@@ -279,6 +279,7 @@ on_select_configuration (GtkComboBox *widget, gpointer user_data)
build_gtk_file_chooser_create_and_set_uri (GTK_FILE_CHOOSER (dlg->build_dir_chooser), uri);
g_free (uri);
+ anjuta_environment_editor_reset (ANJUTA_ENVIRONMENT_EDITOR (dlg->env_editor));
for (item = build_configuration_get_variables (cfg); item != NULL; item = g_list_next (item))
{
anjuta_environment_editor_set_variable (ANJUTA_ENVIRONMENT_EDITOR (dlg->env_editor), (gchar *)item->data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]