Search
lxdream.org :: lxdream/src/gtkui/gtk_ctrl.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/gtk_ctrl.c
changeset 1043:ec716f2b8ffb
prev1036:af7b0c5905dd
next1057:6f2158c421bb
author nkeynes
date Sat Jun 27 09:55:00 2009 +0000 (11 years ago)
permissions -rw-r--r--
last change Ensure each VMU is only attached once
Handle removal of sub-devices when detaching parent device
file annotate diff log raw
1.1 --- a/src/gtkui/gtk_ctrl.c Wed Jun 24 06:06:40 2009 +0000
1.2 +++ b/src/gtkui/gtk_ctrl.c Sat Jun 27 09:55:00 2009 +0000
1.3 @@ -292,9 +292,17 @@
1.4 } else {
1.5 data->new_device = devclz->new_device();
1.6 }
1.7 - has_config = data->new_device != NULL && data->new_device->get_config != NULL;
1.8 + has_config = data->new_device != NULL && data->new_device->get_config != NULL && !MAPLE_IS_VMU(data->new_device);
1.9 has_slots = data->new_device == NULL ? 0 : MAPLE_SLOTS(devclz);
1.10 if( MAPLE_IS_VMU(data->new_device) ) {
1.11 + for( i=0; i<MAPLE_MAX_DEVICES; i++ ) {
1.12 + if( maple_data[i].new_device != NULL && MAPLE_IS_VMU(maple_data[i].new_device) &&
1.13 + MAPLE_VMU_HAS_NAME(maple_data[i].new_device, vmu_filename) ) {
1.14 + maple_data[i].new_device->destroy(maple_data[i].new_device);
1.15 + maple_data[i].new_device = NULL;
1.16 + gtk_combo_box_set_active(maple_data[i].combo,0);
1.17 + }
1.18 + }
1.19 MAPLE_SET_VMU_NAME(data->new_device,vmu_filename);
1.20 }
1.21
1.22 @@ -314,7 +322,7 @@
1.23 /* This is a little morally dubious... */
1.24 maple_slot_data_t subdata = data + MAPLE_DEVID(0,(i+1));
1.25 gtk_widget_set_sensitive(subdata->combo, i < has_slots );
1.26 - gtk_widget_set_sensitive(subdata->button, i < has_slots && subdata->new_device != NULL && subdata->new_device->get_config != NULL );
1.27 + gtk_widget_set_sensitive(subdata->button, i < has_slots && subdata->new_device != NULL && subdata->new_device->get_config != NULL && !MAPLE_IS_VMU(subdata->new_device) );
1.28 }
1.29 }
1.30 return TRUE;
.