Skip to content

Commit 1d82cc7

Browse files
sc0wraveit65
authored andcommitted
avoid deprecated GtkButton:use-stock
1 parent 12e54c4 commit 1d82cc7

File tree

4 files changed

+14
-32
lines changed

4 files changed

+14
-32
lines changed

‎plugins/filebrowser/pluma-file-browser-plugin.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,9 +1140,7 @@ on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
11401140
result = pluma_file_browser_utils_confirmation_dialog (window,
11411141
GTK_MESSAGE_QUESTION,
11421142
message,
1143-
secondary,
1144-
"gtk-delete",
1145-
NULL);
1143+
secondary);
11461144
g_free (secondary);
11471145

11481146
return result;
@@ -1175,9 +1173,7 @@ on_confirm_delete_cb (PlumaFileBrowserWidget *widget,
11751173
result = pluma_file_browser_utils_confirmation_dialog (PLUMA_WINDOW (data->window),
11761174
GTK_MESSAGE_QUESTION,
11771175
message,
1178-
secondary,
1179-
"gtk-delete",
1180-
NULL);
1176+
secondary);
11811177

11821178
g_free (message);
11831179

‎plugins/filebrowser/pluma-file-browser-utils.c‎

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include "pluma-file-browser-utils.h"
2323
#include <pluma/pluma-utils.h>
2424

25+
#include <glib/gi18n.h>
26+
27+
2528
static GdkPixbuf *
2629
process_icon_pixbuf (GdkPixbuf * pixbuf,
2730
gchar const * name,
@@ -148,9 +151,7 @@ gboolean
148151
pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
149152
GtkMessageType type,
150153
gchar const *message,
151-
gchar const *secondary,
152-
gchar const * button_image,
153-
gchar const * button_label)
154+
gchar const *secondary)
154155
{
155156
GtkWidget *dlg;
156157
gint ret;
@@ -167,11 +168,8 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
167168
(GTK_MESSAGE_DIALOG (dlg), "%s", secondary);
168169

169170
/* Add a cancel button */
170-
button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
171-
"label", "gtk-cancel",
172-
"use-stock", TRUE,
173-
"use-underline", TRUE,
174-
NULL));
171+
button = gtk_button_new_with_mnemonic (_("_Cancel"));
172+
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_BUTTON));
175173

176174
gtk_widget_show (button);
177175

@@ -180,16 +178,9 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
180178
button,
181179
GTK_RESPONSE_CANCEL);
182180

183-
/* Add custom button */
184-
button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
185-
"label", button_image,
186-
"use-stock", TRUE,
187-
"use-underline", TRUE,
188-
NULL));
189-
190-
if (button_label) {
191-
gtk_button_set_label (GTK_BUTTON (button), button_label);
192-
}
181+
/* Add delete button */
182+
button = gtk_button_new_with_mnemonic (_("_Delete"));
183+
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("edit-delete", GTK_ICON_SIZE_BUTTON));
193184

194185
gtk_widget_show (button);
195186
gtk_widget_set_can_default (button, TRUE);

‎plugins/filebrowser/pluma-file-browser-utils.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ gchar * pluma_file_browser_utils_uri_basename (gchar const * uri);
1818
gboolean pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
1919
GtkMessageType type,
2020
gchar const *message,
21-
gchar const *secondary,
22-
gchar const * button_image,
23-
gchar const * button_label);
21+
gchar const *secondary);
2422

2523
#endif /* __PLUMA_FILE_BROWSER_UTILS_H__ */
2624

‎pluma/dialogs/pluma-search-dialog.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,8 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg)
416416
gtk_label_set_mnemonic_widget (GTK_LABEL (dlg->priv->replace_label),
417417
dlg->priv->replace_entry);
418418

419-
dlg->priv->find_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
420-
"label", "gtk-find",
421-
"use-stock", TRUE,
422-
"use-underline", TRUE,
423-
NULL));
419+
dlg->priv->find_button = gtk_button_new_with_mnemonic (_("_Find"));
420+
gtk_button_set_image (GTK_BUTTON (dlg->priv->find_button), gtk_image_new_from_icon_name ("edit-find", GTK_ICON_SIZE_BUTTON));
424421

425422
dlg->priv->replace_all_button = gtk_button_new_with_mnemonic (_("Replace _All"));
426423
dlg->priv->replace_button = pluma_gtk_button_new_with_icon (_("_Replace"),

0 commit comments

Comments
 (0)