diff options
Diffstat (limited to 'src/fr-window.c')
-rw-r--r-- | src/fr-window.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/fr-window.c b/src/fr-window.c index 719c9ba..7162441 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -7400,6 +7400,27 @@ last_output_window__unrealize_cb (GtkWidget *widget, } +static void +fr_window_view_last_output_print(GtkTextBuffer *text_buffer, + GtkTextIter *iter, + GList *scan) +{ + for (; scan; scan = scan->next) { + char *line = scan->data; + char *utf8_line; + gsize bytes_written; + + utf8_line = g_locale_to_utf8 (line, -1, NULL, &bytes_written, NULL); + gtk_text_buffer_insert_with_tags_by_name (text_buffer, + iter, + utf8_line, + bytes_written, + "monospace", NULL); + g_free (utf8_line); + gtk_text_buffer_insert (text_buffer, iter, "\n", 1); + } +} + void fr_window_view_last_output (FrWindow *window, const char *title) @@ -7410,7 +7431,6 @@ fr_window_view_last_output (FrWindow *window, GtkWidget *scrolled; GtkTextBuffer *text_buffer; GtkTextIter iter; - GList *scan; if (title == NULL) title = _("Last Output"); @@ -7468,24 +7488,11 @@ fr_window_view_last_output (FrWindow *window, G_CALLBACK (last_output_window__unrealize_cb), NULL); - /**/ - gtk_text_buffer_get_iter_at_offset (text_buffer, &iter, 0); - scan = window->archive->process->out.raw; - for (; scan; scan = scan->next) { - char *line = scan->data; - char *utf8_line; - gsize bytes_written; - - utf8_line = g_locale_to_utf8 (line, -1, NULL, &bytes_written, NULL); - gtk_text_buffer_insert_with_tags_by_name (text_buffer, - &iter, - utf8_line, - bytes_written, - "monospace", NULL); - g_free (utf8_line); - gtk_text_buffer_insert (text_buffer, &iter, "\n", 1); - } + /* Show STDOUT of process */ + fr_window_view_last_output_print(text_buffer, &iter, window->archive->process->out.raw); + /* Show STDERR of process */ + fr_window_view_last_output_print(text_buffer, &iter, window->archive->process->err.raw); /**/ |