anjuta r4811 - in trunk: . plugins/build-basic-autotools plugins/gdb plugins/project-wizard/templates plugins/project-wizard/templates/gtk/src plugins/project-wizard/templates/gtkmm/src plugins/run-program
- From: sgranjoux svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4811 - in trunk: . plugins/build-basic-autotools plugins/gdb plugins/project-wizard/templates plugins/project-wizard/templates/gtk/src plugins/project-wizard/templates/gtkmm/src plugins/run-program
- Date: Sat, 28 Feb 2009 21:52:26 +0000 (UTC)
Author: sgranjoux
Date: Sat Feb 28 21:52:26 2009
New Revision: 4811
URL: http://svn.gnome.org/viewvc/anjuta?rev=4811&view=rev
Log:
* plugins/build-basic-autotools/plugin.c:
Fix #564282 â configure error: source directory already configured
Fix #567513 â Running configure doesn't make anjuta be aware that the
project doesn't need a configure stage in its menus
Fix #565170 â Invalid read in plugin.c
* plugins/project-wizard/templates/terminal.wiz,
plugins/project-wizard/templates/xlib-dock.wiz,
plugins/project-wizard/templates/wxwin.wiz,
plugins/project-wizard/templates/java.wiz,
plugins/project-wizard/templates/gnome-applet.wiz,
plugins/project-wizard/templates/anjuta-plugin-vala.wiz,
plugins/project-wizard/templates/anjuta-plugin.wiz,
plugins/project-wizard/templates/gtkmm.wiz,
plugins/project-wizard/templates/python.wiz,
plugins/project-wizard/templates/cpp.wiz,
plugins/project-wizard/templates/sdl.wiz,
plugins/project-wizard/templates/gtk.wiz,
plugins/project-wizard/templates/minimal.wiz,
plugins/project-wizard/templates/xlib.wiz,
plugins/project-wizard/templates/gcj.wiz:
Do not generate project in the wizard (can be easily done later)
* plugins/project-wizard/templates/gtkmm/src/main.cc,
plugins/project-wizard/templates/gtk/src/main.c,
plugins/run-program/parameters.c:
Read glade file in a directory relative to project source directory
Set by default working directory to project source directory
* plugins/project-wizard/templates/translatable-strings.h:
Remove translatable string used in the removed GNOME template
* plugins/gdb/debugger.c:
Avoid bug #573326 in one additional case
Modified:
trunk/ChangeLog
trunk/plugins/build-basic-autotools/plugin.c
trunk/plugins/gdb/debugger.c
trunk/plugins/project-wizard/templates/anjuta-plugin-vala.wiz
trunk/plugins/project-wizard/templates/anjuta-plugin.wiz
trunk/plugins/project-wizard/templates/cpp.wiz
trunk/plugins/project-wizard/templates/gcj.wiz
trunk/plugins/project-wizard/templates/gnome-applet.wiz
trunk/plugins/project-wizard/templates/gtk.wiz
trunk/plugins/project-wizard/templates/gtk/src/main.c
trunk/plugins/project-wizard/templates/gtkmm.wiz
trunk/plugins/project-wizard/templates/gtkmm/src/main.cc
trunk/plugins/project-wizard/templates/java.wiz
trunk/plugins/project-wizard/templates/minimal.wiz
trunk/plugins/project-wizard/templates/python.wiz
trunk/plugins/project-wizard/templates/sdl.wiz
trunk/plugins/project-wizard/templates/terminal.wiz
trunk/plugins/project-wizard/templates/translatable-strings.h
trunk/plugins/project-wizard/templates/wxwin.wiz
trunk/plugins/project-wizard/templates/xlib-dock.wiz
trunk/plugins/project-wizard/templates/xlib.wiz
trunk/plugins/run-program/parameters.c
Modified: trunk/plugins/build-basic-autotools/plugin.c
==============================================================================
--- trunk/plugins/build-basic-autotools/plugin.c (original)
+++ trunk/plugins/build-basic-autotools/plugin.c Sat Feb 28 21:52:26 2009
@@ -139,6 +139,18 @@
gint file_saved;
} BuildContext;
+/* Build function type */
+typedef BuildContext* (*BuildFunc) (BasicAutotoolsPlugin *plugin, const gchar *name,
+ IAnjutaBuilderCallback callback, gpointer user_data,
+ GError **err);
+
+typedef struct
+{
+ gchar *args;
+ gchar *name;
+ BuildFunc func;
+} BuildConfigureAndBuild;
+
/* Declarations */
static void update_project_ui (BasicAutotoolsPlugin *bb_plugin);
static void update_configuration_menu (BasicAutotoolsPlugin *plugin);
@@ -174,6 +186,101 @@
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle_button)));
}
+static gboolean
+project_has_configure (BasicAutotoolsPlugin *bb_plugin)
+{
+ gchar *configure;
+
+ if (bb_plugin->project_root_dir == NULL) return FALSE;
+
+ configure = g_build_filename (bb_plugin->project_root_dir, "configure.ac", NULL);
+ if (!g_file_test (configure, G_FILE_TEST_EXISTS))
+ {
+ g_free (configure);
+ configure = g_build_filename (bb_plugin->project_root_dir, "configure.in", NULL);
+ if (!g_file_test (configure, G_FILE_TEST_EXISTS))
+ {
+ g_free (configure);
+
+ return FALSE;
+ }
+ }
+ g_free (configure);
+
+ return TRUE;
+}
+
+static gboolean
+directory_has_makefile (const gchar *dirname)
+{
+ gchar *makefile;
+ gboolean makefile_exists;
+
+ makefile_exists = TRUE;
+ makefile = g_build_filename (dirname, "Makefile", NULL);
+ if (!g_file_test (makefile, G_FILE_TEST_EXISTS))
+ {
+ g_free (makefile);
+ makefile = g_build_filename (dirname, "makefile", NULL);
+ if (!g_file_test (makefile, G_FILE_TEST_EXISTS))
+ {
+ g_free (makefile);
+ makefile = g_build_filename (dirname, "MAKEFILE", NULL);
+ if (!g_file_test (makefile, G_FILE_TEST_EXISTS))
+ {
+ makefile_exists = FALSE;
+ }
+ }
+ }
+ g_free (makefile);
+ return makefile_exists;
+}
+
+static gboolean
+directory_has_file (const gchar *dirname, const gchar *filename)
+{
+ gchar *filepath;
+ gboolean exists;
+
+ exists = TRUE;
+ filepath = g_build_filename (dirname, filename, NULL);
+ if (!g_file_test (filepath, G_FILE_TEST_EXISTS))
+ exists = FALSE;
+
+ g_free (filepath);
+ return exists;
+}
+
+static gchar*
+escape_label (const gchar *str)
+{
+ GString *ret;
+ const gchar *iter;
+
+ ret = g_string_new ("");
+ iter = str;
+ while (*iter != '\0')
+ {
+ if (*iter == '_')
+ {
+ ret = g_string_append (ret, "__");
+ iter++;
+ }
+ else
+ {
+ const gchar *start;
+ const gchar *end;
+
+ start = iter;
+ iter = g_utf8_next_char (iter);
+ end = iter;
+
+ ret = g_string_append_len (ret, start, end - start);
+ }
+ }
+ return g_string_free (ret, FALSE);
+}
+
/* Indicator locations reported by the build */
static BuildIndicatorLocation*
@@ -622,8 +729,8 @@
}
down:
- i = strlen (line) - 1;
- while (isspace (line[i]) == FALSE)
+ i = strlen (line);
+ do
{
i--;
if (i < 0)
@@ -632,7 +739,7 @@
*lineno = 0;
return FALSE;
}
- }
+ } while (isspace (line[i]) == FALSE);
k = i++;
while (line[i++] != ':')
{
@@ -1351,7 +1458,7 @@
"%s %s",
CHOOSE_COMMAND (plugin, BUILD),
target ? target : "");
- if (callback) build_program_set_callback (prog, callback, user_data);
+ build_program_set_callback (prog, callback, user_data);
context = build_save_and_execute_command (plugin, prog, TRUE, err);
g_free (target);
@@ -1412,18 +1519,22 @@
static BuildContext*
build_install_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname,
+ IAnjutaBuilderCallback callback, gpointer user_data,
GError **err)
{
BuildContext *context;
gchar* root = get_root_install_command(plugin);
gchar *build_dir = build_dir_from_source (plugin, dirname);
+ BuildProgram *prog;
- context = build_save_and_execute_command (plugin,
- build_program_new_with_command (build_dir,
- "%s %s",
- root,
- CHOOSE_COMMAND (plugin, INSTALL)),
- TRUE, err);
+ prog = build_program_new_with_command (build_dir,
+ "%s %s",
+ root,
+ CHOOSE_COMMAND (plugin, INSTALL)),
+ build_program_set_callback (prog, callback, user_data);
+
+ context = build_save_and_execute_command (plugin, prog, TRUE, err);
+
g_free (build_dir);
g_free(root);
@@ -1582,31 +1693,47 @@
GError *error,
gpointer user_data)
{
- if (error != NULL) return;
-
- BuildContext *context = (BuildContext *)handle;
- BasicAutotoolsPlugin *plugin = (BasicAutotoolsPlugin *)(context == NULL ? (void *)sender : (void *)context->plugin);
- GValue *value;
- gchar *uri;
+ BuildConfigureAndBuild *pack = (BuildConfigureAndBuild *)user_data;
+
+ if (error == NULL)
+ {
+ BuildContext *context = (BuildContext *)handle;
+ BasicAutotoolsPlugin *plugin = (BasicAutotoolsPlugin *)(context == NULL ? (void *)sender : (void *)context->plugin);
+ GValue *value;
+ gchar *uri;
- /* FIXME: check if build directory correspond, configuration could have changed */
- value = g_new0 (GValue, 1);
- g_value_init (value, G_TYPE_STRING);
+ /* FIXME: check if build directory correspond, configuration could have changed */
+ value = g_new0 (GValue, 1);
+ g_value_init (value, G_TYPE_STRING);
- uri = build_configuration_list_get_build_uri (plugin->configurations, build_configuration_list_get_selected (plugin->configurations));
- g_value_set_string (value, uri);
- g_free (uri);
+ uri = build_configuration_list_get_build_uri (plugin->configurations, build_configuration_list_get_selected (plugin->configurations));
+ g_value_set_string (value, uri);
+ g_free (uri);
- anjuta_shell_add_value (ANJUTA_PLUGIN (plugin)->shell, IANJUTA_BUILDER_ROOT_URI, value, NULL);
+ anjuta_shell_add_value (ANJUTA_PLUGIN (plugin)->shell, IANJUTA_BUILDER_ROOT_URI, value, NULL);
- update_configuration_menu (plugin);
+ update_configuration_menu (plugin);
+
+ /* Call build function if necessary */
+ if ((pack) && (pack->func != NULL)) pack->func (plugin, pack->name, NULL, NULL, NULL);
+ }
+
+ if (pack)
+ {
+ g_free (pack->args);
+ g_free (pack->name);
+ g_free (pack);
+ }
}
static BuildContext*
-build_configure_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname, const gchar *args)
+build_configure_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname, const gchar *args,
+ BuildFunc func, const gchar *name)
{
BuildContext *context;
BuildProgram *prog;
+ BuildConfigureAndBuild *pack = g_new(BuildConfigureAndBuild, 1);
+
prog = build_program_new_with_command (dirname,
"%s%s%s %s",
@@ -1614,7 +1741,10 @@
G_DIR_SEPARATOR_S,
CHOOSE_COMMAND (plugin, CONFIGURE),
args);
- build_program_set_callback (prog, build_project_configured, NULL);
+ pack->args = NULL;
+ pack->func = func;
+ pack->name = g_strdup (name);
+ build_program_set_callback (prog, build_project_configured, pack);
context = build_save_and_execute_command (plugin, prog, TRUE, NULL);
@@ -1629,23 +1759,29 @@
GError *error,
gpointer user_data)
{
+ BuildConfigureAndBuild *pack = (BuildConfigureAndBuild *)user_data;
+
if (error == NULL)
{
BuildContext *context = (BuildContext *)handle;
BasicAutotoolsPlugin *plugin = (BasicAutotoolsPlugin *)context->plugin;
struct stat conf_stat, log_stat;
gchar *filename;
+ gboolean has_configure;
filename = g_build_filename (plugin->project_root_dir, "configure", NULL);
- if (stat (filename, &conf_stat) != 0)
- {
- anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (plugin)->shell), _("Can not configure project: Missing configure script in %s."), plugin->project_root_dir);
- }
- else
+ has_configure = stat (filename, &conf_stat) == 0;
+ g_free (filename);
+
+ if (has_configure)
{
- g_free (filename);
+ gboolean older;
+
filename = g_build_filename (context->program->work_dir, "config.log", NULL);
- if ((stat (filename, &log_stat) != 0) || (log_stat.st_mtime < conf_stat.st_mtime))
+ older =(stat (filename, &log_stat) != 0) || (log_stat.st_mtime < conf_stat.st_mtime);
+ g_free (filename);
+
+ if (older)
{
/* configure has not be run, run it */
BuildProgram *prog;
@@ -1655,23 +1791,38 @@
plugin->project_root_dir,
G_DIR_SEPARATOR_S,
CHOOSE_COMMAND (plugin, CONFIGURE),
- (gchar *)user_data);
- build_program_set_callback (prog, build_project_configured, NULL);
+ pack != NULL ? pack->args : NULL);
+ build_program_set_callback (prog, build_project_configured, pack);
build_set_command_in_context (context, prog);
build_execute_command_in_context (context, NULL);
}
+ else
+ {
+ /* run next command if needed */
+ build_project_configured (sender, handle, NULL, pack);
+ }
+
+ return;
}
- g_free (filename);
+ anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (plugin)->shell), _("Can not configure project: Missing configure script in %s."), plugin->project_root_dir);
+ }
+
+ if (pack)
+ {
+ g_free (pack->args);
+ g_free (pack->name);
+ g_free (pack);
}
- g_free (user_data);
}
static BuildContext*
-build_generate_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname, const gchar *args)
+build_generate_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname, const gchar *args,
+ BuildFunc func, const gchar *name)
{
BuildContext *context;
BuildProgram *prog;
+ BuildConfigureAndBuild *pack = g_new (BuildConfigureAndBuild, 1);
if (directory_has_file (plugin->project_root_dir, "autogen.sh"))
{
@@ -1689,48 +1840,18 @@
CHOOSE_COMMAND (plugin, AUTORECONF),
args);
}
- build_program_set_callback (prog, build_configure_after_autogen, g_strdup (args));
+ pack->args = g_strdup (args);
+ pack->func = func;
+ pack->name = g_strdup (name);
+ build_program_set_callback (prog, build_configure_after_autogen, pack);
context = build_save_and_execute_command (plugin, prog, TRUE, NULL);
return context;
}
-
-
-/* User actions
- *---------------------------------------------------------------------------*/
-
-/* Main menu */
-static void
-on_build_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
-{
- if (plugin->project_root_dir)
- {
- build_build_file_or_dir (plugin, plugin->project_root_dir, NULL, NULL, NULL);
- }
-}
-
-static void
-on_install_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
-{
- if (plugin->project_root_dir)
- {
- build_install_dir (plugin, plugin->project_root_dir, NULL);
- }
-}
-
static void
-on_clean_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
-{
- if (plugin->project_root_dir)
- {
- build_clean_dir (plugin, plugin->project_root_dir, NULL);
- }
-}
-
-static void
-on_configure_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
+build_configure_dialog (BasicAutotoolsPlugin *plugin, BuildFunc func, const gchar *name)
{
GtkWindow *parent;
gboolean run_autogen = FALSE;
@@ -1763,20 +1884,101 @@
if (run_autogen)
{
- build_generate_dir (plugin, build_dir, args);
+ build_generate_dir (plugin, build_dir, args, func, name);
}
else
{
- build_configure_dir (plugin, build_dir, args);
+ build_configure_dir (plugin, build_dir, args, func, name);
}
g_free (build_dir);
}
+
+}
+
+/* Run configure if needed and then the build command */
+static void
+build_configure_and_build (BasicAutotoolsPlugin *plugin, BuildFunc func, const gchar *name)
+{
+ const gchar *src_dir;
+ gchar *dir = NULL;
+ gchar *build_dir;
+ gboolean has_makefile;
+
+ /* Find source directory */
+ if (name == NULL)
+ {
+ /* Could be NULL for global project command */
+ src_dir = plugin->project_root_dir;
+ }
+ else if (g_file_test (name, G_FILE_TEST_IS_DIR))
+ {
+ src_dir = name;
+ }
+ else
+ {
+ dir = g_path_get_dirname (name);
+ src_dir = dir;
+ }
+
+ /* Get build directory and check for makefiles */
+ build_dir = build_dir_from_source (plugin, src_dir);
+ has_makefile = directory_has_makefile (build_dir);
+ g_free (build_dir);
+
+ if (!has_makefile)
+ {
+ /* Run configure first */
+ build_configure_dialog (plugin, func, name);
+ }
+ else
+ {
+ /* Some build functions have less arguments but
+ * it is not a problem in C */
+ func (plugin, name, NULL, NULL, NULL);
+ }
+}
+
+/* User actions
+ *---------------------------------------------------------------------------*/
+
+/* Main menu */
+static void
+on_build_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
+{
+ if (plugin->project_root_dir)
+ {
+ build_configure_and_build (plugin, build_build_file_or_dir, plugin->project_root_dir);
+ }
+}
+
+static void
+on_install_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
+{
+ if (plugin->project_root_dir)
+ {
+ build_configure_and_build (plugin, build_install_dir, plugin->project_root_dir);
+ }
+}
+
+static void
+on_clean_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
+{
+ if (plugin->project_root_dir)
+ {
+ build_clean_dir (plugin, plugin->project_root_dir, NULL);
+ }
+}
+
+static void
+on_configure_project (GtkAction *action, BasicAutotoolsPlugin *plugin)
+{
+ build_configure_dialog (plugin, NULL, NULL);
}
static void
on_build_tarball (GtkAction *action, BasicAutotoolsPlugin *plugin)
{
- build_tarball (plugin);
+ build_configure_and_build (plugin, (BuildFunc) build_tarball, NULL);
}
static void
@@ -1785,8 +1987,8 @@
if (plugin->current_editor_filename)
{
gchar *dirname = g_path_get_dirname (plugin->current_editor_filename);
-
- build_build_file_or_dir (plugin, dirname, NULL, NULL, NULL);
+
+ build_configure_and_build (plugin, build_build_file_or_dir, dirname);
g_free (dirname);
}
@@ -1799,7 +2001,7 @@
{
gchar *dirname = g_path_get_dirname (plugin->current_editor_filename);
- build_install_dir (plugin, dirname, NULL);
+ build_configure_and_build (plugin, build_install_dir, dirname);
g_free (dirname);
}
@@ -1823,7 +2025,7 @@
{
if (plugin->current_editor_filename)
{
- build_compile_file (plugin, plugin->current_editor_filename);
+ build_configure_and_build (plugin, (BuildFunc) build_compile_file, plugin->current_editor_filename);
}
}
@@ -1866,7 +2068,7 @@
if (plugin->fm_current_filename)
{
- build_compile_file (plugin, plugin->fm_current_filename);
+ build_configure_and_build (plugin, (BuildFunc) build_compile_file, plugin->fm_current_filename);
}
}
@@ -1881,8 +2083,8 @@
dir = g_strdup (plugin->fm_current_filename);
else
dir = g_path_get_dirname (plugin->fm_current_filename);
-
- build_build_file_or_dir (plugin, dir, NULL, NULL, NULL);
+
+ build_configure_and_build (plugin, build_build_file_or_dir, dir);
g_free (dir);
}
@@ -1899,7 +2101,7 @@
else
dir = g_path_get_dirname (plugin->fm_current_filename);
- build_install_dir (plugin, dir, NULL);
+ build_configure_and_build (plugin, build_install_dir, dir);
g_free (dir);
}
@@ -1929,7 +2131,7 @@
if (plugin->pm_current_filename)
{
- build_compile_file (plugin, plugin->pm_current_filename);
+ build_configure_and_build (plugin, (BuildFunc) build_compile_file, plugin->pm_current_filename);
}
}
@@ -1945,7 +2147,7 @@
else
dir = g_path_get_dirname (plugin->pm_current_filename);
- build_build_file_or_dir (plugin, dir, NULL, NULL, NULL);
+ build_configure_and_build (plugin, build_build_file_or_dir, dir);
g_free (dir);
}
@@ -1962,7 +2164,7 @@
else
dir = g_path_get_dirname (plugin->pm_current_filename);
- build_install_dir (plugin, dir, NULL);
+ build_configure_and_build (plugin, build_install_dir, dir);
g_free (dir);
}
@@ -2158,77 +2360,6 @@
}
};
-static gboolean
-directory_has_makefile (const gchar *dirname)
-{
- gchar *makefile;
- gboolean makefile_exists;
-
- makefile_exists = TRUE;
- makefile = g_build_filename (dirname, "Makefile", NULL);
- if (!g_file_test (makefile, G_FILE_TEST_EXISTS))
- {
- g_free (makefile);
- makefile = g_build_filename (dirname, "makefile", NULL);
- if (!g_file_test (makefile, G_FILE_TEST_EXISTS))
- {
- g_free (makefile);
- makefile = g_build_filename (dirname, "MAKEFILE", NULL);
- if (!g_file_test (makefile, G_FILE_TEST_EXISTS))
- {
- makefile_exists = FALSE;
- }
- }
- }
- g_free (makefile);
- return makefile_exists;
-}
-
-static gboolean
-directory_has_file (const gchar *dirname, const gchar *filename)
-{
- gchar *filepath;
- gboolean exists;
-
- exists = TRUE;
- filepath = g_build_filename (dirname, filename, NULL);
- if (!g_file_test (filepath, G_FILE_TEST_EXISTS))
- exists = FALSE;
-
- g_free (filepath);
- return exists;
-}
-
-static gchar*
-escape_label (const gchar *str)
-{
- GString *ret;
- const gchar *iter;
-
- ret = g_string_new ("");
- iter = str;
- while (*iter != '\0')
- {
- if (*iter == '_')
- {
- ret = g_string_append (ret, "__");
- iter++;
- }
- else
- {
- const gchar *start;
- const gchar *end;
-
- start = iter;
- iter = g_utf8_next_char (iter);
- end = iter;
-
- ret = g_string_append_len (ret, start, end - start);
- }
- }
- return g_string_free (ret, FALSE);
-}
-
static void
update_module_ui (BasicAutotoolsPlugin *bb_plugin)
{
@@ -2255,7 +2386,7 @@
module = escape_label (g_path_get_basename (dirname));
filename = escape_label (g_path_get_basename (bb_plugin->current_editor_filename));
- has_makefile = directory_has_makefile (build_dirname);
+ has_makefile = directory_has_makefile (build_dirname) || project_has_configure (bb_plugin);
g_free (build_dirname);
g_free (dirname);
}
@@ -2304,7 +2435,7 @@
DEBUG_PRINT ("%s", "Updating project UI");
has_project = bb_plugin->project_root_dir != NULL;
- has_makefile = has_project && directory_has_makefile (bb_plugin->project_build_dir);
+ has_makefile = has_project && (directory_has_makefile (bb_plugin->project_build_dir) || project_has_configure (bb_plugin));
ui = anjuta_shell_get_ui (ANJUTA_PLUGIN (bb_plugin)->shell, NULL);
action = anjuta_ui_get_action (ui, "ActionGroupBuild",
@@ -2463,7 +2594,7 @@
dirname = g_strdup (filename);
else
dirname = g_path_get_dirname (filename);
- makefile_exists = directory_has_makefile (dirname);
+ makefile_exists = directory_has_makefile (dirname) || project_has_configure (ba_plugin);
g_free (dirname);
if (!makefile_exists)
@@ -2527,7 +2658,7 @@
dirname = g_strdup (filename);
else
dirname = g_path_get_dirname (filename);
- makefile_exists = directory_has_makefile (dirname);
+ makefile_exists = directory_has_makefile (dirname) || project_has_configure (ba_plugin);
g_free (dirname);
if (!makefile_exists)
@@ -3032,7 +3163,7 @@
{
BasicAutotoolsPlugin *plugin = ANJUTA_PLUGIN_BASIC_AUTOTOOLS (manager);
- build_install_dir (plugin, directory, err);
+ build_install_dir (plugin, directory, NULL, NULL, err);
}
static void
@@ -3041,7 +3172,7 @@
{
BasicAutotoolsPlugin *plugin = ANJUTA_PLUGIN_BASIC_AUTOTOOLS (manager);
- build_configure_dir (plugin, directory, NULL);
+ build_configure_dir (plugin, directory, NULL, NULL, NULL);
}
static void
@@ -3050,7 +3181,7 @@
{
BasicAutotoolsPlugin *plugin = ANJUTA_PLUGIN_BASIC_AUTOTOOLS (manager);
- build_generate_dir (plugin, directory, NULL);
+ build_generate_dir (plugin, directory, NULL, NULL, NULL);
}
static void
Modified: trunk/plugins/gdb/debugger.c
==============================================================================
--- trunk/plugins/gdb/debugger.c (original)
+++ trunk/plugins/gdb/debugger.c Sat Feb 28 21:52:26 2009
@@ -760,7 +760,7 @@
g_return_val_if_fail (IS_DEBUGGER (debugger), FALSE);
- if (variables != NULL)
+ if ((variables != NULL) && (*variables != NULL))
{
for (; *variables != NULL; variables++)
{
Modified: trunk/plugins/project-wizard/templates/anjuta-plugin-vala.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/anjuta-plugin-vala.wiz (original)
+++ trunk/plugins/project-wizard/templates/anjuta-plugin-vala.wiz Sat Feb 28 21:52:26 2009
@@ -115,6 +115,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/anjuta-plugin.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/anjuta-plugin.wiz (original)
+++ trunk/plugins/project-wizard/templates/anjuta-plugin.wiz Sat Feb 28 21:52:26 2009
@@ -112,6 +112,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/cpp.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/cpp.wiz (original)
+++ trunk/plugins/project-wizard/templates/cpp.wiz Sat Feb 28 21:52:26 2009
@@ -83,6 +83,5 @@
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/gcj.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/gcj.wiz (original)
+++ trunk/plugins/project-wizard/templates/gcj.wiz Sat Feb 28 21:52:26 2009
@@ -89,6 +89,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/gnome-applet.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/gnome-applet.wiz (original)
+++ trunk/plugins/project-wizard/templates/gnome-applet.wiz Sat Feb 28 21:52:26 2009
@@ -91,6 +91,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/gtk.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/gtk.wiz (original)
+++ trunk/plugins/project-wizard/templates/gtk.wiz Sat Feb 28 21:52:26 2009
@@ -86,6 +86,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/gtk/src/main.c
==============================================================================
--- trunk/plugins/project-wizard/templates/gtk/src/main.c (original)
+++ trunk/plugins/project-wizard/templates/gtk/src/main.c Sat Feb 28 21:52:26 2009
@@ -51,7 +51,7 @@
/* For testing propose use the local (not installed) glade file */
/* #define GLADE_FILE PACKAGE_DATA_DIR"/[+NameHLower+]/glade/[+NameHLower+].glade" */
-#define GLADE_FILE "[+NameHLower+].glade"
+#define GLADE_FILE "src/[+NameHLower+].glade"
GtkWidget*
create_window (void)
Modified: trunk/plugins/project-wizard/templates/gtkmm.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/gtkmm.wiz (original)
+++ trunk/plugins/project-wizard/templates/gtkmm.wiz Sat Feb 28 21:52:26 2009
@@ -85,6 +85,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/gtkmm/src/main.cc
==============================================================================
--- trunk/plugins/project-wizard/templates/gtkmm/src/main.cc (original)
+++ trunk/plugins/project-wizard/templates/gtkmm/src/main.cc Sat Feb 28 21:52:26 2009
@@ -22,7 +22,7 @@
/* For testing propose use the local (not installed) glade file */
/* #define GLADE_FILE PACKAGE_DATA_DIR"/[+NameHLower+]/glade/[+NameHLower+].glade" */
-#define GLADE_FILE "[+NameHLower+].glade"
+#define GLADE_FILE "src/[+NameHLower+].glade"
int
main (int argc, char *argv[])
Modified: trunk/plugins/project-wizard/templates/java.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/java.wiz (original)
+++ trunk/plugins/project-wizard/templates/java.wiz Sat Feb 28 21:52:26 2009
@@ -85,6 +85,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/minimal.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/minimal.wiz (original)
+++ trunk/plugins/project-wizard/templates/minimal.wiz Sat Feb 28 21:52:26 2009
@@ -62,6 +62,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/python.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/python.wiz (original)
+++ trunk/plugins/project-wizard/templates/python.wiz Sat Feb 28 21:52:26 2009
@@ -85,6 +85,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/sdl.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/sdl.wiz (original)
+++ trunk/plugins/project-wizard/templates/sdl.wiz Sat Feb 28 21:52:26 2009
@@ -74,6 +74,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/terminal.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/terminal.wiz (original)
+++ trunk/plugins/project-wizard/templates/terminal.wiz Sat Feb 28 21:52:26 2009
@@ -74,6 +74,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/translatable-strings.h
==============================================================================
--- trunk/plugins/project-wizard/templates/translatable-strings.h (original)
+++ trunk/plugins/project-wizard/templates/translatable-strings.h Sat Feb 28 21:52:26 2009
@@ -1,6 +1,5 @@
char *s = N_("A GNOME applet project");
char *s = N_("A generic C++ project");
-char *s = N_("A generic GNOME project");
char *s = N_("A generic GTK+ project");
char *s = N_("A generic GTKmm (C++) project");
char *s = N_("A generic Xlib dock applet");
@@ -40,7 +39,6 @@
char *s = N_("Django Project information");
char *s = N_("Email address:");
char *s = N_("GCJ needs to know which class contains the main() function");
-char *s = N_("GNOME");
char *s = N_("GNOME Applet");
char *s = N_("GTK+");
char *s = N_("GTKmm");
@@ -97,9 +95,7 @@
char *s = N_("SDL");
char *s = N_("Select code license");
char *s = N_("Shell values to watch");
-char *s = N_("Use libglade for the UI");
char *s = N_("Use pkg-config to add library support from other packages");
-char *s = N_("Use the libglade-2.0 library to load the glade interface file at runtime");
char *s = N_("Value Name:");
char *s = N_("Values to watch");
char *s = N_("Version:");
Modified: trunk/plugins/project-wizard/templates/wxwin.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/wxwin.wiz (original)
+++ trunk/plugins/project-wizard/templates/wxwin.wiz Sat Feb 28 21:52:26 2009
@@ -79,6 +79,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/xlib-dock.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/xlib-dock.wiz (original)
+++ trunk/plugins/project-wizard/templates/xlib-dock.wiz Sat Feb 28 21:52:26 2009
@@ -85,6 +85,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/project-wizard/templates/xlib.wiz
==============================================================================
--- trunk/plugins/project-wizard/templates/xlib.wiz (original)
+++ trunk/plugins/project-wizard/templates/xlib.wiz Sat Feb 28 21:52:26 2009
@@ -80,6 +80,5 @@
</content>
<action>
- <run command="sh -c "cd [+(raw-shell-str (get "Destination"))+] && ./autogen.sh""/>
<open file="[+Destination+]/[+NameHLower+].anjuta"/>
</action>
Modified: trunk/plugins/run-program/parameters.c
==============================================================================
--- trunk/plugins/run-program/parameters.c (original)
+++ trunk/plugins/run-program/parameters.c Sat Feb 28 21:52:26 2009
@@ -638,7 +638,7 @@
g_object_unref (model);
/* Fill working directory list */
- g_list_foreach (plugin->recent_dirs, on_add_directory_in_chooser, dlg->dirs);
+ g_list_foreach (plugin->recent_dirs, on_add_directory_in_chooser, dlg->dirs);
if (plugin->recent_dirs != NULL) gtk_file_chooser_set_uri (dlg->dirs, (const char *)plugin->recent_dirs->data);
/* Fill target combo box */
@@ -682,6 +682,10 @@
}
g_list_free (exec_targets);
}
+
+ /* Set a default value for current dir, allowing to find glade file in
+ * new project created by the wizard without any change */
+ if (plugin->recent_dirs == NULL) gtk_file_chooser_set_uri (dlg->dirs, project_root_uri);
}
if (plugin->recent_target != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]