Commit 2ddfebf9 authored by dionoea's avatar dionoea

CD/DVD detection patch by Brian Robb

parent 93e6a6a6
......@@ -21,6 +21,7 @@ Benjamin Mironer <bmironer at noos.fr> - Mac OS X fixes
Benoit Steiner <benny at via.ecp.fr> - MPEG system input, network input
Bill Eldridge <bill at rfa.org> - documentation
Bob Maguire <maguirer at rjmaguire dot com> - addition of some controls to the OSX interface
Brian Robb <vascy at hotmail dot com> - win32 CD/DVD drive detection in wx
Brieuc Jeunhomme <bbp at via.ecp.fr> - bug fixes
Bruno Vella <allevb at tin.it> - Italian localization
Carlo Calabr <murray at via.ecp.fr> - Italian localization
......
......@@ -24,6 +24,7 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <errno.h> /* ENOMEM */
#include <string.h> /* strerror() */
......@@ -707,6 +708,32 @@ wxPanel *OpenDialog::DiscPanel( wxWindow* parent )
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
#ifdef WIN32
char psz_default_device[3] = {0};
/* find the drive_name for the first cdrom drive,
* which is probably "D:" and put the drive_name into
* psz_default_device... */
for( char drive_letter = 'A'; drive_letter <= 'Z'; ++drive_letter )
{
char drive_name[3] = {drive_letter, ':', 0};
UINT type = GetDriveType( drive_name );
if( type == DRIVE_CDROM )
{
psz_default_device[0] = drive_letter;
psz_default_device[1] = ':';
break;
}
}
if( strlen(psz_default_device) > 0 )
{
if(disc_device)
disc_device->SetValue( wxL2U(psz_default_device) );
}
#endif
sizer->Add( label, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
sizer->Add( disc_device, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment