[Xfce4-commits] [apps/xfce4-terminal] 01/01: Add an option to disable "Relaunch" dialog pop-up

noreply at xfce.org noreply at xfce.org
Fri Mar 23 20:24:04 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 93e38166650059ed4613e2236a54ebba3124de7b
Author: Igor <f2404 at yandex.ru>
Date:   Fri Mar 23 15:22:13 2018 -0400

    Add an option to disable "Relaunch" dialog pop-up
    
    For the hold (-H/--hold) option.
    
    Fixes bug #14287
    See also bug #13820
---
 terminal/terminal-preferences.c | 11 +++++++++++
 terminal/terminal-screen.c      | 21 +++++++++++++++------
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 6a01223..9f29a7a 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -105,6 +105,7 @@ enum
   PROP_MISC_HIGHLIGHT_URLS,
   PROP_MISC_MIDDLE_CLICK_OPENS_URI,
   PROP_MISC_COPY_ON_SELECT,
+  PROP_MISC_SHOW_RELAUNCH_DIALOG,
   PROP_USE_DEFAULT_WORKING_DIR,
   PROP_DEFAULT_WORKING_DIR,
   PROP_MISC_REWRAP_ON_RESIZE,
@@ -1037,6 +1038,16 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
   /**
+   * TerminalPreferences:misc-show-relaunch-dialog:
+   **/
+  preferences_props[PROP_MISC_SHOW_RELAUNCH_DIALOG] =
+      g_param_spec_boolean ("misc-show-relaunch-dialog",
+                            NULL,
+                            "MiscShowRelaunchDialog",
+                            TRUE,
+                            G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+  /**
    * TerminalPreferences:scrolling-bar:
    **/
   preferences_props[PROP_SCROLLING_BAR] =
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 5706755..7d13958 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1303,16 +1303,19 @@ terminal_screen_vte_child_exited (VteTerminal    *terminal,
                                   gint            status,
                                   TerminalScreen *screen)
 {
-  GtkWidget *window, *dialog, *label, *content_area;
+  GtkWidget *window, *dialog, *content_area, *label, *checkbox;
   gchar     *message;
   gint       response;
+  gboolean   show_relaunch_dialog;
 
   terminal_return_if_fail (VTE_IS_TERMINAL (terminal));
   terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
 
+  g_object_get (G_OBJECT (screen->preferences), "misc-show-relaunch-dialog", &show_relaunch_dialog, NULL);
+
   if (G_LIKELY (!screen->hold))
     gtk_widget_destroy (GTK_WIDGET (screen));
-  else
+  else if (show_relaunch_dialog)
     {
       /* create "Relaunch" dialog */
       window = gtk_widget_get_toplevel (GTK_WIDGET (screen));
@@ -1324,25 +1327,31 @@ terminal_screen_vte_child_exited (VteTerminal    *terminal,
                                             NULL);
       gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
 
+      content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+      gtk_box_set_spacing (GTK_BOX (content_area), 6);
+
       if (WIFEXITED (status))
         message = g_strdup_printf (_("The child process exited normally with status %d."), WEXITSTATUS (status));
       else if (WIFSIGNALED (status))
         message = g_strdup_printf (_("The child process was aborted by signal %d."), WTERMSIG (status));
       else
-        message = g_strdup_printf (_("The child process was aborted."));
+        message = g_strdup (_("The child process was aborted."));
 
       label = gtk_label_new (message);
       g_free (message);
-
-      content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
       gtk_container_add (GTK_CONTAINER (content_area), label);
 
+      checkbox = gtk_check_button_new_with_mnemonic (_("Do _not ask me again"));
+      gtk_container_add (GTK_CONTAINER (content_area), checkbox);
+
       gtk_widget_show_all (dialog);
       response = gtk_dialog_run (GTK_DIALOG (dialog));
 
-      /* relaunch the process */
+      /* relaunch the process or remember to not show it anymore */
       if (response == GTK_RESPONSE_YES)
         terminal_screen_launch_child (screen);
+      else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
+        g_object_set (G_OBJECT (screen->preferences), "misc-show-relaunch-dialog", FALSE, NULL);
 
       gtk_widget_destroy (dialog);
     }

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


More information about the Xfce4-commits mailing list