summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-02-17 00:22:33 +0100
committerraveit65 <[email protected]>2018-02-20 09:58:55 +0100
commit1d82cc7c517fd84e6428ebb7ef29583240176af9 (patch)
treeb1f63f9625746c76ec4ac3879e46cada200aef95
parent12e54c41f48a55cd213d2b004d0c3c2cb0a535c3 (diff)
downloadpluma-1d82cc7c517fd84e6428ebb7ef29583240176af9.tar.bz2
pluma-1d82cc7c517fd84e6428ebb7ef29583240176af9.tar.xz
avoid deprecated GtkButton:use-stock
-rw-r--r--plugins/filebrowser/pluma-file-browser-plugin.c8
-rw-r--r--plugins/filebrowser/pluma-file-browser-utils.c27
-rw-r--r--plugins/filebrowser/pluma-file-browser-utils.h4
-rw-r--r--pluma/dialogs/pluma-search-dialog.c7
4 files changed, 14 insertions, 32 deletions
diff --git a/plugins/filebrowser/pluma-file-browser-plugin.c b/plugins/filebrowser/pluma-file-browser-plugin.c
index 775d7b36..e3a5d1c9 100644
--- a/plugins/filebrowser/pluma-file-browser-plugin.c
+++ b/plugins/filebrowser/pluma-file-browser-plugin.c
@@ -1140,9 +1140,7 @@ on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
result = pluma_file_browser_utils_confirmation_dialog (window,
GTK_MESSAGE_QUESTION,
message,
- secondary,
- "gtk-delete",
- NULL);
+ secondary);
g_free (secondary);
return result;
@@ -1175,9 +1173,7 @@ on_confirm_delete_cb (PlumaFileBrowserWidget *widget,
result = pluma_file_browser_utils_confirmation_dialog (PLUMA_WINDOW (data->window),
GTK_MESSAGE_QUESTION,
message,
- secondary,
- "gtk-delete",
- NULL);
+ secondary);
g_free (message);
diff --git a/plugins/filebrowser/pluma-file-browser-utils.c b/plugins/filebrowser/pluma-file-browser-utils.c
index 1443125a..8a2fbf64 100644
--- a/plugins/filebrowser/pluma-file-browser-utils.c
+++ b/plugins/filebrowser/pluma-file-browser-utils.c
@@ -22,6 +22,9 @@
#include "pluma-file-browser-utils.h"
#include <pluma/pluma-utils.h>
+#include <glib/gi18n.h>
+
+
static GdkPixbuf *
process_icon_pixbuf (GdkPixbuf * pixbuf,
gchar const * name,
@@ -148,9 +151,7 @@ gboolean
pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
GtkMessageType type,
gchar const *message,
- gchar const *secondary,
- gchar const * button_image,
- gchar const * button_label)
+ gchar const *secondary)
{
GtkWidget *dlg;
gint ret;
@@ -167,11 +168,8 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
(GTK_MESSAGE_DIALOG (dlg), "%s", secondary);
/* Add a cancel button */
- button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
- "label", "gtk-cancel",
- "use-stock", TRUE,
- "use-underline", TRUE,
- NULL));
+ button = gtk_button_new_with_mnemonic (_("_Cancel"));
+ gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_BUTTON));
gtk_widget_show (button);
@@ -180,16 +178,9 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
button,
GTK_RESPONSE_CANCEL);
- /* Add custom button */
- button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
- "label", button_image,
- "use-stock", TRUE,
- "use-underline", TRUE,
- NULL));
-
- if (button_label) {
- gtk_button_set_label (GTK_BUTTON (button), button_label);
- }
+ /* Add delete button */
+ button = gtk_button_new_with_mnemonic (_("_Delete"));
+ gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("edit-delete", GTK_ICON_SIZE_BUTTON));
gtk_widget_show (button);
gtk_widget_set_can_default (button, TRUE);
diff --git a/plugins/filebrowser/pluma-file-browser-utils.h b/plugins/filebrowser/pluma-file-browser-utils.h
index ffe6159e..e882055a 100644
--- a/plugins/filebrowser/pluma-file-browser-utils.h
+++ b/plugins/filebrowser/pluma-file-browser-utils.h
@@ -18,9 +18,7 @@ gchar * pluma_file_browser_utils_uri_basename (gchar const * uri);
gboolean pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
GtkMessageType type,
gchar const *message,
- gchar const *secondary,
- gchar const * button_image,
- gchar const * button_label);
+ gchar const *secondary);
#endif /* __PLUMA_FILE_BROWSER_UTILS_H__ */
diff --git a/pluma/dialogs/pluma-search-dialog.c b/pluma/dialogs/pluma-search-dialog.c
index da2b9067..acd55ba5 100644
--- a/pluma/dialogs/pluma-search-dialog.c
+++ b/pluma/dialogs/pluma-search-dialog.c
@@ -416,11 +416,8 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg)
gtk_label_set_mnemonic_widget (GTK_LABEL (dlg->priv->replace_label),
dlg->priv->replace_entry);
- dlg->priv->find_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
- "label", "gtk-find",
- "use-stock", TRUE,
- "use-underline", TRUE,
- NULL));
+ dlg->priv->find_button = gtk_button_new_with_mnemonic (_("_Find"));
+ gtk_button_set_image (GTK_BUTTON (dlg->priv->find_button), gtk_image_new_from_icon_name ("edit-find", GTK_ICON_SIZE_BUTTON));
dlg->priv->replace_all_button = gtk_button_new_with_mnemonic (_("Replace _All"));
dlg->priv->replace_button = pluma_gtk_button_new_with_icon (_("_Replace"),