gpointing-device-settings r263 - in trunk: src test
- From: hiikezoe svn gnome org
- To: svn-commits-list gnome org
- Subject: gpointing-device-settings r263 - in trunk: src test
- Date: Wed, 25 Mar 2009 03:20:33 +0000 (UTC)
Author: hiikezoe
Date: Wed Mar 25 03:20:33 2009
New Revision: 263
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=263&view=rev
Log:
Set sentive to widget correctly.
Modified:
trunk/src/gpds-xinput-ui.h
trunk/test/test-ui-widget.c
Modified: trunk/src/gpds-xinput-ui.h
==============================================================================
--- trunk/src/gpds-xinput-ui.h (original)
+++ trunk/src/gpds-xinput-ui.h Wed Mar 25 03:20:33 2009
@@ -85,9 +85,9 @@
enable = gtk_toggle_button_get_active(button); \
gpds_ui_set_gconf_bool(GPDS_UI(user_data), PROPERTY_NAME ## _KEY, enable); \
builder = gpds_ui_get_builder(GPDS_UI(user_data)); \
+ depend_widget = gtk_builder_get_object(builder, depend_widget_name); \
if (!depend_widget) \
return; \
- depend_widget = gtk_builder_get_object(builder, depend_widget_name); \
gtk_widget_set_sensitive(GTK_WIDGET(depend_widget), enable); \
}
Modified: trunk/test/test-ui-widget.c
==============================================================================
--- trunk/test/test-ui-widget.c (original)
+++ trunk/test/test-ui-widget.c Wed Mar 25 03:20:33 2009
@@ -213,24 +213,28 @@
gcut_add_datum("wheel emulation",
"widget-name", G_TYPE_STRING, "wheel_emulation",
"xinput-name", G_TYPE_STRING, "Evdev Wheel Emulation",
+ "dependent-widget-name", G_TYPE_STRING, "wheel_emulation_box",
NULL);
gcut_add_datum("middle button emulation",
"widget-name", G_TYPE_STRING, "middle_button_emulation",
"xinput-name", G_TYPE_STRING, "Evdev Middle Button Emulation",
+ "dependent-widget-name", G_TYPE_STRING, "middle_button_emulation_box",
NULL);
}
void
test_toggle_button (gconstpointer data)
{
- GtkWidget *button;
+ GtkWidget *button, *dependent_widget;
gboolean widget_value;
gboolean xinput_value;
const gchar *widget_name;
const gchar *xinput_name;
+ const gchar *dependent_widget_name;
widget_name = gcut_data_get_string(data, "widget-name");
xinput_name = gcut_data_get_string(data, "xinput-name");
+ dependent_widget_name = gcut_data_get_string(data, "dependent-widget-name");
button = get_widget(widget_name);
cut_assert_true(GTK_IS_TOGGLE_BUTTON(button));
@@ -239,10 +243,16 @@
widget_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
cut_assert_equal_int(xinput_value, widget_value);
+ /* check widget sensitivity */
+ dependent_widget = get_widget(dependent_widget_name);
+ cut_assert_equal_int(widget_value, GTK_WIDGET_SENSITIVE(dependent_widget));
+
gtk_test_widget_click(button, 1, 0);
wait_action();
xinput_value = get_boolean_property_of_xinput(xinput_name);
cut_assert_equal_int(xinput_value, !widget_value);
+
+ cut_assert_equal_int(!widget_value, GTK_WIDGET_SENSITIVE(dependent_widget));
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]