Skip to content

Commit 4de5f87

Browse files
committed
avoid 'pluma_file_chooser_dialog_new' with stock ids
1 parent ac1a336 commit 4de5f87

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

‎pluma/pluma-commands-file.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ _pluma_cmd_file_open (GtkAction *action,
464464
GTK_WINDOW (window),
465465
GTK_FILE_CHOOSER_ACTION_OPEN,
466466
NULL,
467-
"gtk-cancel", GTK_RESPONSE_CANCEL,
468-
"gtk-open", GTK_RESPONSE_OK,
467+
"process-stop", GTK_RESPONSE_CANCEL,
468+
"document-open", GTK_RESPONSE_OK,
469469
NULL);
470470

471471
g_object_set_data (G_OBJECT (window),
@@ -758,8 +758,8 @@ file_save_as (PlumaTab *tab,
758758
GTK_WINDOW (window),
759759
GTK_FILE_CHOOSER_ACTION_SAVE,
760760
NULL,
761-
"gtk-cancel", GTK_RESPONSE_CANCEL,
762-
"gtk-save", GTK_RESPONSE_OK,
761+
"process-stop", GTK_RESPONSE_CANCEL,
762+
"document-save", GTK_RESPONSE_OK,
763763
NULL);
764764

765765
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (save_dialog),

‎pluma/pluma-file-chooser-dialog.c‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "pluma-prefs-manager-app.h"
4848
#include "pluma-debug.h"
4949
#include "pluma-enum-types.h"
50+
#include "pluma-utils.h"
5051

5152
#define PLUMA_FILE_CHOOSER_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_FILE_CHOOSER_DIALOG, PlumaFileChooserDialogPrivate))
5253

@@ -435,7 +436,15 @@ pluma_file_chooser_dialog_new_valist (const gchar *title,
435436
{
436437
response_id = va_arg (varargs, gint);
437438

438-
gtk_dialog_add_button (GTK_DIALOG (result), button_text, response_id);
439+
if (g_strcmp0 (button_text, "process-stop") == 0)
440+
pluma_dialog_add_button (GTK_DIALOG (result), _("_Cancel"), button_text, response_id);
441+
else if (g_strcmp0 (button_text, "document-open") == 0)
442+
pluma_dialog_add_button (GTK_DIALOG (result), _("_Open"), button_text, response_id);
443+
else if (g_strcmp0 (button_text, "document-save") == 0)
444+
pluma_dialog_add_button (GTK_DIALOG (result), _("_Save"), button_text, response_id);
445+
else
446+
gtk_dialog_add_button (GTK_DIALOG (result), button_text, response_id);
447+
439448
if ((response_id == GTK_RESPONSE_OK) ||
440449
(response_id == GTK_RESPONSE_ACCEPT) ||
441450
(response_id == GTK_RESPONSE_YES) ||
@@ -453,7 +462,7 @@ pluma_file_chooser_dialog_new_valist (const gchar *title,
453462
* @title: (allow-none): Title of the dialog, or %NULL
454463
* @parent: (allow-none): Transient parent of the dialog, or %NULL
455464
* @action: Open or save mode for the dialog
456-
* @first_button_text: (allow-none): stock ID or text to go in
465+
* @first_button_text: (allow-none): icon name or text to go in
457466
* the first button, or %NULL
458467
* @...: (allow-none): response ID for the first button, then
459468
* additional (button, id) pairs, ending with %NULL

0 commit comments

Comments
 (0)