/pidgin/main: ed1be305c985: Fix gtk_[hv]box_new gtk3 deprecation...

Tomasz Wasilczyk twasilczyk at pidgin.im
Mon Feb 10 20:19:40 EST 2014


Changeset: ed1be305c985d63d5bbc6aa9f355860bfcd3d66e
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-02-11 02:19 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/ed1be305c985

Description:

Fix gtk_[hv]box_new gtk3 deprecation warnings

diffstat:

 pidgin/gtk3compat.h                            |  12 +++++++++++
 pidgin/plugins/contact_priority.c              |  13 ++++++-----
 pidgin/plugins/disco/gtkdisco.c                |   3 +-
 pidgin/plugins/gestures/gestures.c             |   3 +-
 pidgin/plugins/gevolution/add_buddy_dialog.c   |   6 +++-
 pidgin/plugins/gevolution/assoc-buddy.c        |   6 +++-
 pidgin/plugins/gevolution/gevolution.c         |   3 +-
 pidgin/plugins/gevolution/new_person_dialog.c  |  10 +++++---
 pidgin/plugins/musicmessaging/musicmessaging.c |   3 +-
 pidgin/plugins/notify.c                        |  11 +++++----
 pidgin/plugins/raw.c                           |   3 +-
 pidgin/plugins/spellchk.c                      |   9 ++++---
 pidgin/plugins/themeedit-icon.c                |   5 ++-
 pidgin/plugins/themeedit.c                     |   4 +-
 pidgin/plugins/ticker/ticker.c                 |   3 +-
 pidgin/plugins/win32/transparency/win2ktrans.c |   7 +++--
 pidgin/plugins/xmppconsole.c                   |  28 +++++++++++++-------------
 17 files changed, 79 insertions(+), 50 deletions(-)

diffs (truncated from 616 to 300 lines):

diff --git a/pidgin/gtk3compat.h b/pidgin/gtk3compat.h
--- a/pidgin/gtk3compat.h
+++ b/pidgin/gtk3compat.h
@@ -58,6 +58,18 @@ static inline GtkWidget * gtk_font_choos
 #define GDK_IS_QUARTZ_WINDOW(window) TRUE
 #endif
 
+static inline GtkWidget *
+gtk_box_new(GtkOrientation orientation, gint spacing)
+{
+	g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL ||
+		orientation == GTK_ORIENTATION_VERTICAL, NULL);
+
+	if (orientation == GTK_ORIENTATION_HORIZONTAL)
+		return gtk_hbox_new(FALSE, spacing);
+	else /* GTK_ORIENTATION_VERTICAL */
+		return gtk_vbox_new(FALSE, spacing);
+}
+
 #if !GTK_CHECK_VERSION(2,24,0)
 
 #define gdk_x11_set_sm_client_id gdk_set_sm_client_id
diff --git a/pidgin/plugins/contact_priority.c b/pidgin/plugins/contact_priority.c
--- a/pidgin/plugins/contact_priority.c
+++ b/pidgin/plugins/contact_priority.c
@@ -20,6 +20,7 @@
 
 #include "internal.h"
 #include "pidgin.h"
+#include "gtk3compat.h"
 #include "gtkplugin.h"
 #include "gtkutils.h"
 #include "prefs.h"
@@ -84,12 +85,12 @@ get_config_frame(PurplePlugin *plugin)
 
 	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 
-	ret = gtk_vbox_new(FALSE, 18);
+	ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
 	gtk_container_set_border_width(GTK_CONTAINER(ret), 12);
 
 	frame = pidgin_make_frame(ret, _("Point values to use when..."));
 
-	vbox = gtk_vbox_new(FALSE, 5);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 	gtk_container_add(GTK_CONTAINER(frame), vbox);
 
 	/* Status Spinboxes */
@@ -97,7 +98,7 @@ get_config_frame(PurplePlugin *plugin)
 	{
 		char *pref = g_strconcat("/purple/status/scores/", statuses[i].id, NULL);
 
-		hbox = gtk_hbox_new(FALSE, 5);
+		hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
 		gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 		label = gtk_label_new_with_mnemonic(_(statuses[i].description));
@@ -120,7 +121,7 @@ get_config_frame(PurplePlugin *plugin)
 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
 	/* Last match */
-	hbox = gtk_hbox_new(FALSE, 5);
+	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	check = gtk_check_button_new_with_label(_("Use last buddy when scores are equal"));
@@ -130,11 +131,11 @@ get_config_frame(PurplePlugin *plugin)
 
 	frame = pidgin_make_frame(ret, _("Point values to use for account..."));
 
-	vbox = gtk_vbox_new(FALSE, 5);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 	gtk_container_add(GTK_CONTAINER(frame), vbox);
 
 	/* Account */
-	hbox = gtk_hbox_new(FALSE, 5);
+	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	/* make this here so I can use it in the option menu callback, we'll
diff --git a/pidgin/plugins/disco/gtkdisco.c b/pidgin/plugins/disco/gtkdisco.c
--- a/pidgin/plugins/disco/gtkdisco.c
+++ b/pidgin/plugins/disco/gtkdisco.c
@@ -31,6 +31,7 @@
 #include "request.h"
 #include "pidgintooltip.h"
 
+#include "gtk3compat.h"
 #include "gtkdisco.h"
 #include "xmppdisco.h"
 
@@ -644,7 +645,7 @@ PidginDiscoDialog *pidgin_disco_dialog_n
 	/* Create the parent vbox for everything. */
 	vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(window), FALSE, PIDGIN_HIG_BORDER);
 
-	vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER);
+	vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_BORDER);
 	gtk_container_add(GTK_CONTAINER(vbox), vbox2);
 	gtk_widget_show(vbox2);
 
diff --git a/pidgin/plugins/gestures/gestures.c b/pidgin/plugins/gestures/gestures.c
--- a/pidgin/plugins/gestures/gestures.c
+++ b/pidgin/plugins/gestures/gestures.c
@@ -26,6 +26,7 @@
 #include "signals.h"
 #include "version.h"
 
+#include "gtk3compat.h"
 #include "gtkconv.h"
 #include "gtkplugin.h"
 #include "gtkutils.h"
@@ -223,7 +224,7 @@ get_config_frame(PurplePlugin *plugin)
 #endif
 
 	/* Outside container */
-	ret = gtk_vbox_new(FALSE, 18);
+	ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
 	gtk_container_set_border_width(GTK_CONTAINER(ret), 12);
 
 	/* Configuration frame */
diff --git a/pidgin/plugins/gevolution/add_buddy_dialog.c b/pidgin/plugins/gevolution/add_buddy_dialog.c
--- a/pidgin/plugins/gevolution/add_buddy_dialog.c
+++ b/pidgin/plugins/gevolution/add_buddy_dialog.c
@@ -21,6 +21,8 @@
 #include "internal.h"
 #include "gtkblist.h"
 #include "pidgin.h"
+
+#include "gtk3compat.h"
 #include "gtkutils.h"
 
 #include "debug.h"
@@ -453,7 +455,7 @@ gevo_add_buddy_dialog_show(PurpleAccount
 					 G_CALLBACK(delete_win_cb), dialog);
 
 	/* Setup the vbox */
-	vbox = gtk_vbox_new(FALSE, 12);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
 	gtk_container_add(GTK_CONTAINER(dialog->win), vbox);
 	gtk_widget_show(vbox);
 
@@ -466,7 +468,7 @@ gevo_add_buddy_dialog_show(PurpleAccount
 	gtk_widget_show(label);
 
 	/* Add the search hbox */
-	hbox = gtk_hbox_new(FALSE, 6);
+	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
 	gtk_widget_show(hbox);
 
diff --git a/pidgin/plugins/gevolution/assoc-buddy.c b/pidgin/plugins/gevolution/assoc-buddy.c
--- a/pidgin/plugins/gevolution/assoc-buddy.c
+++ b/pidgin/plugins/gevolution/assoc-buddy.c
@@ -21,6 +21,8 @@
 #include "internal.h"
 #include "gtkblist.h"
 #include "pidgin.h"
+
+#include "gtk3compat.h"
 #include "gtkutils.h"
 
 #include "debug.h"
@@ -333,7 +335,7 @@ gevo_associate_buddy_dialog_new(PurpleBu
 					 G_CALLBACK(delete_win_cb), dialog);
 
 	/* Setup the vbox */
-	vbox = gtk_vbox_new(FALSE, 12);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
 	gtk_container_add(GTK_CONTAINER(dialog->win), vbox);
 	gtk_widget_show(vbox);
 
@@ -346,7 +348,7 @@ gevo_associate_buddy_dialog_new(PurpleBu
 	gtk_widget_show(label);
 
 	/* Add the search hbox */
-	hbox = gtk_hbox_new(FALSE, 6);
+	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
 	gtk_widget_show(hbox);
 
diff --git a/pidgin/plugins/gevolution/gevolution.c b/pidgin/plugins/gevolution/gevolution.c
--- a/pidgin/plugins/gevolution/gevolution.c
+++ b/pidgin/plugins/gevolution/gevolution.c
@@ -29,6 +29,7 @@
 #include "util.h"
 #include "version.h"
 
+#include "gtk3compat.h"
 #include "gtkblist.h"
 #include "gtkconv.h"
 #include "gtkplugin.h"
@@ -426,7 +427,7 @@ get_config_frame(PurplePlugin *plugin)
 	GList *l;
 
 	/* Outside container */
-	ret = gtk_vbox_new(FALSE, 18);
+	ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
 	gtk_container_set_border_width(GTK_CONTAINER(ret), 12);
 
 	/* Configuration frame */
diff --git a/pidgin/plugins/gevolution/new_person_dialog.c b/pidgin/plugins/gevolution/new_person_dialog.c
--- a/pidgin/plugins/gevolution/new_person_dialog.c
+++ b/pidgin/plugins/gevolution/new_person_dialog.c
@@ -20,6 +20,8 @@
  */
 #include "internal.h"
 #include "pidgin.h"
+
+#include "gtk3compat.h"
 #include "gtkutils.h"
 
 #include "debug.h"
@@ -33,7 +35,7 @@ add_pref_box(GtkSizeGroup *sg, GtkWidget
 	GtkWidget *hbox;
 	GtkWidget *label;
 
-	hbox = gtk_hbox_new(FALSE, 6);
+	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
 	gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0);
 	gtk_widget_show(hbox);
 
@@ -249,7 +251,7 @@ gevo_new_person_dialog_show(EBook *book,
 					 G_CALLBACK(delete_win_cb), dialog);
 
 	/* Setup the vbox */
-	vbox = gtk_vbox_new(FALSE, 12);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
 	gtk_container_add(GTK_CONTAINER(dialog->win), vbox);
 	gtk_widget_show(vbox);
 
@@ -312,7 +314,7 @@ gevo_new_person_dialog_show(EBook *book,
 	}
 
 	/* Create the parent hbox for this whole thing. */
-	hbox = gtk_hbox_new(FALSE, 12);
+	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
 	gtk_widget_show(hbox);
 
@@ -334,7 +336,7 @@ gevo_new_person_dialog_show(EBook *book,
 #endif
 
 	/* Now the right side. */
-	vbox2 = gtk_vbox_new(FALSE, 12);
+	vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
 	gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0);
 	gtk_widget_show(vbox2);
 
diff --git a/pidgin/plugins/musicmessaging/musicmessaging.c b/pidgin/plugins/musicmessaging/musicmessaging.c
--- a/pidgin/plugins/musicmessaging/musicmessaging.c
+++ b/pidgin/plugins/musicmessaging/musicmessaging.c
@@ -24,6 +24,7 @@
 
 #include "conversation.h"
 
+#include "gtk3compat.h"
 #include "gtkconv.h"
 #include "gtkplugin.h"
 #include "gtkutils.h"
@@ -639,7 +640,7 @@ get_config_frame(PurplePlugin *plugin)
 	GtkWidget *editor_path_button;
 
 	/* Outside container */
-	ret = gtk_vbox_new(FALSE, 18);
+	ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
 	gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
 
 	/* Configuration frame */
diff --git a/pidgin/plugins/notify.c b/pidgin/plugins/notify.c
--- a/pidgin/plugins/notify.c
+++ b/pidgin/plugins/notify.c
@@ -93,6 +93,7 @@
 #include "version.h"
 #include "debug.h"
 
+#include "gtk3compat.h"
 #include "gtkplugin.h"
 #include "gtkutils.h"
 
@@ -673,12 +674,12 @@ get_config_frame(PurplePlugin *plugin)
 	GtkWidget *vbox = NULL, *hbox = NULL;
 	GtkWidget *toggle = NULL, *entry = NULL, *ref;
 
-	ret = gtk_vbox_new(FALSE, 18);
+	ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
 	gtk_container_set_border_width(GTK_CONTAINER (ret), 12);
 
 	/*---------- "Notify For" ----------*/
 	frame = pidgin_make_frame(ret, _("Notify For"));
-	vbox = gtk_vbox_new(FALSE, 5);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 	gtk_container_add(GTK_CONTAINER(frame), vbox);
 
 	toggle = gtk_check_button_new_with_mnemonic(_("_IM windows"));
@@ -715,11 +716,11 @@ get_config_frame(PurplePlugin *plugin)
 
 	/*---------- "Notification Methods" ----------*/
 	frame = pidgin_make_frame(ret, _("Notification Methods"));
-	vbox = gtk_vbox_new(FALSE, 5);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);



More information about the Commits mailing list