/soc/2015/mmcc/main: 3b91ffef050b: fix GTK alignment function de...

Michael McConville mmcconville at mykolab.com
Tue Jul 7 15:02:59 EDT 2015


Changeset: 3b91ffef050b2251f2685aab58a7d009194e63d8
Author:	 Michael McConville <mmcconville at mykolab.com>
Date:	 2015-07-07 15:02 -0400
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/mmcc/main/rev/3b91ffef050b

Description:

fix GTK alignment function deprecations by adding GTK version preproc conditions (ignore deprecation warnings for versions <3.16 as per suggestion of GTK community - there's no alternative)

diffstat:

 pidgin/gtkaccount.c                           |    5 +
 pidgin/gtkblist.c                             |   37 +++++++-
 pidgin/gtkconv.c                              |   49 +++++++++-
 pidgin/gtkdialogs.c                           |    7 +
 pidgin/gtklog.c                               |   14 ++
 pidgin/gtkmedia.c                             |   14 ++
 pidgin/gtknotify.c                            |   34 ++++++-
 pidgin/gtkplugin.c                            |   56 +++++++++++
 pidgin/gtkpluginpref.c                        |   28 +++++
 pidgin/gtkpounce.c                            |   14 ++
 pidgin/gtkprefs.c                             |  123 ++++++++++++++++++++++++-
 pidgin/gtkprivacy.c                           |    7 +
 pidgin/gtkrequest.c                           |   78 +++++++++++++++-
 pidgin/gtksavedstatuses.c                     |   14 ++
 pidgin/gtkutils.c                             |   21 ++++
 pidgin/gtkxfer.c                              |   14 ++
 pidgin/minidialog.c                           |   24 ++++-
 pidgin/plugins/cap/cap.c                      |   42 ++++++++
 pidgin/plugins/contact_priority.c             |    7 +
 pidgin/plugins/gevolution/add_buddy_dialog.c  |    7 +
 pidgin/plugins/gevolution/assoc-buddy.c       |    7 +
 pidgin/plugins/gevolution/gevolution.c        |    7 +
 pidgin/plugins/gevolution/new_person_dialog.c |   21 ++++
 pidgin/plugins/themeedit-icon.c               |    7 +
 pidgin/plugins/themeedit.c                    |   14 ++
 pidgin/plugins/xmppconsole.c                  |   91 +++++++++++++++++++
 26 files changed, 723 insertions(+), 19 deletions(-)

diffs (truncated from 1688 to 300 lines):

diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -2299,7 +2299,12 @@ create_accounts_list(AccountsWindow *dia
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
 	gtk_widget_show(label);
 
+#if GTK_CHECK_VERSION (3,16,0)
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), label, NULL);
 
 	/* Create the list model. */
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -1000,7 +1000,8 @@ make_blist_request_dialog(PidginBlistReq
 	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(data->window))),
 	                  hbox);
 	gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
-	gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+	gtk_widget_set_halign(img, GTK_ALIGN_START);
+	gtk_widget_set_valign(img, GTK_ALIGN_START);
 
 	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 	gtk_container_add(GTK_CONTAINER(hbox), vbox);
@@ -1009,7 +1010,14 @@ make_blist_request_dialog(PidginBlistReq
 
 	gtk_widget_set_size_request(label, 400, -1);
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+	gtk_label_set_yalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
 	data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -5374,7 +5382,14 @@ create_account_label(PurpleAccount *acco
 	markup = g_strdup_printf("<span size=\"smaller\">%s</span>", username);
 	gtk_label_set_markup(GTK_LABEL(label), markup);
 	g_free(markup);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+	gtk_label_set_yalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	g_object_set(G_OBJECT(label), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 	description = purple_account_get_current_error(account)->description;
 	if (description != NULL && *description != '\0')
@@ -5554,14 +5569,26 @@ kiosk_page()
 
 	label = gtk_label_new(NULL);
 	gtk_label_set_markup(GTK_LABEL(label), _("<b>Username:</b>"));
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
 	entry = gtk_entry_new();
 	gtk_box_pack_start(GTK_BOX(ret), entry, FALSE, FALSE, 0);
 
 	label = gtk_label_new(NULL);
 	gtk_label_set_markup(GTK_LABEL(label), _("<b>Password:</b>"));
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
 	entry = gtk_entry_new();
 	gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
@@ -5871,7 +5898,12 @@ static void pidgin_blist_show(PurpleBudd
 	g_free(tmp);
 	label = gtk_label_new(NULL);
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+#if GTK_CHECK_VERSION (3,16,0)
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.2);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_label_set_markup(GTK_LABEL(label), pretty);
 	g_free(pretty);
 	gtk_notebook_append_page(GTK_NOTEBOOK(gtkblist->notebook),label, NULL);
@@ -5892,7 +5924,8 @@ static void pidgin_blist_show(PurpleBudd
 
 	content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(infobar));
 	gtkblist->headline_image = gtk_image_new_from_pixbuf(NULL);
-	gtk_misc_set_alignment(GTK_MISC(gtkblist->headline_image), 0.5, 0.5);
+	gtk_widget_set_halign(gtkblist->headline_image, GTK_ALIGN_START);
+	gtk_widget_set_valign(gtkblist->headline_image, GTK_ALIGN_START);
 	gtkblist->headline_label = gtk_label_new(NULL);
 	gtk_label_set_line_wrap(GTK_LABEL(gtkblist->headline_label), TRUE);
 	gtk_box_pack_start(GTK_BOX(content_area), gtkblist->headline_image,
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -957,7 +957,8 @@ invite_cb(GtkWidget *widget, PidginConve
 		hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BORDER);
 		gtk_container_add(GTK_CONTAINER(vbox), hbox);
 		gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
-		gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+		gtk_widget_set_halign(img, GTK_ALIGN_START);
+		gtk_widget_set_valign(img, GTK_ALIGN_START);
 
 		/* Setup the right vbox. */
 		vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
@@ -969,7 +970,14 @@ invite_cb(GtkWidget *widget, PidginConve
 								"message."));
 		gtk_widget_set_size_request(label, 350, -1);
 		gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+#if GTK_CHECK_VERSION (3,16,0)
+		gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+		gtk_label_set_yalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 		gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 		gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
 		/* hbox for the grid, and to give it some spacing on the left. */
@@ -986,7 +994,14 @@ invite_cb(GtkWidget *widget, PidginConve
 		/* Now the Buddy label */
 		label = gtk_label_new(NULL);
 		gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Buddy:"));
+#if GTK_CHECK_VERSION (3,16,0)
+		gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+		gtk_label_set_yalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 		gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 		gtk_grid_attach_defaults(GTK_GRID(grid), label, 0, 0, 1, 1);
 
 		/* Now the Buddy drop-down entry field. */
@@ -999,7 +1014,14 @@ invite_cb(GtkWidget *widget, PidginConve
 		/* Now the label for "Message" */
 		label = gtk_label_new(NULL);
 		gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Message:"));
+#if GTK_CHECK_VERSION (3,16,0)
+		gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+		gtk_label_set_yalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 		gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 		gtk_grid_attach_defaults(GTK_GRID(grid), label, 0, 1, 1, 1);
 
 
@@ -9031,7 +9053,8 @@ build_warn_close_dialog(PidginConvWindow
 	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
 	gtk_container_add(GTK_CONTAINER(vbox), hbox);
 	gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
-	gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+	gtk_widget_set_halign(img, GTK_ALIGN_START);
+	gtk_widget_set_valign(img, GTK_ALIGN_START);
 
 	/* Setup the right vbox. */
 	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
@@ -9040,7 +9063,14 @@ build_warn_close_dialog(PidginConvWindow
 	label = gtk_label_new(_("You have unread messages. Are you sure you want to close the window?"));
 	gtk_widget_set_size_request(label, 350, -1);
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+	gtk_label_set_yalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
 	/* Connect the signals. */
@@ -10342,7 +10372,14 @@ pidgin_conv_window_add_gtkconv(PidginCon
 
 	gtk_box_pack_start(GTK_BOX(gtkconv->menu_tabby), gtkconv->menu_label, TRUE, TRUE, 0);
 	gtk_widget_show(gtkconv->menu_label);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(gtkconv->menu_label), GTK_ALIGN_START);
+	gtk_label_set_yalign(GTK_LABEL(gtkconv->menu_label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(gtkconv->menu_label), 0, 0);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 
 	gtk_widget_show(gtkconv->menu_tabby);
 
@@ -10404,7 +10441,13 @@ pidgin_conv_tab_pack(PidginConvWindow *w
 	gtk_label_set_angle(GTK_LABEL(gtkconv->tab_label), angle);
 
 #if 0
-	gtk_misc_set_alignment(GTK_MISC(gtkconv->tab_label), 0.00, 0.5);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(gtkconv->tab_label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	gtk_misc_set_alignment(GTK_MISC(gtkconv->tab_label), 0, 0.5);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_misc_set_padding(GTK_MISC(gtkconv->tab_label), 4, 0);
 #endif
 
diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c
--- a/pidgin/gtkdialogs.c
+++ b/pidgin/gtkdialogs.c
@@ -1071,7 +1071,14 @@ pidgin_dialogs_ee(const char *ee)
 	gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
 
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label), GTK_ALIGN_START);
+	gtk_label_set_yalign(GTK_LABEL(label), GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
 
 	gtk_widget_show_all(window);
diff --git a/pidgin/gtklog.c b/pidgin/gtklog.c
--- a/pidgin/gtklog.c
+++ b/pidgin/gtklog.c
@@ -602,7 +602,14 @@ static PidginLogViewer *display_log_view
 	text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>", title);
 
 	gtk_label_set_markup(lv->label, text);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(lv->label, GTK_ALIGN_START);
+	gtk_label_set_yalign(lv->label, GTK_ALIGN_START);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(lv->label), 0, 0);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_box_pack_start(GTK_BOX(title_box), GTK_WIDGET(lv->label), FALSE, FALSE, 0);
 	g_free(text);
 
@@ -644,7 +651,14 @@ static PidginLogViewer *display_log_view
 		size_label = gtk_label_new(NULL);
 		gtk_label_set_markup(GTK_LABEL(size_label), text);
 		/*		gtk_paned_add1(GTK_PANED(pane), size_label); */
+#if GTK_CHECK_VERSION (3,16,0)
+		gtk_label_set_xalign(GTK_LABEL(size_label), GTK_ALIGN_START);
+		gtk_label_set_yalign(GTK_LABEL(size_label), GTK_ALIGN_START);
+#else
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 		gtk_misc_set_alignment(GTK_MISC(size_label), 0, 0);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 		gtk_box_pack_end(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(lv->window))),
 		                 size_label, FALSE, FALSE, 0);
 		g_free(sz_txt);
diff --git a/pidgin/gtkmedia.c b/pidgin/gtkmedia.c
--- a/pidgin/gtkmedia.c
+++ b/pidgin/gtkmedia.c
@@ -768,10 +768,24 @@ phone_create_button(const gchar *text_hi
 
 	button = gtk_button_new();
 	label_hi = gtk_label_new(text_hi_local);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label_hi), GTK_ALIGN_CENTER);
+	gtk_label_set_yalign(GTK_LABEL(label_hi), GTK_ALIGN_CENTER);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label_hi), 0.5, 0.5);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_box_pack_end(GTK_BOX(grid), label_hi, FALSE, TRUE, 0);
 	label_lo = gtk_label_new(text_lo);
+#if GTK_CHECK_VERSION (3,16,0)
+	gtk_label_set_xalign(GTK_LABEL(label_lo), GTK_ALIGN_CENTER);
+	gtk_label_set_yalign(GTK_LABEL(label_lo), GTK_ALIGN_CENTER);
+#else
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
 	gtk_misc_set_alignment(GTK_MISC(label_lo), 0.5, 0.5);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+#endif
 	gtk_label_set_use_markup(GTK_LABEL(label_lo), TRUE);
 	gtk_box_pack_end(GTK_BOX(grid), label_lo, FALSE, TRUE, 0);



More information about the Commits mailing list