Check the new format

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/build-system@3183 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Lex Trotman 2008-11-07 05:20:43 +00:00
parent ffe9184fd0
commit c857941e1d

View File

@ -211,7 +211,8 @@ static GPid build_view_tex_file(GeanyDocument *doc, gint mode)
{ {
ui_set_statusbar(TRUE, ui_set_statusbar(TRUE,
_("Could not find terminal \"%s\" " _("Could not find terminal \"%s\" "
"(check path for Terminal tool setting in Preferences)"), tool_prefs.term_cmd); "(check path for Terminal tool setting in Preferences)"),
tool_prefs.term_cmd);
utils_free_pointers(executable, view_file, locale_filename, cmd_string, locale_cmd_string, utils_free_pointers(executable, view_file, locale_filename, cmd_string, locale_cmd_string,
locale_term_cmd, NULL); locale_term_cmd, NULL);
@ -310,6 +311,8 @@ static gchar *get_object_filename(GeanyDocument *doc)
return object_file; return object_file;
} }
#endif #endif
@ -433,6 +436,8 @@ static gchar *quote_executable(const gchar *cmd)
g_strfreev(fields); g_strfreev(fields);
return result; return result;
} }
#endif #endif
@ -492,7 +497,8 @@ static GPid build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d
gtk_list_store_clear(msgwindow.store_compiler); gtk_list_store_clear(msgwindow.store_compiler);
gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_COMPILER); gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_COMPILER);
msgwin_compiler_add_fmt(COLOR_BLUE, _("%s (in directory: %s)"), utf8_cmd_string, utf8_working_dir); msgwin_compiler_add_fmt(COLOR_BLUE, _(
"%s (in directory: %s)"), utf8_cmd_string, utf8_working_dir);
g_free(utf8_working_dir); g_free(utf8_working_dir);
g_free(utf8_cmd_string); g_free(utf8_cmd_string);
@ -501,8 +507,10 @@ static GPid build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d
build_info.dir = g_strdup(working_dir); build_info.dir = g_strdup(working_dir);
build_info.file_type_id = FILETYPE_ID(doc->file_type); build_info.file_type_id = FILETYPE_ID(doc->file_type);
if (! g_spawn_async_with_pipes(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, if (! g_spawn_async_with_pipes(working_dir, argv, NULL,
NULL, NULL, &(build_info.pid), NULL, &stdout_fd, &stderr_fd, &error)) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL, &(build_info.pid), NULL, &stdout_fd,
&stderr_fd, &error))
{ {
geany_debug("g_spawn_async_with_pipes() failed: %s", error->message); geany_debug("g_spawn_async_with_pipes() failed: %s", error->message);
ui_set_statusbar(TRUE, _("Process failed (%s)"), error->message); ui_set_statusbar(TRUE, _("Process failed (%s)"), error->message);
@ -651,7 +659,8 @@ static gchar *prepare_run_script(GeanyDocument *doc, gchar **vte_cmd_nonscript)
{ {
gchar *utf8_working_dir = utils_get_utf8_from_locale(working_dir); gchar *utf8_working_dir = utils_get_utf8_from_locale(working_dir);
ui_set_statusbar(TRUE, _("Failed to change the working directory to \"%s\""), utf8_working_dir); ui_set_statusbar(TRUE, _("Failed to change the working directory to \"%s\""),
utf8_working_dir);
utils_free_pointers(utf8_working_dir, working_dir, executable, locale_filename, NULL); utils_free_pointers(utf8_working_dir, working_dir, executable, locale_filename, NULL);
return NULL; return NULL;
} }
@ -744,7 +753,8 @@ static GPid build_run_cmd(GeanyDocument *doc)
} }
if (! vte_send_cmd(vte_cmd)) if (! vte_send_cmd(vte_cmd))
ui_set_statusbar(FALSE, ui_set_statusbar(FALSE,
_("Could not execute the file in the VTE because it probably contains a command.")); _("Could not execute the file in the VTE "
"because it probably contains a command."));
/* show the VTE */ /* show the VTE */
gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_VTE); gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_VTE);
@ -781,7 +791,8 @@ static GPid build_run_cmd(GeanyDocument *doc)
{ {
ui_set_statusbar(TRUE, ui_set_statusbar(TRUE,
_("Could not find terminal \"%s\" " _("Could not find terminal \"%s\" "
"(check path for Terminal tool setting in Preferences)"), tool_prefs.term_cmd); "(check path for Terminal tool setting in Preferences)"),
tool_prefs.term_cmd);
run_info.pid = (GPid) 1; run_info.pid = (GPid) 1;
goto free_strings; goto free_strings;
} }
@ -966,7 +977,8 @@ static void build_exit_cb(GPid child_pid, gint status, gpointer user_data)
failure = TRUE; failure = TRUE;
} }
else else
{ /* any other failure occured */ {
/* any other failure occured */
failure = TRUE; failure = TRUE;
} }
show_build_result_message(failure); show_build_result_message(failure);
@ -1006,9 +1018,10 @@ static gboolean build_create_shellscript(const gchar *fname, const gchar *cmd, g
str = g_strdup_printf("%s\n\n%s\ndel %s\n", cmd, (autoclose) ? "" : "pause", fname); str = g_strdup_printf("%s\n\n%s\ndel %s\n", cmd, (autoclose) ? "" : "pause", fname);
#else #else
str = g_strdup_printf( str = g_strdup_printf(
"#!/bin/sh\n\n%s\n\necho \"\n\n------------------\n(program exited with code: $?)\" \ "#!/bin/sh\n\n%s\n\necho \"\n\n------------------\n(program exited "
\n\n%s\nrm $0\n", cmd, (autoclose) ? "" : "with code: $?)\"\n\n%s\nrm $0\n", cmd, (autoclose) ? "" :
"\necho \"Press return to continue\"\n#to be more compatible with shells like dash\ndummy_var=\"\"\nread dummy_var"); "\necho \"Press return to continue\"\n#to be more compatible with "
"shells like dash\ndummy_var=\"\"\nread dummy_var");
#endif #endif
fputs(str, fp); fputs(str, fp);
@ -1188,6 +1201,7 @@ static void create_build_menu_gen(BuildMenuItems *menu_items)
g_object_ref((gpointer)menu_items->menu); /* to hold it after removing */ g_object_ref((gpointer)menu_items->menu); /* to hold it after removing */
} }
/* externally callable build default menu for when projects change menu */ /* externally callable build default menu for when projects change menu */
void build_default_menu() void build_default_menu()
@ -1924,7 +1938,8 @@ static void set_stop_button(gboolean stop)
if (stop && utils_str_equal( if (stop && utils_str_equal(
gtk_tool_button_get_stock_id(GTK_TOOL_BUTTON(widgets.run_button)), "gtk-stop")) return; gtk_tool_button_get_stock_id(GTK_TOOL_BUTTON(widgets.run_button)), "gtk-stop")) return;
if (! stop && utils_str_equal( if (! stop && utils_str_equal(
gtk_tool_button_get_stock_id(GTK_TOOL_BUTTON(widgets.run_button)), "gtk-execute")) return; gtk_tool_button_get_stock_id(GTK_TOOL_BUTTON(widgets.run_button)),
"gtk-execute")) return;
/* use the run button also as stop button */ /* use the run button also as stop button */
if (stop) if (stop)
@ -1950,14 +1965,16 @@ static void set_stop_button(gboolean stop)
if (run_info.file_type_id == GEANY_FILETYPES_LATEX) if (run_info.file_type_id == GEANY_FILETYPES_LATEX)
{ {
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem),
gtk_image_new_from_stock("gtk-find", GTK_ICON_SIZE_MENU)); gtk_image_new_from_stock("gtk-find",
GTK_ICON_SIZE_MENU));
gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))), gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))),
LATEX_VIEW_DVI_LABEL); LATEX_VIEW_DVI_LABEL);
} }
else else
{ {
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem),
gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_MENU)); gtk_image_new_from_stock("gtk-execute",
GTK_ICON_SIZE_MENU));
gtk_stock_lookup("gtk-execute", &sitem); gtk_stock_lookup("gtk-execute", &sitem);
gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))), gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))),
@ -2083,7 +2100,8 @@ show_make_custom(void)
if (! dialog) if (! dialog)
dialog = dialogs_show_input(_("Make Custom Target"), dialog = dialogs_show_input(_("Make Custom Target"),
_("Enter custom options here, all entered text is passed to the make command."), _("Enter custom options here, all entered text"
" is passed to the make command."),
build_info.custom_target, TRUE, &on_make_custom_input_response); build_info.custom_target, TRUE, &on_make_custom_input_response);
else else
{ {
@ -2254,3 +2272,5 @@ void build_init()
widgets.compile_button = lookup_widget(main_widgets.window, "toolbutton_compile"); widgets.compile_button = lookup_widget(main_widgets.window, "toolbutton_compile");
widgets.run_button = lookup_widget(main_widgets.window, "toolbutton_run"); widgets.run_button = lookup_widget(main_widgets.window, "toolbutton_run");
} }