/soc/2015/mmcc/main: 03ae3a5171d9: more replacement of deprecate...

Michael McConville mmcconville at mykolab.com
Wed Jul 8 14:16:49 EDT 2015


Changeset: 03ae3a5171d9ab18865b871f39962d1b04ec6366
Author:	 Michael McConville <mmcconville at mykolab.com>
Date:	 2015-07-08 14:16 -0400
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/mmcc/main/rev/03ae3a5171d9

Description:

more replacement of deprecated GTK stock item functions with icons

diffstat:

 pidgin/gtkblist.c               |   6 +++---
 pidgin/gtkconv.c                |   6 +++---
 pidgin/gtkdialogs.c             |   2 +-
 pidgin/gtknotify.c              |   2 +-
 pidgin/gtkrequest.c             |   4 ++--
 pidgin/gtkutils.c               |  20 ++++++++++----------
 pidgin/gtkwebview.c             |   4 ++--
 pidgin/minidialog.c             |   6 +++---
 pidgin/plugins/themeedit-icon.c |   4 ++--
 9 files changed, 27 insertions(+), 27 deletions(-)

diffs (262 lines):

diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -978,7 +978,7 @@ make_blist_request_dialog(PidginBlistReq
 
 	data->account = account;
 
-	img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
+	img = gtk_image_new_from_icon_name(PIDGIN_STOCK_DIALOG_QUESTION,
 		gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
 
 	gtkblist = PIDGIN_BLIST(purple_blist_get_buddy_list());
@@ -4716,7 +4716,7 @@ conversation_updated_cb(PurpleConversati
 		if(tooltip_text->len > 0) {
 			/* get rid of the last newline */
 			g_string_truncate(tooltip_text, tooltip_text->len -1);
-			img = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_PENDING,
+			img = gtk_image_new_from_icon_name(PIDGIN_STOCK_TOOLBAR_PENDING,
 							gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
 
 			gtkblist->menutrayicon = gtk_event_box_new();
@@ -5902,7 +5902,7 @@ static void pidgin_blist_show(PurpleBudd
 	gtk_box_pack_start(GTK_BOX(content_area), gtkblist->headline_label,
 	                   TRUE, TRUE, 0);
 
-	close = gtk_image_new_from_stock(_("_Close"), GTK_ICON_SIZE_MENU);
+	close = gtk_image_new_from_icon_name("window-close", GTK_ICON_SIZE_MENU);
 	close = pidgin_create_small_button(close);
 	gtk_widget_set_tooltip_text(close, _("Close"));
 	gtk_info_bar_add_action_widget(GTK_INFO_BAR(infobar), close,
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -925,7 +925,7 @@ invite_cb(GtkWidget *widget, PidginConve
 		GtkWidget *grid;
 		GtkWidget *img;
 
-		img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
+		img = gtk_image_new_from_icon_name(PIDGIN_STOCK_DIALOG_QUESTION,
 		                               gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
 
 		info = g_new0(InviteBuddyInfo, 1);
@@ -3116,7 +3116,7 @@ pidgin_conversations_fill_menu(GtkWidget
 		PurpleConversation *conv = (PurpleConversation*)l->data;
 		PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
 
-		GtkWidget *icon = gtk_image_new_from_stock(pidgin_conv_get_icon_stock(conv),
+		GtkWidget *icon = gtk_image_new_from_icon_name(pidgin_conv_get_icon_stock(conv),
 				gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC));
 		GtkWidget *item;
 		gchar *text = g_strdup_printf("%s (%d)",
@@ -9026,7 +9026,7 @@ build_warn_close_dialog(PidginConvWindow
 	gtk_box_set_spacing(GTK_BOX(vbox), 12);
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
 
-	img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_WARNING,
+	img = gtk_image_new_from_icon_name(PIDGIN_STOCK_DIALOG_WARNING,
 	                               gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
 	/* Setup the inner hbox and put the dialog's icon in it. */
 	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c
--- a/pidgin/gtkdialogs.c
+++ b/pidgin/gtkdialogs.c
@@ -1067,7 +1067,7 @@ pidgin_dialogs_ee(const char *ee)
 
 	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BORDER);
 	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(window))), hbox);
-	img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_COOL, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
+	img = gtk_image_new_from_icon_name(PIDGIN_STOCK_DIALOG_COOL, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
 	gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
 
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
diff --git a/pidgin/gtknotify.c b/pidgin/gtknotify.c
--- a/pidgin/gtknotify.c
+++ b/pidgin/gtknotify.c
@@ -566,7 +566,7 @@ pidgin_notify_message(PurpleNotifyMsgTyp
 
 	if (icon_name != NULL)
 	{
-		img = gtk_image_new_from_stock(icon_name, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
+		img = gtk_image_new_from_icon_name(icon_name, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
 		gtk_widget_set_halign(img, GTK_ALIGN_START);
 		gtk_widget_set_valign(img, GTK_ALIGN_START);
 	}
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -464,13 +464,13 @@ pidgin_request_dialog_icon(PurpleRequest
 		}
 	}
 
-	img = gtk_image_new_from_stock(icon_stock,
+	img = gtk_image_new_from_icon_name(icon_stock,
 		gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
 
 	if (img || icon_type == PURPLE_REQUEST_ICON_REQUEST)
 		return img;
 
-	return gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
+	return gtk_image_new_from_icon_name(PIDGIN_STOCK_DIALOG_QUESTION,
 		gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
 }
 
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -429,7 +429,7 @@ pidgin_pixbuf_toolbar_button_from_stock(
 
 	gtk_container_add (GTK_CONTAINER(button), bbox);
 
-	image = gtk_image_new_from_stock(icon, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
+	image = gtk_image_new_from_icon_name(icon, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
 	gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0);
 
 	gtk_widget_show_all(bbox);
@@ -461,7 +461,7 @@ pidgin_pixbuf_button_from_stock(const ch
 
 	if (icon) {
 		gtk_box_pack_start(GTK_BOX(bbox), ibox, TRUE, TRUE, 0);
-		image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_BUTTON);
+		image = gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_BUTTON);
 		gtk_box_pack_end(GTK_BOX(ibox), image, FALSE, TRUE, 0);
 	}
 
@@ -504,7 +504,7 @@ GtkWidget *pidgin_new_item_from_stock(Gt
 		g_signal_connect(G_OBJECT(menuitem), "activate", cb, data);
 
 	if (icon != NULL) {
-		image = gtk_image_new_from_stock(icon, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
+		image = gtk_image_new_from_icon_name(icon, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
 		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 	}
 /* FIXME: this isn't right
@@ -1741,7 +1741,7 @@ pidgin_append_menu_action(GtkWidget *men
 
 	stock_id = purple_menu_action_get_stock_icon(act);
 	if (stock_id) {
-		icon_image = gtk_image_new_from_stock(stock_id,
+		icon_image = gtk_image_new_from_icon_name(stock_id,
 			gtk_icon_size_from_name(
 				PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
 	}
@@ -3117,7 +3117,7 @@ link_context_menu(PidginWebView *webview
 	url = webkit_dom_html_anchor_element_get_href(link);
 
 	/* Open Link */
-	img = gtk_image_new_from_stock(_("_Jump to"), GTK_ICON_SIZE_MENU);
+	img = gtk_image_new_from_icon_name("go-jump", GTK_ICON_SIZE_MENU);
 	item = gtk_image_menu_item_new_with_mnemonic(_("_Open Link"));
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 	g_signal_connect_swapped(G_OBJECT(item), "activate",
@@ -3125,7 +3125,7 @@ link_context_menu(PidginWebView *webview
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 
 	/* Copy Link Location */
-	img = gtk_image_new_from_stock(_("_Copy"), GTK_ICON_SIZE_MENU);
+	img = gtk_image_new_from_icon_name("edit-copy", GTK_ICON_SIZE_MENU);
 	item = gtk_image_menu_item_new_with_mnemonic(_("_Copy Link Location"));
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 	/* The signal owns url now: */
@@ -3152,7 +3152,7 @@ copy_email_address(PidginWebView *webvie
 	address = text + MAILTOSIZE;
 
 	/* Copy Email Address */
-	img = gtk_image_new_from_stock(_("_Copy"), GTK_ICON_SIZE_MENU);
+	img = gtk_image_new_from_icon_name("edit-copy", GTK_ICON_SIZE_MENU);
 	item = gtk_image_menu_item_new_with_mnemonic(_("_Copy Email Address"));
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 	g_signal_connect_data(G_OBJECT(item), "activate", G_CALLBACK(url_copy),
@@ -3278,7 +3278,7 @@ file_context_menu(PidginWebView *webview
 	url = webkit_dom_html_anchor_element_get_href(link);
 
 	/* Open File */
-	img = gtk_image_new_from_stock(_("_Jump to"), GTK_ICON_SIZE_MENU);
+	img = gtk_image_new_from_icon_name("go-jump", GTK_ICON_SIZE_MENU);
 	item = gtk_image_menu_item_new_with_mnemonic(_("_Open File"));
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 	g_signal_connect_swapped(G_OBJECT(item), "activate",
@@ -3359,7 +3359,7 @@ audio_context_menu(PidginWebView *webvie
 	url = webkit_dom_html_anchor_element_get_href(link);
 
 	/* Play Sound */
-	img = gtk_image_new_from_stock(_("_Play"), GTK_ICON_SIZE_MENU);
+	img = gtk_image_new_from_icon_name("media-playback-start", GTK_ICON_SIZE_MENU);
 	item = gtk_image_menu_item_new_with_mnemonic(_("_Play Sound"));
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 	g_signal_connect_swapped(G_OBJECT(item), "activate",
@@ -3367,7 +3367,7 @@ audio_context_menu(PidginWebView *webvie
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 
 	/* Save File */
-	img = gtk_image_new_from_stock(_("_Save"), GTK_ICON_SIZE_MENU);
+	img = gtk_image_new_from_icon_name("document-save", GTK_ICON_SIZE_MENU);
 	item = gtk_image_menu_item_new_with_mnemonic(_("_Save File"));
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 	g_signal_connect_data(G_OBJECT(item), "activate",
diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
--- a/pidgin/gtkwebview.c
+++ b/pidgin/gtkwebview.c
@@ -808,7 +808,7 @@ do_popup_menu(WebKitWebView *webview, in
 		menu_item = gtk_image_menu_item_new_with_mnemonic(
 			_("_Save Image..."));
 		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item),
-			gtk_image_new_from_stock(_("_Save"), GTK_ICON_SIZE_MENU));
+			gtk_image_new_from_icon_name("document-save", GTK_ICON_SIZE_MENU));
 		g_signal_connect_object(G_OBJECT(menu_item), "activate",
 			G_CALLBACK(webview_image_save), image_node, 0);
 		gtk_widget_show(menu_item);
@@ -820,7 +820,7 @@ do_popup_menu(WebKitWebView *webview, in
 				_("_Add Custom Smiley..."));
 			gtk_image_menu_item_set_image(
 				GTK_IMAGE_MENU_ITEM(menu_item),
-				gtk_image_new_from_stock(_("_Add"),
+				gtk_image_new_from_icon_name("list-add",
 					GTK_ICON_SIZE_MENU));
 			g_signal_connect_object(G_OBJECT(menu_item), "activate",
 				G_CALLBACK(webview_image_add_smiley),
diff --git a/pidgin/minidialog.c b/pidgin/minidialog.c
--- a/pidgin/minidialog.c
+++ b/pidgin/minidialog.c
@@ -290,9 +290,9 @@ pidgin_mini_dialog_get_property(GObject 
 			break;
 		case PROP_ICON_NAME:
 		{
-			gchar *icon_name = NULL;
+			const gchar *icon_name;
 			GtkIconSize size;
-			gtk_image_get_stock(priv->icon, &icon_name, &size);
+			gtk_image_get_icon_name(priv->icon, &icon_name, &size);
 			g_value_set_string(value, icon_name);
 			break;
 		}
@@ -375,7 +375,7 @@ pidgin_mini_dialog_set_property(GObject 
 			mini_dialog_set_description(self, g_value_get_string(value));
 			break;
 		case PROP_ICON_NAME:
-			gtk_image_set_from_stock(priv->icon, g_value_get_string(value),
+			gtk_image_set_from_icon_name(priv->icon, g_value_get_string(value),
 				gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
 			break;
 		case PROP_CUSTOM_ICON:
diff --git a/pidgin/plugins/themeedit-icon.c b/pidgin/plugins/themeedit-icon.c
--- a/pidgin/plugins/themeedit-icon.c
+++ b/pidgin/plugins/themeedit-icon.c
@@ -284,7 +284,7 @@ void pidgin_icon_theme_edit(PurplePlugin
 
 			GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_CAT_SPACE);
 			GtkWidget *label = gtk_label_new(text);
-			GtkWidget *image = gtk_image_new_from_stock(id,
+			GtkWidget *image = gtk_image_new_from_icon_name(id,
 					gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
 			GtkWidget *ebox = gtk_event_box_new();
 			gtk_container_add(GTK_CONTAINER(ebox), image);
@@ -304,7 +304,7 @@ void pidgin_icon_theme_edit(PurplePlugin
 				if (!(sections[s].flags & (1 << j)))
 					continue;
 
-				sh = gtk_image_new_from_stock(id, gtk_icon_size_from_name(stocksizes[j]));
+				sh = gtk_image_new_from_icon_name(id, gtk_icon_size_from_name(stocksizes[j]));
 				gtk_box_pack_start(GTK_BOX(hbox), sh, FALSE, FALSE, 0);
 				g_object_set_data(G_OBJECT(image), stocksizes[j], sh);
 			}



More information about the Commits mailing list