diff options
author | Pablo Barciela <[email protected]> | 2018-04-14 01:53:50 +0200 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2018-04-14 01:53:50 +0200 |
commit | 4de5f8786543f0c2b0972b6273051892982bf308 (patch) | |
tree | 648f31abae35d7a13fa85a4ebf1fb3b1016344b2 | |
parent | ac1a33614fd26f77285ed327491e58d34376dd2d (diff) | |
download | pluma-4de5f8786543f0c2b0972b6273051892982bf308.tar.bz2 pluma-4de5f8786543f0c2b0972b6273051892982bf308.tar.xz |
avoid 'pluma_file_chooser_dialog_new' with stock ids
-rw-r--r-- | pluma/pluma-commands-file.c | 8 | ||||
-rw-r--r-- | pluma/pluma-file-chooser-dialog.c | 13 |
2 files changed, 15 insertions, 6 deletions
diff --git a/pluma/pluma-commands-file.c b/pluma/pluma-commands-file.c index 2b8b5613..e9288ce9 100644 --- a/pluma/pluma-commands-file.c +++ b/pluma/pluma-commands-file.c @@ -464,8 +464,8 @@ _pluma_cmd_file_open (GtkAction *action, GTK_WINDOW (window), GTK_FILE_CHOOSER_ACTION_OPEN, NULL, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_OK, + "process-stop", GTK_RESPONSE_CANCEL, + "document-open", GTK_RESPONSE_OK, NULL); g_object_set_data (G_OBJECT (window), @@ -758,8 +758,8 @@ file_save_as (PlumaTab *tab, GTK_WINDOW (window), GTK_FILE_CHOOSER_ACTION_SAVE, NULL, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-save", GTK_RESPONSE_OK, + "process-stop", GTK_RESPONSE_CANCEL, + "document-save", GTK_RESPONSE_OK, NULL); gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (save_dialog), diff --git a/pluma/pluma-file-chooser-dialog.c b/pluma/pluma-file-chooser-dialog.c index 9e6a855b..2b50100e 100644 --- a/pluma/pluma-file-chooser-dialog.c +++ b/pluma/pluma-file-chooser-dialog.c @@ -47,6 +47,7 @@ #include "pluma-prefs-manager-app.h" #include "pluma-debug.h" #include "pluma-enum-types.h" +#include "pluma-utils.h" #define PLUMA_FILE_CHOOSER_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_FILE_CHOOSER_DIALOG, PlumaFileChooserDialogPrivate)) @@ -435,7 +436,15 @@ pluma_file_chooser_dialog_new_valist (const gchar *title, { response_id = va_arg (varargs, gint); - gtk_dialog_add_button (GTK_DIALOG (result), button_text, response_id); + if (g_strcmp0 (button_text, "process-stop") == 0) + pluma_dialog_add_button (GTK_DIALOG (result), _("_Cancel"), button_text, response_id); + else if (g_strcmp0 (button_text, "document-open") == 0) + pluma_dialog_add_button (GTK_DIALOG (result), _("_Open"), button_text, response_id); + else if (g_strcmp0 (button_text, "document-save") == 0) + pluma_dialog_add_button (GTK_DIALOG (result), _("_Save"), button_text, response_id); + else + gtk_dialog_add_button (GTK_DIALOG (result), button_text, response_id); + if ((response_id == GTK_RESPONSE_OK) || (response_id == GTK_RESPONSE_ACCEPT) || (response_id == GTK_RESPONSE_YES) || @@ -453,7 +462,7 @@ pluma_file_chooser_dialog_new_valist (const gchar *title, * @title: (allow-none): Title of the dialog, or %NULL * @parent: (allow-none): Transient parent of the dialog, or %NULL * @action: Open or save mode for the dialog - * @first_button_text: (allow-none): stock ID or text to go in + * @first_button_text: (allow-none): icon name or text to go in * the first button, or %NULL * @...: (allow-none): response ID for the first button, then * additional (button, id) pairs, ending with %NULL |