[Xfce4-commits] [apps/xfce4-dict] 01/02: Replace GtkStock buttons

noreply at xfce.org noreply at xfce.org
Fri Aug 2 05:11:24 CEST 2019


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-dict.

commit 206a85060768cc016eb682d0e3996b0b989b302d
Author: Andre Miranda <andreldm at xfce.org>
Date:   Fri Aug 2 00:09:57 2019 -0300

    Replace GtkStock buttons
---
 lib/dictd.c       |  8 +++-----
 lib/gui.c         | 30 +++++++++++++++---------------
 lib/prefs.c       | 10 +++++-----
 lib/speedreader.c | 36 +++++++++++++++++++++---------------
 4 files changed, 44 insertions(+), 40 deletions(-)

diff --git a/lib/dictd.c b/lib/dictd.c
index 5d7c588..24aec64 100644
--- a/lib/dictd.c
+++ b/lib/dictd.c
@@ -25,10 +25,8 @@
 #include <config.h>
 #endif
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <gtk/gtk.h>
-#include <glib/gi18n.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include <signal.h>
 #include <sys/types.h>
@@ -759,10 +757,10 @@ void dict_dictd_get_information(GtkWidget *button, DictData *dd)
 	*end = '\0';
 
 	text = g_strdup_printf(_("Server Information for \"%s\""), server);
-	dialog = gtk_dialog_new_with_buttons(text,
+	dialog = xfce_titled_dialog_new_with_mixed_buttons(text,
 				GTK_WINDOW(dd->window),
 				GTK_DIALOG_DESTROY_WITH_PARENT,
-				"gtk-close", GTK_RESPONSE_CLOSE, NULL);
+				"window-close", _("_Close"), GTK_RESPONSE_CLOSE, NULL);
 	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
 	gtk_container_add(GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), vbox);
diff --git a/lib/gui.c b/lib/gui.c
index a1fb564..5315843 100644
--- a/lib/gui.c
+++ b/lib/gui.c
@@ -360,7 +360,7 @@ static void textview_populate_popup_cb(GtkTextView *textview, GtkMenu *menu, Dic
 
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 	copy_link = gtk_image_menu_item_new_with_mnemonic (_("Copy Link"));
-	icon = gtk_image_new_from_icon_name ("gtk-copy", GTK_ICON_SIZE_MENU);
+	icon = gtk_image_new_from_icon_name ("edit-copy", GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (copy_link), icon);
 G_GNUC_END_IGNORE_DEPRECATIONS
 
@@ -370,7 +370,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 	search = gtk_image_menu_item_new_with_mnemonic (_("Search"));
-	icon = gtk_image_new_from_icon_name ("gtk-find", GTK_ICON_SIZE_MENU);
+	icon = gtk_image_new_from_icon_name ("edit-find", GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (search), icon);
 G_GNUC_END_IGNORE_DEPRECATIONS
 
@@ -604,20 +604,20 @@ static void update_search_button(DictData *dd, GtkWidget *box)
 	{
 		button = gtk_button_new_with_mnemonic (_("F_ind"));
 		gtk_button_set_image(GTK_BUTTON(button),
-			gtk_image_new_from_icon_name("gtk-find", GTK_ICON_SIZE_BUTTON));
+			gtk_image_new_from_icon_name("edit-find", GTK_ICON_SIZE_BUTTON));
 		gtk_widget_show(button);
 		gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
 		g_signal_connect(button, "clicked", G_CALLBACK(entry_button_clicked_cb), dd);
 
-		/* "internet-web-browser" is Tango, "web-browser" is Rodent, "gtk-find" is GTK */
-		web_image_name = get_icon_name("internet-web-browser", "web-browser", "gtk-find");
+		/* "internet-web-browser" is Tango, "web-browser" is Rodent, "edit-find" is GTK */
+		web_image_name = get_icon_name("internet-web-browser", "web-browser", "edit-find");
 	}
 
 	switch (dd->mode_in_use)
 	{
 		case DICTMODE_DICT:
 		{
-			image = gtk_image_new_from_icon_name("gtk-find", GTK_ICON_SIZE_BUTTON);
+			image = gtk_image_new_from_icon_name("edit-find", GTK_ICON_SIZE_BUTTON);
 			break;
 		}
 		case DICTMODE_WEB:
@@ -627,7 +627,7 @@ static void update_search_button(DictData *dd, GtkWidget *box)
 		}
 		case DICTMODE_SPELL:
 		{
-			image = gtk_image_new_from_icon_name("gtk-spell-check", GTK_ICON_SIZE_BUTTON);
+			image = gtk_image_new_from_icon_name("tools-check-spelling", GTK_ICON_SIZE_BUTTON);
 			break;
 		}
 		default:
@@ -699,7 +699,7 @@ static GtkWidget *create_file_menu(DictData *dd)
 	/* Speed Reader */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 	menu_item = gtk_image_menu_item_new_with_mnemonic (_("Speed _Reader"));
-	icon = gtk_image_new_from_icon_name ("gtk-justify-center", GTK_ICON_SIZE_MENU);
+	icon = gtk_image_new_from_icon_name ("format-justify-center", GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), icon);
 G_GNUC_END_IGNORE_DEPRECATIONS
 
@@ -714,7 +714,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 	/* Preferences */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 	dd->pref_menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Preferences"));
-	icon = gtk_image_new_from_icon_name ("gtk-preferences", GTK_ICON_SIZE_MENU);
+	icon = gtk_image_new_from_icon_name ("preferences-system", GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (dd->pref_menu_item), icon);
 G_GNUC_END_IGNORE_DEPRECATIONS
 
@@ -728,7 +728,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 	/* Close */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 	dd->close_menu_item = gtk_image_menu_item_new_with_mnemonic (dd->is_plugin ? _("_Close") : _("_Quit"));
-	icon = gtk_image_new_from_icon_name (dd->is_plugin ? "gtk-close" : "gtk-quit", GTK_ICON_SIZE_MENU);
+	icon = gtk_image_new_from_icon_name (dd->is_plugin ? "window-close" : "application-exit", GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (dd->close_menu_item), icon);
 G_GNUC_END_IGNORE_DEPRECATIONS
 
@@ -746,7 +746,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 	/* About */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 	menu_item = gtk_image_menu_item_new_with_mnemonic (_("About"));
-	icon = gtk_image_new_from_icon_name ("gtk-about", GTK_ICON_SIZE_MENU);
+	icon = gtk_image_new_from_icon_name ("help-about", GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), icon);
 G_GNUC_END_IGNORE_DEPRECATIONS
 
@@ -812,8 +812,8 @@ void dict_gui_create_main_window(DictData *dd)
 
 	dd->main_entry = gtk_bin_get_child(GTK_BIN(dd->main_combo));
 	gtk_entry_set_placeholder_text(GTK_ENTRY(dd->main_entry), _("Search term"));
-	gtk_entry_set_icon_from_icon_name(GTK_ENTRY(dd->main_entry), GTK_ENTRY_ICON_PRIMARY, "gtk-find");
-	gtk_entry_set_icon_from_icon_name(GTK_ENTRY(dd->main_entry), GTK_ENTRY_ICON_SECONDARY, "gtk-clear");
+	gtk_entry_set_icon_from_icon_name(GTK_ENTRY(dd->main_entry), GTK_ENTRY_ICON_PRIMARY, "edit-find");
+	gtk_entry_set_icon_from_icon_name(GTK_ENTRY(dd->main_entry), GTK_ENTRY_ICON_SECONDARY, "edit-clear");
 	g_signal_connect(dd->main_entry, "changed", G_CALLBACK(entry_changed_cb), dd);
 	g_signal_connect(dd->main_entry, "activate", G_CALLBACK(entry_activate_cb), dd);
 	g_signal_connect(dd->main_entry, "icon-release", G_CALLBACK(entry_icon_release_cb), dd);
@@ -827,7 +827,7 @@ void dict_gui_create_main_window(DictData *dd)
 
 	button = gtk_button_new_with_mnemonic(_("Speed _Reader"));
 	gtk_button_set_image(GTK_BUTTON(button),
-		gtk_image_new_from_icon_name("gtk-justify-center", GTK_ICON_SIZE_MENU));
+		gtk_image_new_from_icon_name("format-justify-center", GTK_ICON_SIZE_MENU));
 	g_signal_connect(button, "clicked", G_CALLBACK(speedreader_clicked_cb), dd);
 	gtk_widget_show(button);
 	gtk_box_pack_start(GTK_BOX(entry_box), button, FALSE, FALSE, 2);
@@ -840,7 +840,7 @@ void dict_gui_create_main_window(DictData *dd)
 		_("_Close") : _("_Quit"));
 	gtk_button_set_image(GTK_BUTTON(dd->close_button),
 		gtk_image_new_from_icon_name((dd->is_plugin) ?
-			"gtk-close" : "gtk-quit", GTK_ICON_SIZE_BUTTON));
+			"window-close" : "application-exit", GTK_ICON_SIZE_BUTTON));
 	gtk_widget_show(dd->close_button);
 	gtk_box_pack_end(GTK_BOX(entry_box), dd->close_button, FALSE, FALSE, 0);
 
diff --git a/lib/prefs.c b/lib/prefs.c
index 3ea005b..e6125f7 100644
--- a/lib/prefs.c
+++ b/lib/prefs.c
@@ -226,7 +226,7 @@ static gboolean spell_entry_focus_cb(GtkEntry *entry, GdkEventFocus *ev, GtkWidg
 		g_free(path);
 	}
 	else
-		gtk_image_set_from_icon_name(GTK_IMAGE(icon), "gtk-stop", GTK_ICON_SIZE_BUTTON);
+		gtk_image_set_from_icon_name(GTK_IMAGE(icon), "process-stop", GTK_ICON_SIZE_BUTTON);
 
 	return FALSE;
 }
@@ -261,10 +261,10 @@ GtkWidget *dict_prefs_dialog_show(GtkWidget *parent, DictData *dd)
 	GtkWidget *dialog, *inner_vbox, *notebook, *notebook_vbox;
 	GtkWidget *label1, *label2, *label3;
 
-	dialog = xfce_titled_dialog_new_with_buttons(
+	dialog = xfce_titled_dialog_new_with_mixed_buttons(
 		_("Dictionary"), GTK_WINDOW(parent),
 		GTK_DIALOG_DESTROY_WITH_PARENT,
-		"gtk-close", GTK_RESPONSE_OK,
+		"window-close", _("_Close"), GTK_RESPONSE_OK,
 		NULL);
 
 	gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
@@ -498,7 +498,7 @@ GtkWidget *dict_prefs_dialog_show(GtkWidget *parent, DictData *dd)
 		g_object_set_data(G_OBJECT(dialog), "port_spinner", port_spinner);
 		g_object_set_data(G_OBJECT(dialog), "dict_combo", dict_combo);
 
-		button_get_list = gtk_button_new_from_icon_name("gtk-refresh", GTK_ICON_SIZE_BUTTON);
+		button_get_list = gtk_button_new_from_icon_name("view-refresh", GTK_ICON_SIZE_BUTTON);
 		gtk_widget_show(button_get_list);
 		g_signal_connect(button_get_list, "clicked", G_CALLBACK(dict_dictd_get_list), dd);
 		g_object_set_data(G_OBJECT(button_get_list), "dict_combo", dict_combo);
@@ -642,7 +642,7 @@ GtkWidget *dict_prefs_dialog_show(GtkWidget *parent, DictData *dd)
 		g_signal_connect(spell_combo, "changed", G_CALLBACK(spell_combo_changed_cb), dd);
 		gtk_widget_show(spell_combo);
 
-		button_refresh = gtk_button_new_from_icon_name("gtk-refresh", GTK_ICON_SIZE_BUTTON);
+		button_refresh = gtk_button_new_from_icon_name("view-refresh", GTK_ICON_SIZE_BUTTON);
 		gtk_widget_show(button_refresh);
 		g_object_set_data(G_OBJECT(button_refresh), "spell_combo", spell_combo);
 		g_signal_connect(button_refresh, "clicked", G_CALLBACK(button_dict_refresh_cb), dd);
diff --git a/lib/speedreader.c b/lib/speedreader.c
index f4670ff..8e8552e 100644
--- a/lib/speedreader.c
+++ b/lib/speedreader.c
@@ -20,7 +20,7 @@
 #endif
 
 #include <gtk/gtk.h>
-#include <glib/gi18n.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "common.h"
 #include "speedreader.h"
@@ -251,7 +251,7 @@ static void xfd_speed_reader_set_window_title(XfdSpeedReader *dialog, gint state
 {
 	gchar *title, *state_str, *name;
 	const gchar *button_label = _("S_top");
-	const gchar *button_image = "gtk-media-stop";
+	const gchar *button_image = "media-playback-stop";
 	gboolean pausable = TRUE;
 	XfdSpeedReaderPrivate *priv = XFD_SPEED_READER_GET_PRIVATE(dialog);
 
@@ -263,7 +263,7 @@ static void xfd_speed_reader_set_window_title(XfdSpeedReader *dialog, gint state
 		case XSR_STATE_FINISHED:
 			state_str = _("Finished");
 			button_label = _("_Back");
-			button_image = "gtk-go-back";
+			button_image = "go-previous";
 			pausable = FALSE;
 			break;
 		default:
@@ -470,13 +470,13 @@ static void sr_pause(XfdSpeedReader *dialog, gboolean paused)
 	if (paused)
 	{
 		gtk_button_set_image(GTK_BUTTON(priv->button_pause),
-			gtk_image_new_from_icon_name("gtk-media-play", GTK_ICON_SIZE_MENU));
+			gtk_image_new_from_icon_name("media-playback-start", GTK_ICON_SIZE_MENU));
 		gtk_button_set_label(GTK_BUTTON(priv->button_pause), XFD_TITLE_RESUME);
 	}
 	else
 	{
 		gtk_button_set_image(GTK_BUTTON(priv->button_pause),
-			gtk_image_new_from_icon_name("gtk-media-pause", GTK_ICON_SIZE_MENU));
+			gtk_image_new_from_icon_name("media-playback-pause", GTK_ICON_SIZE_MENU));
 		gtk_button_set_label(GTK_BUTTON(priv->button_pause), XFD_TITLE_PAUSE);
 	}
 	/* set the new value */
@@ -529,8 +529,8 @@ static void sr_open_clicked_cb(GtkButton *button, XfdSpeedReader *window)
 	dialog = gtk_file_chooser_dialog_new(_("Choose a file to load"),
 		GTK_WINDOW(window),
 		GTK_FILE_CHOOSER_ACTION_OPEN,
-		"gtk-cancel", GTK_RESPONSE_CANCEL,
-		"gtk-open", GTK_RESPONSE_ACCEPT,
+		_("_Cancel"), GTK_RESPONSE_CANCEL,
+		_("_Open"), GTK_RESPONSE_ACCEPT,
 		NULL);
 
 	gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
@@ -594,7 +594,7 @@ static void xfd_speed_reader_init(XfdSpeedReader *dialog)
 {
 	GtkWidget *label_intro, *label_words, *label_font, *label_grouping, *label_grouping_desc;
 	GtkWidget *vbox, *hbox_words, *hbox_font, *hbox_grouping, *swin, *textview;
-	GtkWidget *vbox_text_buttons, *hbox_text, *button_clear, *button_paste, *button_open;
+	GtkWidget *vbox_text_buttons, *hbox_text, *button_clear, *button_paste, *button_open, *button_close;
 	GtkSizeGroup *sizegroup;
 	XfdSpeedReaderPrivate *priv = XFD_SPEED_READER_GET_PRIVATE(dialog);
 
@@ -673,16 +673,16 @@ static void xfd_speed_reader_init(XfdSpeedReader *dialog)
 					GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_container_add(GTK_CONTAINER(swin), textview);
 
-	button_open = gtk_button_new_from_icon_name("gtk-open", GTK_ICON_SIZE_MENU);
+	button_open = gtk_button_new_from_icon_name("document-open", GTK_ICON_SIZE_MENU);
 	g_signal_connect(button_open, "clicked", G_CALLBACK(sr_open_clicked_cb), dialog);
 	gtk_widget_set_tooltip_text(button_open, _("Load the contents of a file"));
 
-	button_paste = gtk_button_new_from_icon_name("gtk-paste", GTK_ICON_SIZE_MENU);
+	button_paste = gtk_button_new_from_icon_name("edit-paste", GTK_ICON_SIZE_MENU);
 	g_signal_connect(button_paste, "clicked", G_CALLBACK(sr_paste_clicked_cb), priv->buffer);
 	gtk_widget_set_tooltip_text(button_paste,
 		_("Clear the contents of the text field and paste the contents of the clipboard"));
 
-	button_clear = gtk_button_new_from_icon_name("gtk-clear", GTK_ICON_SIZE_MENU);
+	button_clear = gtk_button_new_from_icon_name("edit-clear", GTK_ICON_SIZE_MENU);
 	g_signal_connect(button_clear, "clicked", G_CALLBACK(sr_clear_clicked_cb), priv->buffer);
 	gtk_widget_set_tooltip_text(button_clear, _("Clear the contents of the text field"));
 
@@ -695,16 +695,22 @@ static void xfd_speed_reader_init(XfdSpeedReader *dialog)
 	gtk_box_pack_start(GTK_BOX(hbox_text), swin, TRUE, TRUE, 0);
 	gtk_box_pack_start(GTK_BOX(hbox_text), vbox_text_buttons, FALSE, FALSE, 3);
 
-	priv->button_pause = gtk_dialog_add_button(GTK_DIALOG(dialog), "gtk-media-pause", RESPONSE_PAUSE);
+	priv->button_pause = gtk_dialog_add_button(GTK_DIALOG(dialog), _("P_ause"), RESPONSE_PAUSE);
 	priv->button_start = gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Start"), RESPONSE_START);
-	priv->button_stop = gtk_dialog_add_button(GTK_DIALOG(dialog), "gtk-media-stop", RESPONSE_STOP);
-	gtk_dialog_add_button(GTK_DIALOG(dialog), "gtk-close", GTK_RESPONSE_CLOSE);
+	priv->button_stop = gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Stop"), RESPONSE_STOP);
+	button_close = gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Close"), GTK_RESPONSE_CLOSE);
 
 	gtk_widget_hide(priv->button_pause);
 	gtk_widget_hide(priv->button_stop);
 
+	gtk_button_set_image(GTK_BUTTON(priv->button_pause),
+		gtk_image_new_from_icon_name("media-playback-pause", GTK_ICON_SIZE_MENU));
 	gtk_button_set_image(GTK_BUTTON(priv->button_start),
-		gtk_image_new_from_icon_name("gtk-media-play", GTK_ICON_SIZE_MENU));
+		gtk_image_new_from_icon_name("media-playback-start", GTK_ICON_SIZE_MENU));
+	gtk_button_set_image(GTK_BUTTON(priv->button_stop),
+		gtk_image_new_from_icon_name("media-playback-stop", GTK_ICON_SIZE_MENU));
+	gtk_button_set_image(GTK_BUTTON(button_close),
+		gtk_image_new_from_icon_name("window-close", GTK_ICON_SIZE_MENU));
 
 	g_signal_connect(dialog, "response", G_CALLBACK(xfd_speed_reader_response_cb), NULL);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list