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

@ -83,9 +83,9 @@ enum
}; };
static BuildMenuItems default_menu_items = static BuildMenuItems default_menu_items =
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
static BuildMenuItems latex_menu_items = static BuildMenuItems latex_menu_items =
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
static struct static struct
@ -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
@ -329,14 +332,14 @@ static GPid build_make_file(GeanyDocument *doc, gint build_opts)
if (build_opts == GBO_MAKE_OBJECT) if (build_opts == GBO_MAKE_OBJECT)
{ {
build_info.type = build_opts; build_info.type = build_opts;
if( app->project!=NULL && app->project->build_3_cmd != NULL ) if (app->project!=NULL && app->project->build_3_cmd != NULL)
part1 = app->project->build_3_cmd; part1 = app->project->build_3_cmd;
else part2 = "\"%e.o\""; else part2 = "\"%e.o\"";
} }
else if (build_opts == GBO_MAKE_CUSTOM && build_info.custom_target) else if (build_opts == GBO_MAKE_CUSTOM && build_info.custom_target)
{ {
build_info.type = GBO_MAKE_CUSTOM; build_info.type = GBO_MAKE_CUSTOM;
if( app->project != NULL && app->project->build_2_cmd != NULL ) if (app->project != NULL && app->project->build_2_cmd != NULL)
part1 = app->project->build_2_cmd; part1 = app->project->build_2_cmd;
else part2 = build_info.custom_target; else part2 = build_info.custom_target;
dir = project_get_make_dir(); dir = project_get_make_dir();
@ -344,17 +347,17 @@ static GPid build_make_file(GeanyDocument *doc, gint build_opts)
else /* GBO_MAKE_ALL */ else /* GBO_MAKE_ALL */
{ {
build_info.type = GBO_MAKE_ALL; build_info.type = GBO_MAKE_ALL;
if( app->project != NULL && app->project->build_1_cmd != NULL ) if (app->project != NULL && app->project->build_1_cmd != NULL)
part1 = app->project->build_1_cmd; part1 = app->project->build_1_cmd;
else part2 = "all"; else part2 = "all";
dir = project_get_make_dir(); dir = project_get_make_dir();
} }
cmdstr = g_string_new(part1); cmdstr = g_string_new(part1);
if( part2!=NULL ) if (part2!=NULL)
{ {
g_string_append_c(cmdstr, ' '); g_string_append_c(cmdstr, ' ');
g_string_append( cmdstr, part2 ); g_string_append(cmdstr, part2);
} }
pid = build_spawn_cmd(doc, cmdstr->str, dir); /* if dir is NULL, idx filename is used */ pid = build_spawn_cmd(doc, cmdstr->str, dir); /* if dir is NULL, idx filename is used */
@ -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);
@ -1076,11 +1089,11 @@ static void create_build_menu_gen(BuildMenuItems *menu_items)
/* build the code with make all or prefs or project command*/ /* build the code with make all or prefs or project command*/
proj = app->project; proj = app->project;
if( proj!=NULL && proj->build_1_label!=NULL ) if (proj!=NULL && proj->build_1_label!=NULL)
{ {
item = gtk_image_menu_item_new_with_mnemonic( proj->build_1_label ); item = gtk_image_menu_item_new_with_mnemonic(proj->build_1_label);
tiptext = NULL; /* user label so no tip needed */ tiptext = NULL; /* user label so no tip needed */
}/* else if prefs */ } /* else if prefs */
else else
{ {
item = gtk_image_menu_item_new_with_mnemonic(_("_Make All")); item = gtk_image_menu_item_new_with_mnemonic(_("_Make All"));
@ -1088,18 +1101,18 @@ static void create_build_menu_gen(BuildMenuItems *menu_items)
} }
gtk_widget_show(item); gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item); gtk_container_add(GTK_CONTAINER(menu), item);
if( tiptext != NULL )gtk_tooltips_set_tip(tooltips, item, tiptext, NULL); if (tiptext != NULL) gtk_tooltips_set_tip(tooltips, item, tiptext, NULL);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_MAKE, item); GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_MAKE, item);
g_signal_connect(item, "activate", G_CALLBACK(on_build_make_activate), g_signal_connect(item, "activate", G_CALLBACK(on_build_make_activate),
GINT_TO_POINTER(GBO_MAKE_ALL)); GINT_TO_POINTER(GBO_MAKE_ALL));
menu_items->item_make_all = item; menu_items->item_make_all = item;
/* build the code with make custom */ /* build the code with make custom */
if( proj!=NULL && proj->build_2_label!=NULL ) if (proj!=NULL && proj->build_2_label!=NULL)
{ {
item = gtk_image_menu_item_new_with_mnemonic( proj->build_2_label ); item = gtk_image_menu_item_new_with_mnemonic(proj->build_2_label);
tiptext = _("Dialog contents appended to this command"); tiptext = _("Dialog contents appended to this command");
}/* else if prefs */ } /* else if prefs */
else else
{ {
item = gtk_image_menu_item_new_with_mnemonic(_("Make Custom _Target")); item = gtk_image_menu_item_new_with_mnemonic(_("Make Custom _Target"));
@ -1114,11 +1127,11 @@ static void create_build_menu_gen(BuildMenuItems *menu_items)
menu_items->item_make_custom = item; menu_items->item_make_custom = item;
/* build the code with make object */ /* build the code with make object */
if( proj!=NULL && proj->build_2_label!=NULL ) if (proj!=NULL && proj->build_2_label!=NULL)
{ {
item = gtk_image_menu_item_new_with_mnemonic( proj->build_2_label ); item = gtk_image_menu_item_new_with_mnemonic(proj->build_2_label);
tiptext = NULL; tiptext = NULL;
}/* else if prefs */ } /* else if prefs */
else else
{ {
item = gtk_image_menu_item_new_with_mnemonic(_("Make _Object")); item = gtk_image_menu_item_new_with_mnemonic(_("Make _Object"));
@ -1183,16 +1196,17 @@ static void create_build_menu_gen(BuildMenuItems *menu_items)
g_signal_connect(item, "activate", G_CALLBACK(on_build_arguments_activate), NULL); g_signal_connect(item, "activate", G_CALLBACK(on_build_arguments_activate), NULL);
menu_items->item_set_args = item; menu_items->item_set_args = item;
if( menu_items->menu ) g_object_unref( (gpointer)menu_items->menu ); /* free it */ if (menu_items->menu) g_object_unref( (gpointer)menu_items->menu); /* free it */
menu_items->menu = menu; menu_items->menu = menu;
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()
{ {
create_build_menu_gen( &default_menu_items ); create_build_menu_gen(&default_menu_items);
}; };
static void create_build_menu_tex(BuildMenuItems *menu_items) static void create_build_menu_tex(BuildMenuItems *menu_items)
@ -1546,44 +1560,44 @@ on_includes_arguments_dialog_response (GtkDialog *dialog,
programs->modified = TRUE; programs->modified = TRUE;
} }
} }
if( app->project!=NULL ) if (app->project!=NULL)
{ {
GeanyProject *proj = app->project; GeanyProject *proj = app->project;
newstr = gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(dialog), "build_1_label" ) ) ); newstr = gtk_entry_get_text(GTK_ENTRY(lookup_widget(GTK_WIDGET(dialog), "build_1_label") ) );
if( !utils_str_equal( newstr, proj->build_1_label ) ) if (!utils_str_equal(newstr, proj->build_1_label) )
{ {
if( proj->build_1_label ) g_free( proj->build_1_label ); if (proj->build_1_label) g_free(proj->build_1_label);
proj->build_1_label = g_strdup(newstr); proj->build_1_label = g_strdup(newstr);
} }
newstr = gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(dialog), "build_1_cmd" ) ) ); newstr = gtk_entry_get_text(GTK_ENTRY(lookup_widget(GTK_WIDGET(dialog), "build_1_cmd") ) );
if( !utils_str_equal( newstr, proj->build_1_cmd ) ) if (!utils_str_equal(newstr, proj->build_1_cmd) )
{ {
if( proj->build_1_cmd ) g_free( proj->build_1_cmd ); if (proj->build_1_cmd) g_free(proj->build_1_cmd);
proj->build_1_cmd = g_strdup(newstr); proj->build_1_cmd = g_strdup(newstr);
} }
newstr = gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(dialog), "build_2_label" ) ) ); newstr = gtk_entry_get_text(GTK_ENTRY(lookup_widget(GTK_WIDGET(dialog), "build_2_label") ) );
if( !utils_str_equal( newstr, proj->build_2_label ) ) if (!utils_str_equal(newstr, proj->build_2_label) )
{ {
if( proj->build_2_label ) g_free( proj->build_2_label ); if (proj->build_2_label) g_free(proj->build_2_label);
proj->build_2_label = g_strdup(newstr); proj->build_2_label = g_strdup(newstr);
} }
newstr = gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(dialog), "build_2_cmd" ) ) ); newstr = gtk_entry_get_text(GTK_ENTRY(lookup_widget(GTK_WIDGET(dialog), "build_2_cmd") ) );
if( !utils_str_equal( newstr, proj->build_2_cmd ) ) if (!utils_str_equal(newstr, proj->build_2_cmd) )
{ {
if( proj->build_2_cmd ) g_free( proj->build_2_cmd ); if (proj->build_2_cmd) g_free(proj->build_2_cmd);
proj->build_2_cmd = g_strdup(newstr); proj->build_2_cmd = g_strdup(newstr);
} }
newstr = gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(dialog), "build_3_label" ) ) ); newstr = gtk_entry_get_text(GTK_ENTRY(lookup_widget(GTK_WIDGET(dialog), "build_3_label") ) );
if( !utils_str_equal( newstr, proj->build_3_label ) ) if (!utils_str_equal(newstr, proj->build_3_label) )
{ {
if( proj->build_3_label ) g_free( proj->build_3_label ); if (proj->build_3_label) g_free(proj->build_3_label);
proj->build_3_label = g_strdup(newstr); proj->build_3_label = g_strdup(newstr);
} }
newstr = gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(dialog), "build_3_cmd" ) ) ); newstr = gtk_entry_get_text(GTK_ENTRY(lookup_widget(GTK_WIDGET(dialog), "build_3_cmd") ) );
if( !utils_str_equal( newstr, proj->build_3_cmd ) ) if (!utils_str_equal(newstr, proj->build_3_cmd) )
{ {
if( proj->build_3_cmd ) g_free( proj->build_3_cmd ); if (proj->build_3_cmd) g_free(proj->build_3_cmd);
proj->build_3_cmd = g_strdup(newstr); proj->build_3_cmd = g_strdup(newstr);
} }
} }
@ -1683,7 +1697,7 @@ static void add_build_command_widgets(GtkWidget *dialog, GtkWidget *vbox, GeanyF
/* see if need project based command fields */ /* see if need project based command fields */
if( app->project!=NULL ) if (app->project!=NULL)
{ {
GtkWidget *align, *frame; GtkWidget *align, *frame;
/* in-dialog heading for the project part of the build commands dialog */ /* in-dialog heading for the project part of the build commands dialog */
@ -1699,61 +1713,61 @@ static void add_build_command_widgets(GtkWidget *dialog, GtkWidget *vbox, GeanyF
/* label and cmd 1 */ /* label and cmd 1 */
build_entry = gtk_entry_new(); build_entry = gtk_entry_new();
gtk_entry_set_width_chars( GTK_ENTRY(build_entry), 10 ); gtk_entry_set_width_chars(GTK_ENTRY(build_entry), 10);
if( proj->build_1_label!=NULL ) if (proj->build_1_label!=NULL)
{ {
gtk_entry_set_text( GTK_ENTRY(build_entry), proj->build_1_label ); gtk_entry_set_text(GTK_ENTRY(build_entry), proj->build_1_label);
} }
gtk_table_attach_defaults( GTK_TABLE(pr_table), build_entry, 0, 1, 0, 1 ); gtk_table_attach_defaults(GTK_TABLE(pr_table), build_entry, 0, 1, 0, 1);
g_object_set_data_full( G_OBJECT(dialog), "build_1_label", g_object_set_data_full(G_OBJECT(dialog), "build_1_label",
gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref ); gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref);
build_entry = gtk_entry_new(); build_entry = gtk_entry_new();
gtk_entry_set_width_chars( GTK_ENTRY(build_entry), 30 ); gtk_entry_set_width_chars(GTK_ENTRY(build_entry), 30);
if( proj->build_1_cmd!=NULL ) if (proj->build_1_cmd!=NULL)
{ {
gtk_entry_set_text( GTK_ENTRY(build_entry), proj->build_1_cmd ); gtk_entry_set_text(GTK_ENTRY(build_entry), proj->build_1_cmd);
} }
gtk_table_attach_defaults( GTK_TABLE(pr_table), build_entry, 1, 3, 0, 1 ); gtk_table_attach_defaults(GTK_TABLE(pr_table), build_entry, 1, 3, 0, 1);
g_object_set_data_full(G_OBJECT(dialog), "build_1_cmd", g_object_set_data_full(G_OBJECT(dialog), "build_1_cmd",
gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref); gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref);
/* label and cmd 2 */ /* label and cmd 2 */
build_entry = gtk_entry_new(); build_entry = gtk_entry_new();
gtk_entry_set_width_chars( GTK_ENTRY(build_entry), 10 ); gtk_entry_set_width_chars(GTK_ENTRY(build_entry), 10);
if( proj->build_2_label!=NULL ) if (proj->build_2_label!=NULL)
{ {
gtk_entry_set_text( GTK_ENTRY(build_entry), proj->build_2_label ); gtk_entry_set_text(GTK_ENTRY(build_entry), proj->build_2_label);
} }
gtk_table_attach_defaults( GTK_TABLE(pr_table), build_entry, 0, 1, 1, 2 ); gtk_table_attach_defaults(GTK_TABLE(pr_table), build_entry, 0, 1, 1, 2);
g_object_set_data_full( G_OBJECT(dialog), "build_2_label", g_object_set_data_full(G_OBJECT(dialog), "build_2_label",
gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref ); gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref);
build_entry = gtk_entry_new(); build_entry = gtk_entry_new();
gtk_entry_set_width_chars( GTK_ENTRY(build_entry), 30 ); gtk_entry_set_width_chars(GTK_ENTRY(build_entry), 30);
if( proj->build_2_cmd!=NULL ) if (proj->build_2_cmd!=NULL)
{ {
gtk_entry_set_text( GTK_ENTRY(build_entry), proj->build_2_cmd ); gtk_entry_set_text(GTK_ENTRY(build_entry), proj->build_2_cmd);
} }
gtk_table_attach_defaults( GTK_TABLE(pr_table), build_entry, 1, 3, 1, 2 ); gtk_table_attach_defaults(GTK_TABLE(pr_table), build_entry, 1, 3, 1, 2);
g_object_set_data_full(G_OBJECT(dialog), "build_2_cmd", g_object_set_data_full(G_OBJECT(dialog), "build_2_cmd",
gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref); gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref);
/* label and cmd 3 */ /* label and cmd 3 */
build_entry = gtk_entry_new(); build_entry = gtk_entry_new();
gtk_entry_set_width_chars( GTK_ENTRY(build_entry), 10 ); gtk_entry_set_width_chars(GTK_ENTRY(build_entry), 10);
if( proj->build_3_label!=NULL ) if (proj->build_3_label!=NULL)
{ {
gtk_entry_set_text( GTK_ENTRY(build_entry), proj->build_3_label ); gtk_entry_set_text(GTK_ENTRY(build_entry), proj->build_3_label);
} }
gtk_table_attach_defaults( GTK_TABLE(pr_table), build_entry, 0, 1, 2, 3 ); gtk_table_attach_defaults(GTK_TABLE(pr_table), build_entry, 0, 1, 2, 3);
g_object_set_data_full( G_OBJECT(dialog), "build_3_label", g_object_set_data_full(G_OBJECT(dialog), "build_3_label",
gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref ); gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref);
build_entry = gtk_entry_new(); build_entry = gtk_entry_new();
gtk_entry_set_width_chars( GTK_ENTRY(build_entry), 30 ); gtk_entry_set_width_chars(GTK_ENTRY(build_entry), 30);
if( proj->build_3_cmd!=NULL ) if (proj->build_3_cmd!=NULL)
{ {
gtk_entry_set_text( GTK_ENTRY(build_entry), proj->build_3_cmd ); gtk_entry_set_text(GTK_ENTRY(build_entry), proj->build_3_cmd);
} }
gtk_table_attach_defaults( GTK_TABLE(pr_table), build_entry, 1, 3, 2, 3 ); gtk_table_attach_defaults(GTK_TABLE(pr_table), build_entry, 1, 3, 2, 3);
g_object_set_data_full(G_OBJECT(dialog), "build_3_cmd", g_object_set_data_full(G_OBJECT(dialog), "build_3_cmd",
gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref); gtk_widget_ref(build_entry), (GDestroyNotify)gtk_widget_unref);
@ -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");
} }