Remove pidgin_pixbuf_button_from_stock as it is barely used and uses deprecated API

Thu, 14 Jan 2021 20:32:50 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 14 Jan 2021 20:32:50 -0600
changeset 40704
09fc97ff0b52
parent 40703
153098577f8c
child 40705
f7a1c67543e5

Remove pidgin_pixbuf_button_from_stock as it is barely used and uses deprecated API

Testing Done:
Compiled and tested locally.

Reviewed at https://reviews.imfreedom.org/r/419/

ChangeLog.API file | annotate | diff | comparison | revisions
pidgin/gtksavedstatuses.c file | annotate | diff | comparison | revisions
pidgin/gtkutils.c file | annotate | diff | comparison | revisions
pidgin/gtkutils.h file | annotate | diff | comparison | revisions
--- a/ChangeLog.API	Thu Jan 14 20:31:40 2021 -0600
+++ b/ChangeLog.API	Thu Jan 14 20:32:50 2021 -0600
@@ -699,6 +699,7 @@
 		* pidgin_make_pretty_arrows
 		* pidgin_menu_position_func_helper
 		* pidgin_mini_dialog_links_supported
+		* pidgin_pixbuf_button_from_stock
 		* pidgin_pixbuf_toolbar_button_from_stock
 		* pidgin_pounce_editor_show
 		* pidgin_pounces_get_handle
--- a/pidgin/gtksavedstatuses.c	Thu Jan 14 20:31:40 2021 -0600
+++ b/pidgin/gtksavedstatuses.c	Thu Jan 14 20:32:50 2021 -0600
@@ -564,8 +564,7 @@
 	bbox = pidgin_dialog_get_action_area(GTK_DIALOG(win));
 
 	/* Use button */
-	button = pidgin_pixbuf_button_from_stock(_("_Use"), GTK_STOCK_EXECUTE,
-										  PIDGIN_BUTTON_HORIZONTAL);
+	button = gtk_button_new_with_mnemonic(_("_Use"));
 	dialog->use_button = button;
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
 	gtk_widget_set_sensitive(button, FALSE);
@@ -1196,15 +1195,13 @@
 			G_CALLBACK(status_editor_cancel_cb), dialog);
 
 	/* Use button */
-	button = pidgin_pixbuf_button_from_stock(_("_Use"), GTK_STOCK_EXECUTE,
-										   PIDGIN_BUTTON_HORIZONTAL);
+	button = gtk_button_new_with_mnemonic(_("_Use"));
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
 	g_signal_connect(G_OBJECT(button), "clicked",
 					 G_CALLBACK(status_editor_ok_cb), dialog);
 
 	/* Save and Use button */
-	button = pidgin_pixbuf_button_from_stock(_("Sa_ve and Use"), GTK_STOCK_OK,
-										   PIDGIN_BUTTON_HORIZONTAL);
+	button = gtk_button_new_with_mnemonic(_("Sa_ve and Use"));
 	dialog->saveanduse_button = GTK_BUTTON(button);
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
 	if (dialog->original_title == NULL)
--- a/pidgin/gtkutils.c	Thu Jan 14 20:31:40 2021 -0600
+++ b/pidgin/gtkutils.c	Thu Jan 14 20:32:50 2021 -0600
@@ -188,52 +188,6 @@
 	return menuitem;
 }
 
-GtkWidget *
-pidgin_pixbuf_button_from_stock(const char *text, const char *icon,
-							  PidginButtonOrientation style)
-{
-	GtkWidget *button, *image, *bbox, *ibox, *lbox = NULL;
-
-	button = gtk_button_new();
-
-	if (style == PIDGIN_BUTTON_HORIZONTAL) {
-		bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-		ibox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-		if (text)
-			lbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-	} else {
-		bbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-		ibox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-		if (text)
-			lbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-	}
-
-	gtk_container_add(GTK_CONTAINER(button), bbox);
-
-	if (icon) {
-		gtk_box_pack_start(GTK_BOX(bbox), ibox, TRUE, TRUE, 0);
-		image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_BUTTON);
-		gtk_box_pack_end(GTK_BOX(ibox), image, FALSE, TRUE, 0);
-	}
-
-	if (text) {
-		GtkLabel *label;
-
-		gtk_box_pack_start(GTK_BOX(bbox), lbox, TRUE, TRUE, 0);
-		label = GTK_LABEL(gtk_label_new(NULL));
-		gtk_label_set_text_with_mnemonic(label, text);
-		gtk_label_set_mnemonic_widget(label, button);
-		gtk_box_pack_start(GTK_BOX(lbox), GTK_WIDGET(label),
-			FALSE, TRUE, 0);
-		pidgin_set_accessible_label(button, label);
-	}
-
-	gtk_widget_show_all(bbox);
-
-	return button;
-}
-
-
 GtkWidget *pidgin_new_menu_item(GtkWidget *menu, const char *mnemonic,
                 const char *icon, GCallback cb, gpointer data)
 {
--- a/pidgin/gtkutils.h	Thu Jan 14 20:31:40 2021 -0600
+++ b/pidgin/gtkutils.h	Thu Jan 14 20:32:50 2021 -0600
@@ -151,19 +151,6 @@
                 const char *icon, GCallback cb, gpointer data);
 
 /**
- * pidgin_pixbuf_button_from_stock:
- * @text:  The text for the button.
- * @icon:  The stock icon name.
- * @style: The orientation of the button.
- *
- * Creates a button with the specified text and stock icon.
- *
- * Returns: (transfer full): The button.
- */
-GtkWidget *pidgin_pixbuf_button_from_stock(const char *text, const char *icon,
-										 PidginButtonOrientation style);
-
-/**
  * pidgin_make_frame:
  * @parent: The widget to put the frame into.
  * @title:  The title for the frame.

mercurial