Search
lxdream.org :: lxdream/src/gtkui/ctrl_dlg.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/ctrl_dlg.c
changeset 608:4f588e52bce0
prev561:533f6b478071
next614:a2d239d4438a
author nkeynes
date Sat Jan 26 02:45:27 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Bug #50: Implement mouse and keyboard
file annotate diff log raw
1.1 --- a/src/gtkui/ctrl_dlg.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/gtkui/ctrl_dlg.c Sat Jan 26 02:45:27 2008 +0000
1.3 @@ -180,7 +180,6 @@
1.4 gtk_gui_run_property_dialog( _("Controller Configuration"), table, controller_config_done );
1.5 }
1.6
1.7 -
1.8 gboolean maple_properties_activated( GtkButton *button, gpointer user_data )
1.9 {
1.10 maple_slot_data_t data = (maple_slot_data_t)user_data;
1.11 @@ -207,7 +206,7 @@
1.12 {
1.13 maple_slot_data_t data = (maple_slot_data_t)user_data;
1.14 int active = gtk_combo_box_get_active(combo);
1.15 - gtk_widget_set_sensitive(data->button, active != 0);
1.16 + gboolean has_config = FALSE;
1.17 if( active != 0 ) {
1.18 gchar *devname = gtk_combo_box_get_active_text(combo);
1.19 const maple_device_class_t devclz = maple_get_device_class(devname);
1.20 @@ -220,12 +219,14 @@
1.21 } else {
1.22 data->new_device = maple_new_device(devname);
1.23 }
1.24 + has_config = data->new_device != NULL && data->new_device->get_config != NULL;
1.25 } else {
1.26 if( data->new_device != NULL && data->new_device != data->old_device ) {
1.27 data->new_device->destroy(data->new_device);
1.28 }
1.29 data->new_device = NULL;
1.30 }
1.31 + gtk_widget_set_sensitive(data->button, has_config);
1.32 return TRUE;
1.33 }
1.34
1.35 @@ -280,7 +281,7 @@
1.36 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), active);
1.37 gtk_table_attach_defaults( GTK_TABLE(table), combo, 1, 2, i, i+1 );
1.38 button = gtk_button_new_from_stock( GTK_STOCK_PROPERTIES );
1.39 - gtk_widget_set_sensitive(button, active != 0);
1.40 + gtk_widget_set_sensitive(button, active != 0 && device->get_config != NULL);
1.41 gtk_table_attach_defaults( GTK_TABLE(table), button, 2, 3, i, i+1 );
1.42
1.43 maple_data[i].old_device = device;
.