Revision: 2727 http://geany.svn.sourceforge.net/geany/?rev=2727&view=rev Author: ntrel Date: 2008-06-26 09:17:28 -0700 (Thu, 26 Jun 2008)
Log Message: ----------- Add Previous Error menu item.
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c trunk/src/build.h trunk/src/msgwindow.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-06-26 16:14:00 UTC (rev 2726) +++ trunk/ChangeLog 2008-06-26 16:17:28 UTC (rev 2727) @@ -3,6 +3,8 @@ * src/vte.c, src/vte.h: Move struct _VteTerminal, VteFunctions from vte.h to vte.c. Call vte_restart() in vte_keypress() as the code is the same. + * src/build.c, src/build.h, src/msgwindow.c: + Add Previous Error menu item.
2008-06-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2008-06-26 16:14:00 UTC (rev 2726) +++ trunk/src/build.c 2008-06-26 16:17:28 UTC (rev 2727) @@ -83,9 +83,9 @@ };
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}; 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};
static struct @@ -110,6 +110,7 @@ static void on_build_make_activate(GtkMenuItem *menuitem, gpointer user_data); static void on_build_execute_activate(GtkMenuItem *menuitem, gpointer user_data); static void on_build_next_error(GtkMenuItem *menuitem, gpointer user_data); +static void on_build_previous_error(GtkMenuItem *menuitem, gpointer user_data); static void kill_process(GPid *pid);
@@ -1105,6 +1106,13 @@ g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_next_error), NULL); menu_items->item_next_error = item;
+ item = gtk_image_menu_item_new_with_mnemonic(_("_Previous Error")); + gtk_widget_show(item); + /*GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_, item);*/ + gtk_container_add(GTK_CONTAINER(menu), item); + g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_previous_error), NULL); + menu_items->item_previous_error = item; + item = gtk_separator_menu_item_new(); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); @@ -1215,6 +1223,13 @@ g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_next_error), NULL); menu_items->item_next_error = item;
+ item = gtk_image_menu_item_new_with_mnemonic(_("_Previous Error")); + gtk_widget_show(item); + /*GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_, item);*/ + gtk_container_add(GTK_CONTAINER(menu), item); + g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_previous_error), NULL); + menu_items->item_previous_error = item; + item = gtk_separator_menu_item_new(); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); @@ -1721,6 +1736,8 @@ NULL) > 0; if (menu_items->item_next_error) gtk_widget_set_sensitive(menu_items->item_next_error, have_errors); + if (menu_items->item_previous_error) + gtk_widget_set_sensitive(menu_items->item_previous_error, have_errors); }
@@ -2048,6 +2065,20 @@ }
+static void +on_build_previous_error (GtkMenuItem *menuitem, + gpointer user_data) +{ + if (ui_tree_view_find_previous(GTK_TREE_VIEW(msgwindow.tree_compiler), + msgwin_goto_compiler_file_line)) + { + gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_COMPILER); + } + else + ui_set_statusbar(FALSE, _("No more build errors.")); +} + + void build_init() { widgets.compile_button = lookup_widget(main_widgets.window, "toolbutton13");
Modified: trunk/src/build.h =================================================================== --- trunk/src/build.h 2008-06-26 16:14:00 UTC (rev 2726) +++ trunk/src/build.h 2008-06-26 16:17:28 UTC (rev 2727) @@ -55,6 +55,7 @@ GtkWidget *item_make_custom; GtkWidget *item_make_object; GtkWidget *item_next_error; + GtkWidget *item_previous_error; GtkWidget *item_exec; GtkWidget *item_exec2; GtkWidget *item_set_args;
Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2008-06-26 16:14:00 UTC (rev 2726) +++ trunk/src/msgwindow.c 2008-06-26 16:17:28 UTC (rev 2727) @@ -250,6 +250,7 @@
/* calling build_menu_update for every build message would be overkill */ gtk_widget_set_sensitive(build_get_menu_items(-1)->item_next_error, TRUE); + gtk_widget_set_sensitive(build_get_menu_items(-1)->item_previous_error, TRUE); }
@@ -1013,9 +1014,9 @@ break;
case MSG_COMPILER: - gtk_widget_set_sensitive(build_get_menu_items(-1)->item_next_error, FALSE); - store = msgwindow.store_compiler; - break; + gtk_list_store_clear(msgwindow.store_compiler); + build_menu_update(NULL); /* update next error items */ + return;
case MSG_STATUS: store = msgwindow.store_status; break; default: return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.