[Xfce4-commits] [apps/xfce4-terminal] 01/01: Add icons to "Cancel" and "Paste" buttons

noreply at xfce.org noreply at xfce.org
Wed Jul 31 20:43:34 CEST 2019


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 b93eb62a2e3784e75f51466646a37dc92e880a5d
Author: Igor <f2404 at yandex.ru>
Date:   Wed Jul 31 14:43:17 2019 -0400

    Add icons to "Cancel" and "Paste" buttons
---
 terminal/terminal-screen.c | 15 ++++++++++-----
 terminal/terminal-window.c | 14 ++++++++------
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 061a43d..4ab1daf 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1805,16 +1805,21 @@ terminal_screen_unsafe_paste_dialog_new (TerminalScreen *screen,
   GtkTextBuffer *buffer = gtk_text_buffer_new (gtk_text_tag_table_new ());
   GtkWidget     *tv = gtk_text_view_new_with_buffer (buffer);
   GtkWidget     *sw = gtk_scrolled_window_new (NULL, NULL);
-  GtkWidget     *dialog = xfce_titled_dialog_new_with_buttons (_("Warning: Unsafe Paste"), parent,
-                                                               GTK_DIALOG_DESTROY_WITH_PARENT,
-                                                               _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                                               _("_Paste"), GTK_RESPONSE_YES,
-                                                               NULL);
+  GtkWidget     *dialog = xfce_titled_dialog_new ();
+  GtkWidget     *button;
 
+  gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
+  gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+  gtk_window_set_title (GTK_WINDOW (dialog), _("Warning: Unsafe Paste"));
   xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog),
                                    _("Pasting this text to the terminal may be dangerous as it looks like\n"
                                      "some commands may be executed, potentially involving root access ('sudo')."));
 
+  button = xfce_gtk_button_new_mixed ("gtk-cancel", _("_Cancel"));
+  gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CANCEL);
+  button = xfce_gtk_button_new_mixed ("gtk-ok", _("_Paste"));
+  gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_YES);
+
   gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (tv), TRUE);
   gtk_text_view_set_monospace (GTK_TEXT_VIEW (tv), TRUE);
   gtk_text_view_set_top_margin (GTK_TEXT_VIEW (tv), 6);
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 3e6ffaf..ca39c79 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -881,12 +881,14 @@ terminal_window_confirm_close (TerminalScreen *screen,
   if ((screen != NULL || n_tabs < 2) && !confirm_close)
     return (screen != NULL) ? CONFIRMED_CLOSE_TAB : CONFIRMED_CLOSE_WINDOW;
 
-  dialog = gtk_dialog_new_with_buttons (_("Warning"), GTK_WINDOW (window),
-                                        GTK_DIALOG_DESTROY_WITH_PARENT
-                                        | GTK_DIALOG_MODAL,
-                                        _("_Cancel"),
-                                        GTK_RESPONSE_CANCEL,
-                                        NULL);
+  dialog = gtk_dialog_new ();
+  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+  gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+  gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+  gtk_window_set_title (GTK_WINDOW (dialog), _("Warning"));
+
+  button = xfce_gtk_button_new_mixed ("gtk-cancel", _("_Cancel"));
+  gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CANCEL);
 
   if (screen == NULL && n_tabs > 1)
     {

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


More information about the Xfce4-commits mailing list