Apply patch from Simone Denei to add a "Restart" item to the VTE popup menu in case running application hangs.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2031 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2007-11-07 17:16:28 +00:00
parent 4fcc44ee72
commit c5f190f725
2 changed files with 31 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2007-11-07 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/vte.c: Apply patch from Simone Denei to add a "Restart" item to
the VTE popup menu in case running application hangs.
2007-11-06 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/build.c: Enable stopping of Run command on Windows.

View File

@ -74,6 +74,7 @@ enum
POPUP_COPY,
POPUP_PASTE,
POPUP_CHANGEPATH,
POPUP_RESTARTTERMINAL,
POPUP_PREFERENCES
};
@ -298,6 +299,19 @@ static void vte_start(GtkWidget *widget)
}
static void vte_restart(GtkWidget *widget)
{
vte_get_working_directory(); // try to keep the working directory when restarting the VTE
if (pid > 0)
{
kill(pid, SIGINT);
pid = 0;
}
vf->vte_terminal_reset(VTE_TERMINAL(widget), TRUE, TRUE);
vte_start(widget);
}
static gboolean vte_button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
if (event->button == 3)
@ -380,6 +394,12 @@ static void vte_popup_menu_clicked(GtkMenuItem *menuitem, gpointer user_data)
vte_cwd(doc_list[idx].file_name, TRUE);
break;
}
case POPUP_RESTARTTERMINAL:
{
vte_restart(vc->vte);
break;
}
case POPUP_PREFERENCES:
{
GtkWidget *notebook;
@ -416,6 +436,11 @@ static GtkWidget *vte_create_popup_menu(void)
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(POPUP_CHANGEPATH));
item = gtk_image_menu_item_new_with_label(_("Restart terminal"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(POPUP_RESTARTTERMINAL));
item = gtk_separator_menu_item_new();
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);