Previous 199869 Revisions Next

r34386 Wednesday 14th January, 2015 at 06:55:37 UTC by Fabio Priuli
ui: slightly reworked the File Manager initial menu to show which
device each media belongs to, so that if you change slot options
(e.g. adding further floppy drives to the emulated machine) you
can more easily spot which image is currently mounted in each
drive. Next, I plan to group media switches by owner, so to avoid
unnecessarily long menus. nw.
[src/emu/ui]filemngr.c

trunk/src/emu/ui/filemngr.c
r242897r242898
6666void ui_menu_file_manager::populate()
6767{
6868   astring buffer;
69   astring tmp_name;
69   bool first = true;
7070
7171   // cycle through all devices for this system
7272   image_interface_iterator iter(machine().root_device());
7373   for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
7474   {
75      if (first)
76         first = false;
77      else
78         item_append("", NULL, MENU_FLAG_DISABLE, NULL);
79
7580      // 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);
7984
8085      // get the base name
8186      if (image->basename() != NULL)
8287      {
83         tmp_name.cpy(image->basename());
88         buffer.cpy(image->basename());
8489
8590         // if the image has been loaded through softlist, also show the loaded part
8691         if (image->part_entry() != NULL)
r242897r242898
8893            const software_part *tmp = image->part_entry();
8994            if (tmp->name() != NULL)
9095            {
91               tmp_name.cat(" (");
92               tmp_name.cat(tmp->name());
96               buffer.cat(" (");
97               buffer.cat(tmp->name());
9398               // also check if this part has a specific part_id (e.g. "Map Disc", "Bonus Disc", etc.), and in case display it
9499               if (image->get_feature("part_id") != NULL)
95100               {
96                  tmp_name.cat(": ");
97                  tmp_name.cat(image->get_feature("part_id"));
101                  buffer.cat(": ");
102                  buffer.cat(image->get_feature("part_id"));
98103               }
99               tmp_name.cat(")");
104               buffer.cat(")");
100105            }
101106         }
102107      }
103108      else
104         tmp_name.cpy("---");
109         buffer.cpy("---");
105110
106111      // record the menu item
107      item_append(buffer, tmp_name.cstr(), 0, (void *) image);
112      item_append("Mounted File", buffer, 0, (void *) image);
108113   }
109114   item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
110115   item_append("Reset",  NULL, 0, (void *)1);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team