/pidgin/main: e04ba70092e9: Fix the rest of [hv] gtk3 deprecatio...

Tomasz Wasilczyk twasilczyk at pidgin.im
Mon Feb 10 22:14:43 EST 2014


Changeset: e04ba70092e9b6fa8db1c232b36201e5de4601cd
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-02-11 04:14 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/e04ba70092e9

Description:

Fix the rest of [hv] gtk3 deprecation warnings

diffstat:

 pidgin/gtk3compat.h                            |  24 ++++++++++++++++++++++++
 pidgin/gtkblist.c                              |   4 ++--
 pidgin/gtkcertmgr.c                            |   2 +-
 pidgin/gtkconv.c                               |   2 +-
 pidgin/gtklog.c                                |   2 +-
 pidgin/gtkroomlist.c                           |   2 +-
 pidgin/gtkscrollbook.c                         |   2 +-
 pidgin/gtkstatusbox.c                          |   2 +-
 pidgin/gtkutils.c                              |   2 +-
 pidgin/gtkwebviewtoolbar.c                     |   2 +-
 pidgin/plugins/gevolution/add_buddy_dialog.c   |   4 ++--
 pidgin/plugins/gevolution/assoc-buddy.c        |   4 ++--
 pidgin/plugins/gevolution/new_person_dialog.c  |   6 +++---
 pidgin/plugins/musicmessaging/musicmessaging.c |   2 +-
 pidgin/plugins/spellchk.c                      |   2 +-
 15 files changed, 43 insertions(+), 19 deletions(-)

diffs (238 lines):

diff --git a/pidgin/gtk3compat.h b/pidgin/gtk3compat.h
--- a/pidgin/gtk3compat.h
+++ b/pidgin/gtk3compat.h
@@ -70,6 +70,30 @@ gtk_box_new(GtkOrientation orientation, 
 		return gtk_vbox_new(FALSE, spacing);
 }
 
+static inline GtkWidget *
+gtk_separator_new(GtkOrientation orientation)
+{
+	g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL ||
+		orientation == GTK_ORIENTATION_VERTICAL, NULL);
+
+	if (orientation == GTK_ORIENTATION_HORIZONTAL)
+		return gtk_hseparator_new();
+	else /* GTK_ORIENTATION_VERTICAL */
+		return gtk_vseparator_new();
+}
+
+static inline GtkWidget *
+gtk_button_box_new(GtkOrientation orientation)
+{
+	g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL ||
+		orientation == GTK_ORIENTATION_VERTICAL, NULL);
+
+	if (orientation == GTK_ORIENTATION_HORIZONTAL)
+		return gtk_hbutton_box_new();
+	else /* GTK_ORIENTATION_VERTICAL */
+		return gtk_vbutton_box_new();
+}
+
 #if !GTK_CHECK_VERSION(2,24,0)
 
 #define gdk_x11_set_sm_client_id gdk_set_sm_client_id
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -5677,7 +5677,7 @@ kiosk_page()
 	label = gtk_label_new(" ");
 	gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
 
-	bbox = gtk_hbutton_box_new();
+	bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
 	button = gtk_button_new_with_mnemonic(_("_Login"));
 	gtk_box_pack_start(GTK_BOX(ret), bbox, FALSE, FALSE, 0);
 	gtk_container_add(GTK_CONTAINER(bbox), button);
@@ -6155,7 +6155,7 @@ static void pidgin_blist_show(PurpleBudd
 		pidgin_make_scrollable(gtkblist->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1), 
 		TRUE, TRUE, 0);
 
-	sep = gtk_hseparator_new();
+	sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sep, FALSE, FALSE, 0);
 
 	gtkblist->scrollbook = pidgin_scroll_book_new();
diff --git a/pidgin/gtkcertmgr.c b/pidgin/gtkcertmgr.c
--- a/pidgin/gtkcertmgr.c
+++ b/pidgin/gtkcertmgr.c
@@ -471,7 +471,7 @@ tls_peers_mgmt_build(void)
 	tls_peers_mgmt_repopulate_list();
 
 	/* Right-hand side controls box */
-	bbox = gtk_vbutton_box_new();
+	bbox = gtk_button_box_new(GTK_ORIENTATION_VERTICAL);
 	gtk_box_pack_end(GTK_BOX(mgmt_widget), bbox,
 			 FALSE, FALSE, /* Do not take up space */
 			 0);
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -5672,7 +5672,7 @@ setup_common_pane(PidginConversation *gt
 		setup_chat_topic(gtkconv, vbox);
 
 		/* Add the gtkwebview frame */
-		hpaned = gtk_hpaned_new();
+		hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
 		gtk_box_pack_start(GTK_BOX(vbox), hpaned, TRUE, TRUE, 0);
 		gtk_widget_show(hpaned);
 		gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE);
diff --git a/pidgin/gtklog.c b/pidgin/gtklog.c
--- a/pidgin/gtklog.c
+++ b/pidgin/gtklog.c
@@ -607,7 +607,7 @@ static PidginLogViewer *display_log_view
 	g_free(text);
 
 	/* Pane *************/
-	pane = gtk_hpaned_new();
+	pane = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_container_set_border_width(GTK_CONTAINER(pane), PIDGIN_HIG_BOX_SPACE);
 	gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(lv->window))),
 	                   pane, TRUE, TRUE, 0);
diff --git a/pidgin/gtkroomlist.c b/pidgin/gtkroomlist.c
--- a/pidgin/gtkroomlist.c
+++ b/pidgin/gtkroomlist.c
@@ -578,7 +578,7 @@ pidgin_roomlist_dialog_new_with_account(
 	/* 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/gtkscrollbook.c b/pidgin/gtkscrollbook.c
--- a/pidgin/gtkscrollbook.c
+++ b/pidgin/gtkscrollbook.c
@@ -255,7 +255,7 @@ pidgin_scroll_book_init (PidginScrollBoo
 	GtkWidget *eb;
 	GtkWidget *close_button;
 
-	scroll_book->hbox = gtk_hbox_new(FALSE, 0);
+	scroll_book->hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 
 	/* Close */
 	eb = gtk_event_box_new();
diff --git a/pidgin/gtkstatusbox.c b/pidgin/gtkstatusbox.c
--- a/pidgin/gtkstatusbox.c
+++ b/pidgin/gtkstatusbox.c
@@ -1745,7 +1745,7 @@ pidgin_status_box_init (PidginStatusBox 
 	status_box->toggle_button = gtk_toggle_button_new();
 	status_box->hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
 	status_box->cell_view = gtk_cell_view_new();
-	status_box->vsep = gtk_vseparator_new();
+	status_box->vsep = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
 	status_box->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
 
 	status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -231,7 +231,7 @@ pidgin_create_webview(gboolean editable,
 		gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
 		gtk_widget_show(toolbar);
 
-		sep = gtk_hseparator_new();
+		sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
 		gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
 		g_signal_connect_swapped(G_OBJECT(toolbar), "show", G_CALLBACK(gtk_widget_show), sep);
 		g_signal_connect_swapped(G_OBJECT(toolbar), "hide", G_CALLBACK(gtk_widget_hide), sep);
diff --git a/pidgin/gtkwebviewtoolbar.c b/pidgin/gtkwebviewtoolbar.c
--- a/pidgin/gtkwebviewtoolbar.c
+++ b/pidgin/gtkwebviewtoolbar.c
@@ -905,7 +905,7 @@ insert_smiley_cb(GtkAction *smiley, Pidg
 		/* pack buttons of the list */
 		add_smiley_list(smiley_table, ls, max_line_width, FALSE);
 		if (supports_custom) {
-			gtk_box_pack_start(GTK_BOX(smiley_table), gtk_hseparator_new(), TRUE, FALSE, 0);
+			gtk_box_pack_start(GTK_BOX(smiley_table), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), TRUE, FALSE, 0);
 			add_smiley_list(smiley_table, ls, max_line_width, TRUE);
 		}
 		while (ls) {
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
@@ -551,12 +551,12 @@ gevo_add_buddy_dialog_show(PurpleAccount
 	/* Cool. Now we only have a little left... */
 
 	/* Separator. */
-	sep = gtk_hseparator_new();
+	sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
 	gtk_widget_show(sep);
 
 	/* Button box */
-	bbox = gtk_hbutton_box_new();
+	bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_set_spacing(GTK_BOX(bbox), 6);
 	gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
 	gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, TRUE, 0);
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
@@ -420,12 +420,12 @@ gevo_associate_buddy_dialog_new(PurpleBu
 	gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->addrbooks_combo), 0);
 
 	/* Separator. */
-	sep = gtk_hseparator_new();
+	sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
 	gtk_widget_show(sep);
 
 	/* Button box */
-	bbox = gtk_hbutton_box_new();
+	bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_set_spacing(GTK_BOX(bbox), 6);
 	gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
 	gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, TRUE, 0);
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
@@ -302,7 +302,7 @@ gevo_new_person_dialog_show(EBook *book,
 		gtk_widget_show_all(dialog->group_combo);
 
 		/* Separator */
-		sep = gtk_hseparator_new();
+		sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
 		gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
 		gtk_widget_show(sep);
 
@@ -385,12 +385,12 @@ gevo_new_person_dialog_show(EBook *book,
 	}
 
 	/* Separator */
-	sep = gtk_hseparator_new();
+	sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
 	gtk_widget_show(sep);
 
 	/* Button box */
-	bbox = gtk_hbutton_box_new();
+	bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_set_spacing(GTK_BOX(bbox), 6);
 	gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
 	gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, TRUE, 0);
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
@@ -608,7 +608,7 @@ static void add_button (MMConversation *
 
 	gtk_container_add((GtkContainer *)button, image);
 
-	sep = gtk_vseparator_new();
+	sep = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
 
 	mmconv->seperator = sep;
 	mmconv->button = button;
diff --git a/pidgin/plugins/spellchk.c b/pidgin/plugins/spellchk.c
--- a/pidgin/plugins/spellchk.c
+++ b/pidgin/plugins/spellchk.c
@@ -2241,7 +2241,7 @@ get_config_frame(PurplePlugin *plugin)
 		TRUE, TRUE, 0);
 	gtk_widget_show(tree);
 
-	hbox = gtk_hbutton_box_new();
+	hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 	gtk_widget_show(hbox);
 



More information about the Commits mailing list