[Xfce4-commits] [apps/xfce4-terminal] 01/01: Refine previous commit

noreply at xfce.org noreply at xfce.org
Sat Mar 10 01:29:54 CET 2018


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit 059feeb976208c31365e5937d29f88411f3e45f8
Author: Igor <f2404 at yandex.ru>
Date:   Fri Mar 9 19:29:47 2018 -0500

    Refine previous commit
---
 terminal/terminal-screen.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index c7be97e..ce8e2b1 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -157,6 +157,10 @@ static void       terminal_screen_urgent_bell                   (TerminalWidget
                                                                  TerminalScreen        *screen);
 static void       terminal_screen_set_custom_command            (TerminalScreen        *screen,
                                                                  gchar                **command);
+static void       terminal_screen_child_error                   (VteTerminal           *terminal,
+                                                                 GPid                   pid,
+                                                                 GError                *error,
+                                                                 gpointer               user_data);
 
 
 
@@ -1677,12 +1681,11 @@ terminal_screen_set_custom_command (TerminalScreen *screen,
 
 
 
-#if VTE_CHECK_VERSION (0, 48, 0)
 static void
-terminal_screen_spawn_async_cb (VteTerminal *terminal,
-                                GPid         pid,
-                                GError      *error,
-                                gpointer     user_data)
+terminal_screen_child_error (VteTerminal *terminal,
+                             GPid         pid,
+                             GError      *error,
+                             gpointer     user_data)
 {
   TerminalScreen *screen = TERMINAL_SCREEN (user_data);
 
@@ -1696,7 +1699,6 @@ terminal_screen_spawn_async_cb (VteTerminal *terminal,
       g_error_free (error);
     }
 }
-#endif
 
 
 
@@ -1763,9 +1765,7 @@ terminal_screen_launch_child (TerminalScreen *screen)
   if (!terminal_screen_get_child_command (screen, &command, &argv, &error))
     {
       /* tell the user that we were unable to execute the command */
-      xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (screen))),
-                              error, _("Failed to execute child"));
-      g_error_free (error);
+      terminal_screen_child_error (VTE_TERMINAL (screen->terminal), -1, error, screen);
     }
   else
     {
@@ -1790,7 +1790,7 @@ terminal_screen_launch_child (TerminalScreen *screen)
                                 NULL, NULL,
                                 NULL, SPAWN_TIMEOUT,
                                 NULL,
-                                terminal_screen_spawn_async_cb,
+                                terminal_screen_child_error,
                                 screen);
 #else
       if (!vte_terminal_spawn_sync (VTE_TERMINAL (screen->terminal),
@@ -1800,9 +1800,7 @@ terminal_screen_launch_child (TerminalScreen *screen)
                                     NULL, NULL,
                                     &screen->pid, NULL, &error))
         {
-          xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (screen))),
-                                  error, _("Failed to execute child"));
-          g_error_free (error);
+          terminal_screen_child_error (VTE_TERMINAL (screen->terminal), -1, error, screen);
         }
 #endif
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list