/pidgin/main: 0db23c801fde: gtkprefs: replace usages of deprecat...

Jakub Adam jakub.adam at ktknet.cz
Tue May 24 20:09:14 EDT 2016


Changeset: 0db23c801fde9e7bef9991eece5ab3ec75cd578f
Author:	 Jakub Adam <jakub.adam at ktknet.cz>
Date:	 2016-04-20 12:26 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/0db23c801fde

Description:

gtkprefs: replace usages of deprecated gtk_misc_set_alignment()

diffstat:

 pidgin/gtkprefs.c |  63 ++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 42 insertions(+), 21 deletions(-)

diffs (210 lines):

diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -1415,7 +1415,8 @@ add_theme_prefs_combo(GtkWidget *vbox,
 	GtkWidget *themesel_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE);
 
 	label = gtk_label_new(label_str);
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 	gtk_size_group_add_widget(label_sg, label);
 	gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
 
@@ -1447,7 +1448,8 @@ add_child_theme_prefs_combo(GtkWidget *v
 	gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new(label_str);
-	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_END);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 	gtk_size_group_add_widget(label_sg, label);
 	gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
 
@@ -1484,7 +1486,8 @@ theme_page(void)
 							"the lists below.\nNew themes can be installed by "
 							"dragging and dropping them onto the theme list."));
 
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 	gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
 
 	gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 0);
@@ -1744,7 +1747,8 @@ interface_page(void)
 					_("Never"), "never",
 					NULL);
 	gtk_size_group_add_widget(sg, label);
-	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 
 	vbox = pidgin_make_frame(ret, _("Conversation Window"));
 	label = pidgin_prefs_dropdown(vbox, _("_Hide new IM conversations:"),
@@ -1754,7 +1758,8 @@ interface_page(void)
 					_("Always"), "always",
 					NULL);
 	gtk_size_group_add_widget(sg, label);
-	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 
 #ifdef _WIN32
 	pidgin_prefs_checkbox(_("Minimi_ze new conversation windows"), PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", vbox);
@@ -1790,12 +1795,14 @@ interface_page(void)
 					_("Right Vertical"), GTK_POS_RIGHT|8,
 					NULL);
 	gtk_size_group_add_widget(sg, label);
-	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 
 	names = pidgin_conv_placement_get_options();
 	label = pidgin_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"),
 				PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names);
-	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 
 	gtk_size_group_add_widget(sg, label);
 
@@ -2165,7 +2172,8 @@ network_page(void)
 	label = gtk_label_new(NULL);
 	gtk_label_set_markup(GTK_LABEL(label),
 			_("<span style=\"italic\">Example: stunserver.org</span>"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 	gtk_container_add(GTK_CONTAINER(hbox), label);
 
 	auto_ip_checkbox = pidgin_prefs_checkbox("Use _automatically detected IP address",
@@ -2406,7 +2414,8 @@ browser_page(void)
 											 PIDGIN_PREFS_ROOT "/browsers/browser",
 											 browsers);
 			g_list_free(browsers);
-			gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+			gtk_widget_set_halign(label, GTK_ALIGN_START);
+			gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 			gtk_size_group_add_widget(sg, label);
 
 			hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
@@ -2416,7 +2425,8 @@ browser_page(void)
 				_("New window"), PIDGIN_BROWSER_NEW_WINDOW,
 				_("New tab"), PIDGIN_BROWSER_NEW_TAB,
 				NULL);
-			gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+			gtk_widget_set_halign(label, GTK_ALIGN_START);
+			gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 			gtk_size_group_add_widget(sg, label);
 			gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
@@ -2532,7 +2542,8 @@ proxy_page(void)
 		gtk_container_add(GTK_CONTAINER(prefs_proxy_subframe), grid);
 
 		label = GTK_LABEL(gtk_label_new_with_mnemonic(_("_Host:")));
-		gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+		gtk_widget_set_halign(label, GTK_ALIGN_END);
+		gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 		gtk_grid_attach_full(GTK_GRID(grid), GTK_WIDGET(label), 0, 0, 1, 1,
 			GTK_FILL, 0, 0, 0);
 
@@ -2553,7 +2564,8 @@ proxy_page(void)
 		pidgin_set_accessible_label(entry, label);
 
 		label = GTK_LABEL(gtk_label_new_with_mnemonic(_("P_ort:")));
-		gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+		gtk_widget_set_halign(label, GTK_ALIGN_END);
+		gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 		gtk_grid_attach_full(GTK_GRID(grid), GTK_WIDGET(label), 2, 0, 1, 1,
 			GTK_FILL, 0, 0, 0);
 
@@ -2571,7 +2583,8 @@ proxy_page(void)
 		pidgin_set_accessible_label(entry, label);
 
 		label = GTK_LABEL(gtk_label_new_with_mnemonic(_("User_name:")));
-		gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+		gtk_widget_set_halign(label, GTK_ALIGN_END);
+		gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 		gtk_grid_attach_full(GTK_GRID(grid), GTK_WIDGET(label), 0, 1, 1, 1,
 			GTK_FILL, 0, 0, 0);
 
@@ -2592,7 +2605,8 @@ proxy_page(void)
 		pidgin_set_accessible_label(entry, label);
 
 		label = GTK_LABEL(gtk_label_new_with_mnemonic(_("Pa_ssword:")));
-		gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+		gtk_widget_set_halign(label, GTK_ALIGN_END);
+		gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 		gtk_grid_attach_full(GTK_GRID(grid), GTK_WIDGET(label), 2, 1, 1, 1,
 			GTK_FILL, 0, 0, 0);
 
@@ -3139,7 +3153,8 @@ sound_page(void)
 			_("No sounds"), "none",
 			NULL);
 	gtk_size_group_add_widget(sg, dd);
-	gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
+	gtk_widget_set_halign(dd, GTK_ALIGN_START);
+	gtk_widget_set_valign(dd, GTK_ALIGN_CENTER);
 
 	entry = gtk_entry_new();
 	gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
@@ -3310,7 +3325,8 @@ away_page(void)
 #endif
 		NULL);
 	gtk_size_group_add_widget(sg, dd);
-	gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
+	gtk_widget_set_halign(dd, GTK_ALIGN_START);
+	gtk_widget_set_valign(dd, GTK_ALIGN_CENTER);
 
 	pidgin_prefs_labeled_spin_button(vbox,
 			_("_Minutes before becoming idle:"), "/purple/away/mins_before_away",
@@ -3344,7 +3360,8 @@ away_page(void)
 		_("When both away and idle"), "awayidle",
 		NULL);
 	gtk_size_group_add_widget(sg, dd);
-	gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
+	gtk_widget_set_halign(dd, GTK_ALIGN_START);
+	gtk_widget_set_valign(dd, GTK_ALIGN_CENTER);
 
 	/* Signon status stuff */
 	vbox = pidgin_make_frame(ret, _("Status at Startup"));
@@ -3656,7 +3673,8 @@ make_voice_test(GtkWidget *vbox)
 	                      purple_prefs_get_int("/purple/media/audio/silence_threshold"));
 	label = gtk_label_new(tmp);
 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+	gtk_widget_set_halign(label, GTK_ALIGN_START);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
 	g_free(tmp);
 	threshold = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,
 		0, 100, 1);
@@ -3852,7 +3870,8 @@ vv_plugin_changed_cb(const gchar *name, 
 	                                         PURPLE_PREF_STRING, pref, devices);
 	g_list_free_full(devices, g_free);
 	gtk_size_group_add_widget(sg, widget);
-	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
+	gtk_widget_set_halign(widget, GTK_ALIGN_START);
+	gtk_widget_set_valign(widget, GTK_ALIGN_CENTER);
 
 	g_object_set_data(G_OBJECT(vbox), "device-hbox",
 	                  gtk_widget_get_parent(widget));
@@ -3885,7 +3904,8 @@ make_vv_frame(GtkWidget *parent, GtkSize
 	                                         plugins);
 	g_list_free(plugins);
 	gtk_size_group_add_widget(sg, widget);
-	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
+	gtk_widget_set_halign(widget, GTK_ALIGN_START);
+	gtk_widget_set_valign(widget, GTK_ALIGN_CENTER);
 
 	/* Setup device preference */
 	devices = get_vv_element_devices(purple_prefs_get_string(plugin_pref));
@@ -3901,7 +3921,8 @@ make_vv_frame(GtkWidget *parent, GtkSize
 	                                         devices);
 	g_list_free_full(devices, g_free);
 	gtk_size_group_add_widget(sg, widget);
-	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
+	gtk_widget_set_halign(widget, GTK_ALIGN_START);
+	gtk_widget_set_valign(widget, GTK_ALIGN_CENTER);
 
 	widget = gtk_widget_get_parent(widget);
 	g_object_set_data(G_OBJECT(vbox), "size-group", sg);



More information about the Commits mailing list