gtkdisco: Port off of GtkStock

Wed, 02 May 2018 16:54:05 -0500

author
Mike Ruprecht <cmaiku@gmail.com>
date
Wed, 02 May 2018 16:54:05 -0500
changeset 39008
a705bd1673dd
parent 39007
76bcdc258fb2
child 39009
2ef48f087c74

gtkdisco: Port off of GtkStock

This patch ports the XMPP Service Discovery (GtkDisco) plugin to stop
using the deprecated GtkStock. This involved replacing GtkStock
constants with the mnemonic labels they represent. In this case any
icons that were used went against the Gnome HIG guidelines (they were
used with verb items) and were therefore removed.

It also ports a couple of the dialog buttons to use
pidgin_dialog_add_button() for simplicity. Arguably these could use
gtk_dialog_add_button() or similar, but that triggers the "response"
signal, and I don't want to overstuff this patch.

pidgin/plugins/disco/gtkdisco.c file | annotate | diff | comparison | revisions
--- a/pidgin/plugins/disco/gtkdisco.c	Wed May 02 16:50:28 2018 -0500
+++ b/pidgin/plugins/disco/gtkdisco.c	Wed May 02 16:54:05 2018 -0500
@@ -304,7 +304,7 @@
 	menu = gtk_menu_new();
 
 	if (service->flags & XMPP_DISCO_ADD)
-		pidgin_new_menu_item(menu, _("Add to Buddy List"), GTK_STOCK_ADD,
+		pidgin_new_menu_item(menu, _("Add to Buddy List"), NULL,
                                 G_CALLBACK(add_to_blist_cb), pdl->dialog);
 
 	if (service->flags & XMPP_DISCO_REGISTER) {
@@ -666,19 +666,15 @@
 
 	/* stop button */
 	dialog->stop_button =
-		pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_STOP,
+		pidgin_dialog_add_button(GTK_DIALOG(window), _("_Stop"),
 		                         G_CALLBACK(stop_button_cb), dialog);
 	gtk_widget_set_sensitive(dialog->stop_button, FALSE);
 
 	/* browse button */
 	dialog->browse_button =
-		pidgin_pixbuf_button_from_stock(_("_Browse"), GTK_STOCK_REFRESH,
-		                                PIDGIN_BUTTON_HORIZONTAL);
-	gtk_box_pack_start(GTK_BOX(bbox), dialog->browse_button, FALSE, FALSE, 0);
-	g_signal_connect(G_OBJECT(dialog->browse_button), "clicked",
-	                 G_CALLBACK(browse_button_cb), dialog);
+		pidgin_dialog_add_button(GTK_DIALOG(window), _("_Browse"),
+		                         G_CALLBACK(browse_button_cb), dialog);
 	gtk_widget_set_sensitive(dialog->browse_button, dialog->account != NULL);
-	gtk_widget_show(dialog->browse_button);
 
 	/* register button */
 	dialog->register_button =
@@ -688,17 +684,13 @@
 
 	/* add button */
 	dialog->add_button =
-		pidgin_pixbuf_button_from_stock(_("_Add"), GTK_STOCK_ADD,
-	                                    PIDGIN_BUTTON_HORIZONTAL);
-	gtk_box_pack_start(GTK_BOX(bbox), dialog->add_button, FALSE, FALSE, 0);
-	g_signal_connect(G_OBJECT(dialog->add_button), "clicked",
-	                 G_CALLBACK(add_to_blist_cb), dialog);
+		pidgin_dialog_add_button(GTK_DIALOG(dialog->window), _("_Add"),
+		                         G_CALLBACK(add_to_blist_cb), dialog);
 	gtk_widget_set_sensitive(dialog->add_button, FALSE);
-	gtk_widget_show(dialog->add_button);
 
 	/* close button */
 	dialog->close_button =
-		pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CLOSE,
+		pidgin_dialog_add_button(GTK_DIALOG(window), _("_Close"),
 		                         G_CALLBACK(close_button_cb), dialog);
 
 	/* show the dialog window and return the dialog */

mercurial