/pidgin/main: b66f1935b3d0: Minor re-arrangement for VV prefs code.

Elliott Sales de Andrade qulogic at pidgin.im
Fri Feb 14 04:26:28 EST 2014


Changeset: b66f1935b3d0e2d21a39607d648cf186a75610af
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2014-02-14 04:24 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/b66f1935b3d0

Description:

Minor re-arrangement for VV prefs code.

diffstat:

 pidgin/gtkprefs.c |  142 +++++++++++++++++++++++++++---------------------------
 1 files changed, 71 insertions(+), 71 deletions(-)

diffs (159 lines):

diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -3622,77 +3622,6 @@ get_vv_element_plugins(const gchar **plu
 	return g_list_reverse(ret);
 }
 
-static void
-vv_plugin_changed_cb(const gchar *name, PurplePrefType type,
-                     gconstpointer value, gpointer data)
-{
-	GtkWidget *vbox = data;
-	GtkSizeGroup *sg;
-	GtkWidget *widget;
-	gchar *pref;
-	GList *devices;
-
-	sg = g_object_get_data(G_OBJECT(vbox), "size-group");
-	widget = g_object_get_data(G_OBJECT(vbox), "device-hbox");
-	gtk_widget_destroy(widget);
-
-	pref = g_strdup(name);
-	strcpy(pref + strlen(pref) - strlen("plugin"), "device");
-	devices = get_vv_element_devices(value);
-	if (g_list_find_custom(devices, purple_prefs_get_string(pref),
-	                       (GCompareFunc)strcmp) == NULL)
-		purple_prefs_set_string(pref, g_list_next(devices)->data);
-	widget = pidgin_prefs_dropdown_from_list(vbox, _("_Device"),
-	                                         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);
-
-	g_object_set_data(G_OBJECT(vbox), "device-hbox",
-	                  gtk_widget_get_parent(widget));
-	g_signal_connect_swapped(widget, "destroy", G_CALLBACK(g_free), pref);
-}
-
-static void
-make_vv_frame(GtkWidget *parent, GtkSizeGroup *sg,
-              const gchar *name, const gchar **plugin_strs,
-              const gchar *plugin_pref, const gchar *device_pref)
-{
-	GtkWidget *vbox, *widget;
-	GList *plugins, *devices;
-
-	vbox = pidgin_make_frame(parent, name);
-
-	/* Setup plugin preference */
-	plugins = get_vv_element_plugins(plugin_strs);
-	widget = pidgin_prefs_dropdown_from_list(vbox, _("_Plugin"),
-	                                         PURPLE_PREF_STRING, plugin_pref,
-	                                         plugins);
-	g_list_free(plugins);
-	gtk_size_group_add_widget(sg, widget);
-	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
-
-	/* Setup device preference */
-	devices = get_vv_element_devices(purple_prefs_get_string(plugin_pref));
-	if (g_list_find_custom(devices, purple_prefs_get_string(device_pref),
-	                       (GCompareFunc)strcmp) == NULL)
-		purple_prefs_set_string(device_pref, g_list_next(devices)->data);
-	widget = pidgin_prefs_dropdown_from_list(vbox, _("_Device"),
-	                                         PURPLE_PREF_STRING, device_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);
-
-	widget = gtk_widget_get_parent(widget);
-	g_object_set_data(G_OBJECT(vbox), "size-group", sg);
-	g_object_set_data(G_OBJECT(vbox), "device-hbox", widget);
-	purple_prefs_connect_callback(vbox, plugin_pref, vv_plugin_changed_cb,
-	                              vbox);
-	g_signal_connect_swapped(vbox, "destroy",
-	                         G_CALLBACK(purple_prefs_disconnect_by_handle), vbox);
-}
-
 static GstElement *
 create_test_element(PurpleMediaElementType type)
 {
@@ -4070,6 +3999,77 @@ make_video_test(GtkWidget *vbox)
 	                 G_CALLBACK(toggle_video_test_cb), NULL);
 }
 
+static void
+vv_plugin_changed_cb(const gchar *name, PurplePrefType type,
+                     gconstpointer value, gpointer data)
+{
+	GtkWidget *vbox = data;
+	GtkSizeGroup *sg;
+	GtkWidget *widget;
+	gchar *pref;
+	GList *devices;
+
+	sg = g_object_get_data(G_OBJECT(vbox), "size-group");
+	widget = g_object_get_data(G_OBJECT(vbox), "device-hbox");
+	gtk_widget_destroy(widget);
+
+	pref = g_strdup(name);
+	strcpy(pref + strlen(pref) - strlen("plugin"), "device");
+	devices = get_vv_element_devices(value);
+	if (g_list_find_custom(devices, purple_prefs_get_string(pref),
+	                       (GCompareFunc)strcmp) == NULL)
+		purple_prefs_set_string(pref, g_list_next(devices)->data);
+	widget = pidgin_prefs_dropdown_from_list(vbox, _("_Device"),
+	                                         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);
+
+	g_object_set_data(G_OBJECT(vbox), "device-hbox",
+	                  gtk_widget_get_parent(widget));
+	g_signal_connect_swapped(widget, "destroy", G_CALLBACK(g_free), pref);
+}
+
+static void
+make_vv_frame(GtkWidget *parent, GtkSizeGroup *sg,
+              const gchar *name, const gchar **plugin_strs,
+              const gchar *plugin_pref, const gchar *device_pref)
+{
+	GtkWidget *vbox, *widget;
+	GList *plugins, *devices;
+
+	vbox = pidgin_make_frame(parent, name);
+
+	/* Setup plugin preference */
+	plugins = get_vv_element_plugins(plugin_strs);
+	widget = pidgin_prefs_dropdown_from_list(vbox, _("_Plugin"),
+	                                         PURPLE_PREF_STRING, plugin_pref,
+	                                         plugins);
+	g_list_free(plugins);
+	gtk_size_group_add_widget(sg, widget);
+	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
+
+	/* Setup device preference */
+	devices = get_vv_element_devices(purple_prefs_get_string(plugin_pref));
+	if (g_list_find_custom(devices, purple_prefs_get_string(device_pref),
+	                       (GCompareFunc)strcmp) == NULL)
+		purple_prefs_set_string(device_pref, g_list_next(devices)->data);
+	widget = pidgin_prefs_dropdown_from_list(vbox, _("_Device"),
+	                                         PURPLE_PREF_STRING, device_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);
+
+	widget = gtk_widget_get_parent(widget);
+	g_object_set_data(G_OBJECT(vbox), "size-group", sg);
+	g_object_set_data(G_OBJECT(vbox), "device-hbox", widget);
+	purple_prefs_connect_callback(vbox, plugin_pref, vv_plugin_changed_cb,
+	                              vbox);
+	g_signal_connect_swapped(vbox, "destroy",
+	                         G_CALLBACK(purple_prefs_disconnect_by_handle), vbox);
+}
+
 static GtkWidget *
 vv_page(void)
 {



More information about the Commits mailing list