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.4 gtk_gui_run_property_dialog( _("Controller Configuration"), table, controller_config_done );
1.8 gboolean maple_properties_activated( GtkButton *button, gpointer user_data )
1.10 maple_slot_data_t data = (maple_slot_data_t)user_data;
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.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.22 data->new_device = maple_new_device(devname);
1.24 + has_config = data->new_device != NULL && data->new_device->get_config != NULL;
1.26 if( data->new_device != NULL && data->new_device != data->old_device ) {
1.27 data->new_device->destroy(data->new_device);
1.29 data->new_device = NULL;
1.31 + gtk_widget_set_sensitive(data->button, has_config);
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.43 maple_data[i].old_device = device;