terminal-app: avoid gtk_dialog_add_buttons with stock ids

master-1.22
Pablo Barciela 2018-02-20 15:56:07 +01:00
parent 90f1e19d3f
commit 43897cf727
1 changed files with 27 additions and 6 deletions

View File

@ -655,6 +655,24 @@ profile_list_delete_confirm_response_cb (GtkWidget *dialog,
gtk_widget_destroy (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 static void
profile_list_delete_button_clicked_cb (GtkWidget *button, profile_list_delete_button_clicked_cb (GtkWidget *button,
GtkWidget *widget) GtkWidget *widget)
@ -684,12 +702,15 @@ profile_list_delete_button_clicked_cb (GtkWidget *button,
_("Delete profile “%s”?"), _("Delete profile “%s”?"),
terminal_profile_get_property_string (selected_profile, TERMINAL_PROFILE_VISIBLE_NAME)); terminal_profile_get_property_string (selected_profile, TERMINAL_PROFILE_VISIBLE_NAME));
gtk_dialog_add_buttons (GTK_DIALOG (dialog), mate_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel", _("_Cancel"),
GTK_RESPONSE_REJECT, "process-stop",
"gtk-delete", GTK_RESPONSE_REJECT);
GTK_RESPONSE_ACCEPT,
NULL); mate_dialog_add_button (GTK_DIALOG (dialog),
_("_Delete"),
"edit-delete",
GTK_RESPONSE_ACCEPT);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_ACCEPT); GTK_RESPONSE_ACCEPT);