Revision: 1000 http://svn.sourceforge.net/geany/?rev=1000&view=rev Author: ntrel Date: 2006-11-15 09:07:15 -0800 (Wed, 15 Nov 2006)
Log Message: ----------- Remove the stop button in build_exit_cb() when using Make commands. Fix set_stop_button() when using Make when the current file has no filetype.
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-15 15:57:23 UTC (rev 999) +++ trunk/ChangeLog 2006-11-15 17:07:15 UTC (rev 1000) @@ -5,6 +5,10 @@ Add ui_combo_box_add_to_history() and use to prevent blocks of duplicates (but not all duplicates) from search history combo boxes, and limit history to 30 entries. + * src/build.c: + Remove the stop button in build_exit_cb() when using Make commands. + Fix set_stop_button() when using Make when the current file has no + filetype.
2006-11-14 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2006-11-15 15:57:23 UTC (rev 999) +++ trunk/src/build.c 2006-11-15 17:07:15 UTC (rev 1000) @@ -416,15 +416,10 @@ gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_COMPILER);
// set the build info for the message window - { - filetype *ft = doc_list[idx].file_type; - guint ft_id = (ft == NULL) ? filetypes[GEANY_FILETYPES_ALL]->id : ft->id; + g_free(build_info.dir); + build_info.dir = g_strdup(working_dir); + build_info.file_type_id = FILETYPE_ID(doc_list[idx].file_type);
- g_free(build_info.dir); - build_info.dir = g_strdup(working_dir); - build_info.file_type_id = ft_id; - } - if (! g_spawn_async_with_pipes(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &(build_info.pid), NULL, &stdout_fd, &stderr_fd, &error)) { @@ -483,7 +478,7 @@
if (! DOC_IDX_VALID(idx) || doc_list[idx].file_name == NULL) return (GPid) 1;
- build_info.file_type_id = doc_list[idx].file_type->id; + build_info.file_type_id = FILETYPE_ID(doc_list[idx].file_type); build_info.type = GBO_RUN;
#ifdef G_OS_WIN32 @@ -720,14 +715,7 @@
build_info.pid = 0; // reset the stop button and menu item to the original meaning - switch (build_info.type) - { - case GBO_COMPILE: - case GBO_BUILD: - case GBO_RUN: - set_stop_button(FALSE); break; - default: ; - } + set_stop_button(FALSE); }
@@ -1299,48 +1287,48 @@ static void set_stop_button(gboolean stop) { GtkStockItem sitem; + GtkWidget *menuitem = + filetypes[build_info.file_type_id]->menu_items->item_exec;
// use the run button also as stop button if (stop) { gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(app->run_button), "gtk-stop"); gtk_widget_set_sensitive(app->compile_button, FALSE); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM( - filetypes[build_info.file_type_id]->menu_items->item_exec), - gtk_image_new_from_stock("gtk-stop", GTK_ICON_SIZE_MENU)); - - gtk_stock_lookup("gtk-stop", &sitem); - gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child( - GTK_BIN(filetypes[build_info.file_type_id]->menu_items->item_exec))), - sitem.label); + if (menuitem != NULL) + { + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), + gtk_image_new_from_stock("gtk-stop", GTK_ICON_SIZE_MENU)); + gtk_stock_lookup("gtk-stop", &sitem); + gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))), + sitem.label); + } } else { gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(app->run_button), "gtk-execute"); gtk_widget_set_sensitive(app->compile_button, TRUE);
- // LaTeX hacks ;-( - if (build_info.file_type_id == GEANY_FILETYPES_LATEX) + if (menuitem != NULL) { - gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child( - GTK_BIN(filetypes[build_info.file_type_id]->menu_items->item_exec))), - LATEX_VIEW_DVI_LABEL); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM( - filetypes[build_info.file_type_id]->menu_items->item_exec), - gtk_image_new_from_stock("gtk-find", GTK_ICON_SIZE_MENU)); - } - else - { - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM( - filetypes[build_info.file_type_id]->menu_items->item_exec), - gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_MENU)); + // LaTeX hacks ;-( + if (build_info.file_type_id == GEANY_FILETYPES_LATEX) + { + gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))), + LATEX_VIEW_DVI_LABEL); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), + gtk_image_new_from_stock("gtk-find", GTK_ICON_SIZE_MENU)); + } + else + { + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), + gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_MENU));
- gtk_stock_lookup("gtk-execute", &sitem); - gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child( - GTK_BIN(filetypes[build_info.file_type_id]->menu_items->item_exec))), - sitem.label); + gtk_stock_lookup("gtk-execute", &sitem); + gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))), + sitem.label); + } } - } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.