trunk/src/emu/ui/filemngr.c
| r242897 | r242898 | |
| 66 | 66 | void ui_menu_file_manager::populate() |
| 67 | 67 | { |
| 68 | 68 | astring buffer; |
| 69 | | astring tmp_name; |
| 69 | bool first = true; |
| 70 | 70 | |
| 71 | 71 | // cycle through all devices for this system |
| 72 | 72 | image_interface_iterator iter(machine().root_device()); |
| 73 | 73 | for (device_image_interface *image = iter.first(); image != NULL; image = iter.next()) |
| 74 | 74 | { |
| 75 | if (first) |
| 76 | first = false; |
| 77 | else |
| 78 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); |
| 79 | |
| 75 | 80 | // get the image type/id |
| 76 | | buffer.printf( |
| 77 | | "%s (%s)", |
| 78 | | image->device().name(), image->brief_instance_name()); |
| 81 | buffer.printf("%s (%s)", image->instance_name(), image->brief_instance_name()); |
| 82 | item_append(buffer, "", MENU_FLAG_DISABLE, NULL); |
| 83 | item_append("Device", image->device().tag(), MENU_FLAG_DISABLE, NULL); |
| 79 | 84 | |
| 80 | 85 | // get the base name |
| 81 | 86 | if (image->basename() != NULL) |
| 82 | 87 | { |
| 83 | | tmp_name.cpy(image->basename()); |
| 88 | buffer.cpy(image->basename()); |
| 84 | 89 | |
| 85 | 90 | // if the image has been loaded through softlist, also show the loaded part |
| 86 | 91 | if (image->part_entry() != NULL) |
| r242897 | r242898 | |
| 88 | 93 | const software_part *tmp = image->part_entry(); |
| 89 | 94 | if (tmp->name() != NULL) |
| 90 | 95 | { |
| 91 | | tmp_name.cat(" ("); |
| 92 | | tmp_name.cat(tmp->name()); |
| 96 | buffer.cat(" ("); |
| 97 | buffer.cat(tmp->name()); |
| 93 | 98 | // also check if this part has a specific part_id (e.g. "Map Disc", "Bonus Disc", etc.), and in case display it |
| 94 | 99 | if (image->get_feature("part_id") != NULL) |
| 95 | 100 | { |
| 96 | | tmp_name.cat(": "); |
| 97 | | tmp_name.cat(image->get_feature("part_id")); |
| 101 | buffer.cat(": "); |
| 102 | buffer.cat(image->get_feature("part_id")); |
| 98 | 103 | } |
| 99 | | tmp_name.cat(")"); |
| 104 | buffer.cat(")"); |
| 100 | 105 | } |
| 101 | 106 | } |
| 102 | 107 | } |
| 103 | 108 | else |
| 104 | | tmp_name.cpy("---"); |
| 109 | buffer.cpy("---"); |
| 105 | 110 | |
| 106 | 111 | // record the menu item |
| 107 | | item_append(buffer, tmp_name.cstr(), 0, (void *) image); |
| 112 | item_append("Mounted File", buffer, 0, (void *) image); |
| 108 | 113 | } |
| 109 | 114 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 110 | 115 | item_append("Reset", NULL, 0, (void *)1); |