diff -Naur gnomebaker-0.6.0.old/src/devices.c gnomebaker-0.6.0/src/devices.c --- gnomebaker-0.6.0.old/src/devices.c 2006-05-29 12:20:49.000000000 -0400 +++ gnomebaker-0.6.0/src/devices.c 2006-10-12 19:07:32.000000000 -0400 @@ -230,16 +230,47 @@ void -devices_save_optionmenu(GtkOptionMenu *option_menu, const gchar *device_key) +devices_save_optionmenu(GtkOptionMenu *option_menu, const gchar *device_key, const gboolean writers_only) { GB_LOG_FUNC g_return_if_fail(option_menu != NULL); g_return_if_fail(device_key != NULL); - gint index = gtk_option_menu_get_history(option_menu); - gchar *device = g_strdup_printf(GB_DEVICE_FORMAT, index + 1); - preferences_set_string(device_key, device); - g_free(device); + gint menuindex = gtk_option_menu_get_history(option_menu); + + gint index = 0, count = 0, device = 0; + GSList *devices = preferences_get_key_subkeys(GB_DEVICES_KEY); + GSList *item = devices; + + for(; device == 0; item = item->next) + { + gchar *device_key = (gchar*)item->data; + + gchar *device_capabilities_key = g_strconcat(device_key, GB_DEVICE_CAPABILITIES_LABEL, NULL); + const gint capabilities = preferences_get_int(device_capabilities_key); + /* Check the capabilities of the device and make sure that, if only writers were added + * to the options menu, the device can actually write disks */ + if(!writers_only || (capabilities & DC_WRITE_CDR || capabilities & DC_WRITE_CDRW || + capabilities & DC_WRITE_DVDR || capabilities & DC_WRITE_DVDRAM)) + { + if(index == menuindex) + { + device = count + 1; + } + ++index; + } + + g_free(device_capabilities_key); + g_free(device_key); + ++count; + + } + + g_slist_free(devices); + + gchar *devicename = g_strdup_printf(GB_DEVICE_FORMAT, device); + preferences_set_string(device_key, devicename); + g_free(devicename); } diff -Naur gnomebaker-0.6.0.old/src/selectdevicedlg.c gnomebaker-0.6.0/src/selectdevicedlg.c --- gnomebaker-0.6.0.old/src/selectdevicedlg.c 2006-05-29 12:20:49.000000000 -0400 +++ gnomebaker-0.6.0/src/selectdevicedlg.c 2006-10-12 19:08:59.000000000 -0400 @@ -66,5 +66,5 @@ g_return_if_fail(selectdevicedlgdlg_xml != NULL); GtkWidget *option_menu = glade_xml_get_widget(selectdevicedlgdlg_xml, widget_select_writer); - devices_save_optionmenu(GTK_OPTION_MENU(option_menu), GB_WRITER); + devices_save_optionmenu(GTK_OPTION_MENU(option_menu), GB_WRITER, TRUE); } diff -Naur gnomebaker-0.6.0.old/src/startdlg.c gnomebaker-0.6.0/src/startdlg.c --- gnomebaker-0.6.0.old/src/startdlg.c 2006-08-30 19:41:15.000000000 -0400 +++ gnomebaker-0.6.0/src/startdlg.c 2006-10-12 19:07:51.000000000 -0400 @@ -69,8 +69,8 @@ g_return_if_fail(user_data != NULL); StartDlg *start_dlg = (StartDlg*)user_data; - devices_save_optionmenu(start_dlg->reader, GB_READER); - devices_save_optionmenu(start_dlg->writer, GB_WRITER); + devices_save_optionmenu(start_dlg->reader, GB_READER, FALSE); + devices_save_optionmenu(start_dlg->writer, GB_WRITER, TRUE); const gint index = gtk_option_menu_get_history(start_dlg->write_speed); if(index == 0) preferences_set_int(start_dlg->dvdmode ? GB_DVDWRITE_SPEED : GB_CDWRITE_SPEED, 0);