/pidgin/main: 76208141a643: Disable VV tests when changing noteb...

Elliott Sales de Andrade qulogic at pidgin.im
Mon Nov 5 18:15:59 EST 2012


Changeset: 76208141a643a2e4902b85caa15cb649b2f8ecbc
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2012-09-15 01:04 -0400
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/76208141a643

Description:

Disable VV tests when changing notebook tabs.

diffstat:

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

diffs (52 lines):

diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -3206,6 +3206,13 @@ create_test_element(const char *type, co
 	return ret;
 }
 
+static void
+vv_test_switch_page_cb(GtkNotebook *notebook, GtkWidget *page, guint num, gpointer data)
+{
+	GtkWidget *test = data;
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(test), FALSE);
+}
+
 static GstElement *
 create_voice_pipeline(void)
 {
@@ -3321,6 +3328,8 @@ toggle_voice_test_cb(GtkToggleButton *te
 		                 G_CALLBACK(on_volume_change_cb), voice_pipeline);
 		g_signal_connect(test, "destroy",
 		                 G_CALLBACK(voice_test_destroy_cb), NULL);
+		g_signal_connect(prefsnotebook, "switch-page",
+		                 G_CALLBACK(vv_test_switch_page_cb), test);
 	} else {
 		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ctx->level), 0.0);
 		gtk_widget_set_sensitive(ctx->level, FALSE);
@@ -3330,6 +3339,9 @@ toggle_voice_test_cb(GtkToggleButton *te
 		g_object_disconnect(test, "any-signal::destroy",
 		                    G_CALLBACK(voice_test_destroy_cb), NULL,
 		                    NULL);
+		g_object_disconnect(prefsnotebook, "any-signal::switch-page",
+		                    G_CALLBACK(vv_test_switch_page_cb), test,
+		                    NULL);
 		voice_test_destroy_cb(NULL, NULL);
 	}
 }
@@ -3501,10 +3513,15 @@ toggle_video_test_cb(GtkToggleButton *te
 
 		g_signal_connect(test, "destroy",
 		                 G_CALLBACK(video_test_destroy_cb), NULL);
+		g_signal_connect(prefsnotebook, "switch-page",
+		                 G_CALLBACK(vv_test_switch_page_cb), test);
 	} else {
 		g_object_disconnect(test, "any-signal::destroy",
 		                    G_CALLBACK(video_test_destroy_cb), NULL,
 		                    NULL);
+		g_object_disconnect(prefsnotebook, "any-signal::switch-page",
+		                    G_CALLBACK(vv_test_switch_page_cb), test,
+		                    NULL);
 		video_test_destroy_cb(NULL, NULL);
 	}
 }



More information about the Commits mailing list