Skip to content
Permalink
Browse files

terminal-app: avoid gtk_dialog_add_buttons with stock ids

  • Loading branch information...
sc0w committed Feb 20, 2018
1 parent 90f1e19 commit 43897cf72714b140cd5f50942f288be10a080d0e
Showing with 27 additions and 6 deletions.
  1. +27 −6 src/terminal-app.c
@@ -655,6 +655,24 @@ profile_list_delete_confirm_response_cb (GtkWidget *dialog,
gtk_widget_destroy (dialog);
}

static void
mate_dialog_add_button (GtkDialog *dialog,
const gchar *button_text,
const gchar *icon_name,
gint response_id)
{
GtkWidget *button;

button = gtk_button_new_with_mnemonic (button_text);
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));

gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);
}

static void
profile_list_delete_button_clicked_cb (GtkWidget *button,
GtkWidget *widget)
@@ -684,12 +702,15 @@ profile_list_delete_button_clicked_cb (GtkWidget *button,
_("Delete profile “%s”?"),
terminal_profile_get_property_string (selected_profile, TERMINAL_PROFILE_VISIBLE_NAME));

gtk_dialog_add_buttons (GTK_DIALOG (dialog),
"gtk-cancel",
GTK_RESPONSE_REJECT,
"gtk-delete",
GTK_RESPONSE_ACCEPT,
NULL);
mate_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_REJECT);

mate_dialog_add_button (GTK_DIALOG (dialog),
_("_Delete"),
"edit-delete",
GTK_RESPONSE_ACCEPT);

gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_ACCEPT);

0 comments on commit 43897cf

Please sign in to comment.
You can’t perform that action at this time.