Skip to content
Permalink
Browse files

avoid 'gtk_dialog_add_buttons' with stock ids

  • Loading branch information...
sc0w committed Mar 27, 2018
1 parent 78648af commit 15f06cebb1a2d07dfcbd5ef8b5a2f1226cae75e6
@@ -129,14 +129,9 @@ create_dialog (PlumaSpellLanguageDialog *dlg,
NULL
};

gtk_dialog_add_buttons (GTK_DIALOG (dlg),
"gtk-cancel",
GTK_RESPONSE_CANCEL,
"gtk-ok",
GTK_RESPONSE_OK,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_Cancel"), "process-stop", GTK_RESPONSE_CANCEL);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_OK"), "gtk-ok", GTK_RESPONSE_OK);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_Help"), "help-browser", GTK_RESPONSE_HELP);

gtk_window_set_title (GTK_WINDOW (dlg), _("Set language"));
gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
@@ -151,8 +151,10 @@ set_logout_mode (PlumaCloseConfirmationDialog *dlg,
_("Close _without Saving"),
GTK_RESPONSE_NO);

gtk_dialog_add_button (GTK_DIALOG (dlg),
"gtk-cancel", GTK_RESPONSE_CANCEL);
pluma_dialog_add_button (GTK_DIALOG (dlg),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);
}

if (dlg->priv->disable_save_to_disk)
@@ -162,7 +164,7 @@ set_logout_mode (PlumaCloseConfirmationDialog *dlg,
}
else
{
const gchar *icon_id = "gtk-save";
const gchar *icon_id = "document-save";

if (GET_MODE (dlg->priv) == SINGLE_DOC_MODE)
{
@@ -172,12 +174,19 @@ set_logout_mode (PlumaCloseConfirmationDialog *dlg,

if (pluma_document_get_readonly (doc) ||
pluma_document_is_untitled (doc))
icon_id = "gtk-save-as";
icon_id = "document-save-as";
}

gtk_dialog_add_button (GTK_DIALOG (dlg),
icon_id,
GTK_RESPONSE_YES);
if (g_strcmp0 (icon_id, "document-save") == 0)
pluma_dialog_add_button (GTK_DIALOG (dlg),
_("_Save"),
icon_id,
GTK_RESPONSE_YES);
else
pluma_dialog_add_button (GTK_DIALOG (dlg),
_("Save _As"),
icon_id,
GTK_RESPONSE_YES);

gtk_dialog_set_default_response (GTK_DIALOG (dlg),
GTK_RESPONSE_YES);
@@ -309,14 +309,9 @@ pluma_encodings_dialog_init (PlumaEncodingsDialog *dlg)

dlg->priv = PLUMA_ENCODINGS_DIALOG_GET_PRIVATE (dlg);

gtk_dialog_add_buttons (GTK_DIALOG (dlg),
"gtk-cancel",
GTK_RESPONSE_CANCEL,
"gtk-ok",
GTK_RESPONSE_OK,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_Cancel"), "process-stop", GTK_RESPONSE_CANCEL);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_OK"), "gtk-ok", GTK_RESPONSE_OK);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_Help"), "help-browser", GTK_RESPONSE_HELP);

gtk_window_set_title (GTK_WINDOW (dlg), _("Character Encodings"));
gtk_window_set_default_size (GTK_WINDOW (dlg), 650, 400);
@@ -1081,12 +1081,8 @@ pluma_preferences_dialog_init (PlumaPreferencesDialog *dlg)

dlg->priv = PLUMA_PREFERENCES_DIALOG_GET_PRIVATE (dlg);

gtk_dialog_add_buttons (GTK_DIALOG (dlg),
"gtk-close",
GTK_RESPONSE_CLOSE,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_Close"), "window-close", GTK_RESPONSE_CLOSE);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_Help"), "help-browser", GTK_RESPONSE_HELP);

gtk_window_set_title (GTK_WINDOW (dlg), _("Pluma Preferences"));
gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
@@ -330,9 +330,7 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg)
gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);

gtk_dialog_add_buttons (GTK_DIALOG (dlg),
"gtk-close", GTK_RESPONSE_CANCEL,
NULL);
pluma_dialog_add_button (GTK_DIALOG (dlg), _("_Close"), "window-close", GTK_RESPONSE_CANCEL);

/* HIG defaults */
gtk_container_set_border_width (GTK_CONTAINER (dlg), 5);
@@ -579,9 +579,10 @@ replace_read_only_file (GtkWindow *parent, GFile *file)
_("Do you want to try to replace it "
"with the one you are saving?"));

gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel",
GTK_RESPONSE_CANCEL);
pluma_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);

pluma_dialog_add_button (GTK_DIALOG (dialog),
_("_Replace"),
@@ -1218,9 +1219,10 @@ revert_dialog (PlumaWindow *window,

gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);

gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel",
GTK_RESPONSE_CANCEL);
pluma_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);

pluma_dialog_add_button (GTK_DIALOG (dialog),
_("_Revert"),

0 comments on commit 15f06ce

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