Previous 199869 Revisions Next

r30707 Thursday 29th May, 2014 at 11:15:11 UTC by Robbbert
In the File Manager, if the path is invalid, show the list of drives instead of an empty menu.
[src/emu/ui]filesel.c

trunk/src/emu/ui/filesel.c
r30706r30707
546546
547547   // open the directory
548548   err = zippath_opendir(path, &directory);
549   if (err != FILERR_NONE)
550      goto done;
551549
552550   // clear out the menu entries
553551   m_entrylist = NULL;
r30706r30707
580578   }
581579
582580   // build the menu for each item
583   while((dirent = zippath_readdir(directory)) != NULL)
581   if (err == FILERR_NONE)
584582   {
585      // append a dirent entry
586      entry = append_dirent_entry(dirent);
587
588      if (entry != NULL)
583      while((dirent = zippath_readdir(directory)) != NULL)
589584      {
590         // set the selected item to be the first non-parent directory or file
591         if ((selected_entry == NULL) && strcmp(dirent->name, ".."))
592            selected_entry = entry;
585         // append a dirent entry
586         entry = append_dirent_entry(dirent);
593587
594         // do we have to select this file?
595         if (!core_stricmp(m_current_file, dirent->name))
596            selected_entry = entry;
588         if (entry != NULL)
589         {
590            // set the selected item to be the first non-parent directory or file
591            if ((selected_entry == NULL) && strcmp(dirent->name, ".."))
592               selected_entry = entry;
593
594            // do we have to select this file?
595            if (!core_stricmp(m_current_file, dirent->name))
596               selected_entry = entry;
597         }
597598      }
598599   }
599600
r30706r30707
608609   // set up custom render proc
609610   customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
610611
611done:
612612   if (directory != NULL)
613613      zippath_closedir(directory);
614614}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team