Skip to content

Commit

Permalink
avoid 'gtk_info_bar_add_button' with stock ids
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0w committed Apr 17, 2018
1 parent 4c0af0c commit 1eb3e78
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
17 changes: 11 additions & 6 deletions pluma/pluma-io-error-message-area.c
Expand Up @@ -499,9 +499,11 @@ create_conversion_error_message_area (const gchar *primary_text,
}
else
{
gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
"gtk-cancel",
GTK_RESPONSE_CANCEL);
gtk_button_set_image (GTK_BUTTON (gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
_("_Cancel"),
GTK_RESPONSE_CANCEL)),
gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_BUTTON));

gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area),
GTK_MESSAGE_ERROR);
}
Expand Down Expand Up @@ -1179,9 +1181,12 @@ pluma_externally_modified_message_area_new (const gchar *uri,
_("_Reload"),
"view-refresh",
GTK_RESPONSE_OK);
gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
"gtk-cancel",
GTK_RESPONSE_CANCEL);

gtk_button_set_image (GTK_BUTTON (gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
_("_Cancel"),
GTK_RESPONSE_CANCEL)),
gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_BUTTON));

gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area),
GTK_MESSAGE_WARNING);

Expand Down
7 changes: 4 additions & 3 deletions pluma/pluma-progress-message-area.c
Expand Up @@ -62,9 +62,10 @@ pluma_progress_message_area_set_has_cancel_button (PlumaProgressMessageArea *are
gboolean has_button)
{
if (has_button)
gtk_info_bar_add_button (GTK_INFO_BAR (area),
"gtk-cancel",
GTK_RESPONSE_CANCEL);
gtk_button_set_image (GTK_BUTTON (gtk_info_bar_add_button (GTK_INFO_BAR (area),
_("_Cancel"),
GTK_RESPONSE_CANCEL)),
gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_BUTTON));

g_object_notify (G_OBJECT (area), "has-cancel-button");
}
Expand Down

0 comments on commit 1eb3e78

Please sign in to comment.