Revise the way that cdrom and dvd rom drives are identified in linux to remove reduntant drive listings. Also no longer checking mount points (in fstap and mtab). This can give redundant listings, and GC/Wii backup discs can not be mounted anyway. This prevents multiple listings from appearing in the GameListCtrl when "Show Drives" is selected.
Some general code cleanup, and removed a PanicAlert (made it a NOTICE_LOG instead) so that only one panic alert is shown when attempting to load from dvd/cdrom drives, and none are shown when "Show Drives" is selected from the menu. Also removed the hack introduced in revision 5564 that prevents the GameListCtrl from being properly updated when a game is loaded from the command line or via the autostart feature of the debugger. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5848 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
c37bca75b6
commit
0ad71eda6b
|
@ -16,46 +16,18 @@
|
||||||
#include <IOKit/IOBSD.h>
|
#include <IOKit/IOBSD.h>
|
||||||
|
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
#include <mntent.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#include <linux/cdrom.h>
|
#include <linux/cdrom.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
// Follow symlinks until we have the real device file (idea taken from libunieject).
|
|
||||||
void cdio_follow_symlink(const char * src, char * dst) {
|
|
||||||
#ifndef _WIN32
|
|
||||||
char tmp_src[PATH_MAX+1];
|
|
||||||
char tmp_dst[PATH_MAX+1];
|
|
||||||
|
|
||||||
int len;
|
|
||||||
|
|
||||||
strcpy(tmp_src, src);
|
|
||||||
while(1) {
|
|
||||||
len = readlink(tmp_src, tmp_dst, PATH_MAX);
|
|
||||||
if(len < 0) {
|
|
||||||
strncpy(dst, tmp_src, PATH_MAX);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tmp_dst[len] = '\0';
|
|
||||||
strncpy(tmp_src, tmp_dst, PATH_MAX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
strncpy(dst, src, PATH_MAX);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Returns a string that can be used in a CreateFile call if
|
// Returns a string that can be used in a CreateFile call if
|
||||||
// c_drive letter is a character. If not NULL is returned.
|
// c_drive letter is a character. If not NULL is returned.
|
||||||
const char *is_cdrom_win32(const char c_drive_letter) {
|
const char *is_cdrom(const char c_drive_letter)
|
||||||
|
{
|
||||||
|
|
||||||
UINT uDriveType;
|
UINT uDriveType;
|
||||||
char sz_win32_drive[4];
|
char sz_win32_drive[4];
|
||||||
|
@ -67,8 +39,10 @@ const char *is_cdrom_win32(const char c_drive_letter) {
|
||||||
|
|
||||||
uDriveType = GetDriveType(sz_win32_drive);
|
uDriveType = GetDriveType(sz_win32_drive);
|
||||||
|
|
||||||
switch(uDriveType) {
|
switch(uDriveType)
|
||||||
case DRIVE_CDROM: {
|
{
|
||||||
|
case DRIVE_CDROM:
|
||||||
|
{
|
||||||
char sz_win32_drive_full[] = "\\\\.\\X:";
|
char sz_win32_drive_full[] = "\\\\.\\X:";
|
||||||
sz_win32_drive_full[4] = c_drive_letter;
|
sz_win32_drive_full[4] = c_drive_letter;
|
||||||
return __strdup(&sz_win32_drive_full[4]);
|
return __strdup(&sz_win32_drive_full[4]);
|
||||||
|
@ -80,14 +54,13 @@ const char *is_cdrom_win32(const char c_drive_letter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a pointer to an array of strings with the device names
|
// Returns a pointer to an array of strings with the device names
|
||||||
std::vector<std::string> cdio_get_devices_win32() {
|
std::vector<std::string> cdio_get_devices() {
|
||||||
std::vector<std::string> drives;
|
std::vector<std::string> drives;
|
||||||
char drive_letter;
|
char drive_letter;
|
||||||
|
|
||||||
// Scan the system for CD-ROM drives.
|
// Scan the system for CD-ROM drives.
|
||||||
// Not always 100% reliable, so use the USE_MNTENT code above first.
|
|
||||||
for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) {
|
for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) {
|
||||||
const char *drive_str=is_cdrom_win32(drive_letter);
|
const char *drive_str=is_cdrom(drive_letter);
|
||||||
if (drive_str != NULL) {
|
if (drive_str != NULL) {
|
||||||
drives.push_back(drive_str);
|
drives.push_back(drive_str);
|
||||||
delete drive_str;
|
delete drive_str;
|
||||||
|
@ -95,15 +68,10 @@ std::vector<std::string> cdio_get_devices_win32() {
|
||||||
}
|
}
|
||||||
return drives;
|
return drives;
|
||||||
}
|
}
|
||||||
#endif // WIN32
|
#elif defined __APPLE__
|
||||||
|
// Returns a pointer to an array of strings with the device names
|
||||||
|
std::vector<std::string> cdio_get_devices()
|
||||||
#ifdef __APPLE__
|
{
|
||||||
|
|
||||||
/*
|
|
||||||
Returns a pointer to an array of strings with the device names
|
|
||||||
*/
|
|
||||||
std::vector<std::string> cdio_get_devices_osx(void) {
|
|
||||||
io_object_t next_media;
|
io_object_t next_media;
|
||||||
mach_port_t master_port;
|
mach_port_t master_port;
|
||||||
kern_return_t kern_result;
|
kern_return_t kern_result;
|
||||||
|
@ -112,14 +80,12 @@ std::vector<std::string> cdio_get_devices_osx(void) {
|
||||||
std::vector<std::string> drives;
|
std::vector<std::string> drives;
|
||||||
|
|
||||||
kern_result = IOMasterPort( MACH_PORT_NULL, &master_port );
|
kern_result = IOMasterPort( MACH_PORT_NULL, &master_port );
|
||||||
if( kern_result != KERN_SUCCESS ) {
|
if( kern_result != KERN_SUCCESS )
|
||||||
return( drives );
|
return( drives );
|
||||||
}
|
|
||||||
|
|
||||||
classes_to_match = IOServiceMatching( kIOCDMediaClass );
|
classes_to_match = IOServiceMatching( kIOCDMediaClass );
|
||||||
if( classes_to_match == NULL ) {
|
if( classes_to_match == NULL )
|
||||||
return( drives );
|
return( drives );
|
||||||
}
|
|
||||||
|
|
||||||
CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaEjectableKey),
|
CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaEjectableKey),
|
||||||
kCFBooleanTrue );
|
kCFBooleanTrue );
|
||||||
|
@ -127,37 +93,40 @@ std::vector<std::string> cdio_get_devices_osx(void) {
|
||||||
kern_result = IOServiceGetMatchingServices( master_port,
|
kern_result = IOServiceGetMatchingServices( master_port,
|
||||||
classes_to_match,
|
classes_to_match,
|
||||||
&media_iterator );
|
&media_iterator );
|
||||||
if( kern_result != KERN_SUCCESS) {
|
if( kern_result != KERN_SUCCESS)
|
||||||
return( drives );
|
return( drives );
|
||||||
}
|
|
||||||
|
|
||||||
next_media = IOIteratorNext( media_iterator );
|
next_media = IOIteratorNext( media_iterator );
|
||||||
if( next_media != 0 ) {
|
if( next_media != 0 )
|
||||||
|
{
|
||||||
char psz_buf[0x32];
|
char psz_buf[0x32];
|
||||||
size_t dev_path_length;
|
size_t dev_path_length;
|
||||||
CFTypeRef str_bsd_path;
|
CFTypeRef str_bsd_path;
|
||||||
|
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
str_bsd_path =
|
str_bsd_path =
|
||||||
IORegistryEntryCreateCFProperty( next_media,
|
IORegistryEntryCreateCFProperty( next_media,
|
||||||
CFSTR( kIOBSDNameKey ),
|
CFSTR( kIOBSDNameKey ),
|
||||||
kCFAllocatorDefault,
|
kCFAllocatorDefault,
|
||||||
0 );
|
0 );
|
||||||
if( str_bsd_path == NULL ) {
|
if( str_bsd_path == NULL )
|
||||||
|
{
|
||||||
IOObjectRelease( next_media );
|
IOObjectRelease( next_media );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Below, by appending 'r' to the BSD node name, we indicate
|
// Below, by appending 'r' to the BSD node name, we indicate
|
||||||
a raw disk. Raw disks receive I/O requests directly and
|
// a raw disk. Raw disks receive I/O requests directly and
|
||||||
don't go through a buffer cache. */
|
// don't go through a buffer cache.
|
||||||
snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' );
|
snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' );
|
||||||
dev_path_length = strlen( psz_buf );
|
dev_path_length = strlen( psz_buf );
|
||||||
|
|
||||||
if( CFStringGetCString( (CFStringRef)str_bsd_path,
|
if( CFStringGetCString( (CFStringRef)str_bsd_path,
|
||||||
(char*)&psz_buf + dev_path_length,
|
(char*)&psz_buf + dev_path_length,
|
||||||
sizeof(psz_buf) - dev_path_length,
|
sizeof(psz_buf) - dev_path_length,
|
||||||
kCFStringEncodingASCII)) {
|
kCFStringEncodingASCII))
|
||||||
|
{
|
||||||
if(psz_buf != NULL)
|
if(psz_buf != NULL)
|
||||||
{
|
{
|
||||||
std::string str = psz_buf;
|
std::string str = psz_buf;
|
||||||
|
@ -172,178 +141,71 @@ std::vector<std::string> cdio_get_devices_osx(void) {
|
||||||
IOObjectRelease( media_iterator );
|
IOObjectRelease( media_iterator );
|
||||||
return drives;
|
return drives;
|
||||||
}
|
}
|
||||||
#endif
|
#elif defined __linux__
|
||||||
|
// checklist: /dev/cdrom, /dev/dvd /dev/hd?, /dev/scd? /dev/sr?
|
||||||
#ifdef __linux__
|
|
||||||
/* checklist: /dev/cdrom, /dev/dvd /dev/hd?, /dev/scd? /dev/sr? */
|
|
||||||
static char checklist1[][40] = {
|
|
||||||
{"cdrom"}, {"dvd"}, {""}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
const char * format;
|
const char * format;
|
||||||
unsigned int num_min;
|
unsigned int num_min;
|
||||||
unsigned int num_max;
|
unsigned int num_max;
|
||||||
} checklist2[] =
|
} checklist[] =
|
||||||
{
|
{
|
||||||
|
{ "/dev/cdrom", 0, 0},
|
||||||
|
{ "/dev/dvd", 0, 0},
|
||||||
{ "/dev/hd%c", 'a', 'z' },
|
{ "/dev/hd%c", 'a', 'z' },
|
||||||
{ "/dev/scd%d", 0, 27 },
|
{ "/dev/scd%d", 0, 27 },
|
||||||
{ "/dev/sr%d", 0, 27 },
|
{ "/dev/sr%d", 0, 27 },
|
||||||
{ /* End of array */ }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Returns true if a device is a block or char device and not a symbolic link
|
||||||
/*
|
bool is_device(const char *source_name)
|
||||||
Returns true if a device is a block or char device
|
{
|
||||||
*/
|
|
||||||
bool cdio_is_device_quiet_generic(const char *source_name) {
|
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if (0 != stat(source_name, &buf)) {
|
if (0 != lstat(source_name, &buf))
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
return (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode));
|
return ((S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode)) && !S_ISLNK(buf.st_mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Check a device to see if it is a DVD/CD-ROM drive
|
||||||
Check a drive to see if it is a CD-ROM
|
static bool is_cdrom(const char *drive, char *mnttype)
|
||||||
Return 1 if a CD-ROM. 0 if it exists but isn't a CD-ROM drive
|
{
|
||||||
and -1 if no device exists .
|
|
||||||
*/
|
|
||||||
static bool is_cdrom_linux(const char *drive, char *mnttype) {
|
|
||||||
bool is_cd=false;
|
bool is_cd=false;
|
||||||
int cdfd;
|
int cdfd;
|
||||||
|
|
||||||
/* If it doesn't exist, return -1 */
|
// Check if the device exists
|
||||||
if ( !cdio_is_device_quiet_generic(drive) ) {
|
if (!is_device(drive))
|
||||||
return(false);
|
return(false);
|
||||||
}
|
|
||||||
|
|
||||||
/* If it does exist, verify that it's an available CD-ROM */
|
// If it does exist, verify that it is a cdrom/dvd drive
|
||||||
cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0);
|
cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0);
|
||||||
if ( cdfd >= 0 ) {
|
if ( cdfd >= 0 )
|
||||||
if ( ioctl(cdfd, CDROM_GET_CAPABILITY, 0) != -1 ) {
|
{
|
||||||
|
if (ioctl(cdfd, CDROM_GET_CAPABILITY, 0) != -1)
|
||||||
is_cd = true;
|
is_cd = true;
|
||||||
}
|
|
||||||
close(cdfd);
|
close(cdfd);
|
||||||
}
|
|
||||||
/* Even if we can't read it, it might be mounted */
|
|
||||||
else if ( mnttype && (strcmp(mnttype, "iso9660") == 0) ) {
|
|
||||||
is_cd = true;
|
|
||||||
}
|
}
|
||||||
return(is_cd);
|
return(is_cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
Recive an mtab formated file and returns path to cdrom device
|
|
||||||
*/
|
|
||||||
static char *check_mounts_linux(const char *mtab)
|
|
||||||
{
|
|
||||||
FILE *mntfp;
|
|
||||||
struct mntent *mntent;
|
|
||||||
|
|
||||||
mntfp = setmntent(mtab, "r");
|
|
||||||
if ( mntfp != NULL ) {
|
|
||||||
char *tmp;
|
|
||||||
char *mnt_type;
|
|
||||||
char *mnt_dev;
|
|
||||||
unsigned int i_mnt_type;
|
|
||||||
unsigned int i_mnt_dev;
|
|
||||||
|
|
||||||
while ( (mntent=getmntent(mntfp)) != NULL ) {
|
|
||||||
i_mnt_type = strlen(mntent->mnt_type) + 1;
|
|
||||||
mnt_type = (char *)calloc(1, i_mnt_type);
|
|
||||||
if (mnt_type == NULL)
|
|
||||||
continue; /* maybe you'll get lucky next time. */
|
|
||||||
|
|
||||||
i_mnt_dev = strlen(mntent->mnt_fsname) + 1;
|
|
||||||
mnt_dev = (char *)calloc(1, i_mnt_dev);
|
|
||||||
if (mnt_dev == NULL) {
|
|
||||||
free(mnt_type);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
strncpy(mnt_type, mntent->mnt_type, i_mnt_type);
|
|
||||||
strncpy(mnt_dev, mntent->mnt_fsname, i_mnt_dev);
|
|
||||||
|
|
||||||
/* Handle "supermount" filesystem mounts */
|
|
||||||
if ( strcmp(mnt_type, "supermount") == 0 ) {
|
|
||||||
tmp = strstr(mntent->mnt_opts, "fs=");
|
|
||||||
if ( tmp ) {
|
|
||||||
free(mnt_type);
|
|
||||||
mnt_type = __strdup(tmp + strlen("fs="));
|
|
||||||
if ( mnt_type ) {
|
|
||||||
tmp = strchr(mnt_type, ',');
|
|
||||||
if ( tmp ) {
|
|
||||||
*tmp = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tmp = strstr(mntent->mnt_opts, "dev=");
|
|
||||||
if ( tmp ) {
|
|
||||||
free(mnt_dev);
|
|
||||||
mnt_dev = __strdup(tmp + strlen("dev="));
|
|
||||||
if ( mnt_dev ) {
|
|
||||||
tmp = strchr(mnt_dev, ',');
|
|
||||||
if ( tmp ) {
|
|
||||||
*tmp = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( strcmp(mnt_type, "iso9660") == 0 ) {
|
|
||||||
if (is_cdrom_linux(mnt_dev, mnt_type) > 0) {
|
|
||||||
free(mnt_type);
|
|
||||||
endmntent(mntfp);
|
|
||||||
return mnt_dev;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free(mnt_dev);
|
|
||||||
free(mnt_type);
|
|
||||||
}
|
|
||||||
endmntent(mntfp);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns a pointer to an array of strings with the device names
|
// Returns a pointer to an array of strings with the device names
|
||||||
std::vector<std::string> cdio_get_devices_linux () {
|
std::vector<std::string> cdio_get_devices ()
|
||||||
|
{
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
char drive[40];
|
char drive[40];
|
||||||
char *ret_drive;
|
|
||||||
std::vector<std::string> drives;
|
std::vector<std::string> drives;
|
||||||
|
|
||||||
// Scan the system for CD-ROM drives.
|
// Scan the system for DVD/CD-ROM drives.
|
||||||
for ( i=0; strlen(checklist1[i]) > 0; ++i ) {
|
for ( i=0; checklist[i].format; ++i )
|
||||||
sprintf(drive, "/dev/%s", checklist1[i]);
|
{
|
||||||
if ( is_cdrom_linux(drive, NULL) > 0 ) {
|
|
||||||
std::string str = drive;
|
|
||||||
drives.push_back(str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now check the currently mounted CD drives */
|
|
||||||
if (NULL != (ret_drive = check_mounts_linux("/etc/mtab"))) {
|
|
||||||
std::string str = ret_drive;
|
|
||||||
drives.push_back(str);
|
|
||||||
free(ret_drive);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Finally check possible mountable drives in /etc/fstab */
|
|
||||||
if (NULL != (ret_drive = check_mounts_linux("/etc/fstab"))) {
|
|
||||||
std::string str = ret_drive;
|
|
||||||
drives.push_back(str);
|
|
||||||
free(ret_drive);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scan the system for CD-ROM drives.
|
|
||||||
// Not always 100% reliable, so use the USE_MNTENT code above first.
|
|
||||||
for ( i=0; checklist2[i].format; ++i ) {
|
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
for ( j=checklist2[i].num_min; j<=checklist2[i].num_max; ++j ) {
|
for ( j=checklist[i].num_min; j<=checklist[i].num_max; ++j )
|
||||||
sprintf(drive, checklist2[i].format, j);
|
{
|
||||||
if ( (is_cdrom_linux(drive, NULL)) > 0 ) {
|
sprintf(drive, checklist[i].format, j);
|
||||||
|
if ( (is_cdrom(drive, NULL)) > 0 )
|
||||||
|
{
|
||||||
std::string str = drive;
|
std::string str = drive;
|
||||||
drives.push_back(str);
|
drives.push_back(str);
|
||||||
}
|
}
|
||||||
|
@ -353,47 +215,38 @@ std::vector<std::string> cdio_get_devices_linux () {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Returns a pointer to an array of strings with the device names
|
// Returns true if device is a cdrom/dvd drive
|
||||||
std::vector<std::string> cdio_get_devices() {
|
bool cdio_is_cdrom(std::string device)
|
||||||
#ifdef _WIN32
|
{
|
||||||
return cdio_get_devices_win32();
|
#ifdef __linux__
|
||||||
#elif __APPLE__
|
// Resolve symbolic links. This allows symbolic links to valid cdrom/dvd drives to
|
||||||
return cdio_get_devices_osx();
|
// be passed from the command line with the -e flag.
|
||||||
#elif __linux__
|
char *devname = realpath(device.c_str(), NULL);
|
||||||
return cdio_get_devices_linux();
|
if (!devname)
|
||||||
#else
|
return false;
|
||||||
#warning CDIO not supported on your platform!
|
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
// Need to be tested, does calling this function twice cause any damage?
|
|
||||||
|
|
||||||
// Returns true if device is cdrom/dvd
|
|
||||||
|
|
||||||
bool cdio_is_cdrom(std::string device) {
|
|
||||||
std::vector<std::string> devices = cdio_get_devices();
|
std::vector<std::string> devices = cdio_get_devices();
|
||||||
bool res = false;
|
bool res = false;
|
||||||
for (unsigned int i = 0; i < devices.size(); i++) {
|
for (unsigned int i = 0; i < devices.size(); i++)
|
||||||
if (strncmp(devices[i].c_str(), device.c_str(), PATH_MAX) == 0) {
|
{
|
||||||
|
#ifdef __linux__
|
||||||
|
if (strncmp(devices[i].c_str(), devname, PATH_MAX) == 0)
|
||||||
|
#else
|
||||||
|
if (strncmp(devices[i].c_str(), device.c_str(), PATH_MAX) == 0)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
if (devname)
|
||||||
|
free(devname);
|
||||||
|
#endif
|
||||||
|
|
||||||
devices.clear();
|
devices.clear();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Can we remove this?
|
|
||||||
/*
|
|
||||||
int main() {
|
|
||||||
char** res = cdio_get_devices();
|
|
||||||
int i = 0;
|
|
||||||
for (i = 0; res[i] != NULL; i++) {
|
|
||||||
printf("%s\n", res[i]);
|
|
||||||
}
|
|
||||||
cdio_free_device_list(res);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||||
// that gave an incorrect file name
|
// that gave an incorrect file name
|
||||||
if (!bootDrive && !File::Exists(m_strFilename.c_str()))
|
if (!bootDrive && !File::Exists(m_strFilename.c_str()))
|
||||||
{
|
{
|
||||||
PanicAlert("The file you specified (%s) does not exists", m_strFilename.c_str());
|
PanicAlert("The specified file \"%s\" does not exist", m_strFilename.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,9 +136,10 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||||
if (pVolume == NULL)
|
if (pVolume == NULL)
|
||||||
{
|
{
|
||||||
PanicAlert(bootDrive ?
|
PanicAlert(bootDrive ?
|
||||||
"Disc in %s could not be read - no disc, or not a GC/Wii backup.\n"
|
"Could not read \"%s\". There is no disc in the drive, or it is not a GC/Wii backup. "
|
||||||
"Please note that original Gamecube and Wii discs cannot be read by most PC DVD drives.":
|
"Please note that original Gamecube and Wii discs cannot be read by most PC DVD drives." :
|
||||||
"Your GCM/ISO file seems to be invalid, or not a GC/Wii ISO.", m_strFilename.c_str());
|
"\"%s\" is an invalid GCM/ISO file, or is not a GC/Wii ISO."
|
||||||
|
, m_strFilename.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_strName = pVolume->GetName();
|
m_strName = pVolume->GetName();
|
||||||
|
|
|
@ -63,9 +63,7 @@ DriveReader::DriveReader(const char *drive)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
NOTICE_LOG(DISCIO, "Load from DVD backup failed or no disc in drive %s", drive);
|
||||||
PanicAlert("Load from DVD backup failed or no disc in drive %s", drive);
|
|
||||||
}
|
|
||||||
} // DriveReader::DriveReader
|
} // DriveReader::DriveReader
|
||||||
|
|
||||||
DriveReader::~DriveReader()
|
DriveReader::~DriveReader()
|
||||||
|
|
|
@ -498,6 +498,8 @@ CFrame::CFrame(wxFrame* parent,
|
||||||
m_bControlsCreated = true;
|
m_bControlsCreated = true;
|
||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
|
|
||||||
|
if (m_GameListCtrl) m_GameListCtrl->Update();
|
||||||
|
|
||||||
// If we are rerecording create the status bar now instead of later when a game starts
|
// If we are rerecording create the status bar now instead of later when a game starts
|
||||||
#ifdef RERECORDING
|
#ifdef RERECORDING
|
||||||
ModifyStatusBar();
|
ModifyStatusBar();
|
||||||
|
|
|
@ -48,10 +48,6 @@
|
||||||
|
|
||||||
IMPLEMENT_APP(DolphinApp)
|
IMPLEMENT_APP(DolphinApp)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(DolphinApp, wxApp)
|
|
||||||
EVT_TIMER(wxID_ANY, DolphinApp::AfterInit)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
bool wxMsgAlert(const char*, const char*, bool, int);
|
bool wxMsgAlert(const char*, const char*, bool, int);
|
||||||
|
|
||||||
|
@ -423,20 +419,9 @@ bool DolphinApp::OnInit()
|
||||||
XInitThreads();
|
XInitThreads();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Postpone final actions until event handler is running
|
|
||||||
m_afterinit = new wxTimer(this, wxID_ANY);
|
|
||||||
m_afterinit->Start(1, wxTIMER_ONE_SHOT);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event))
|
|
||||||
{
|
|
||||||
delete m_afterinit;
|
|
||||||
|
|
||||||
main_frame->UpdateGameList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DolphinApp::OnEndSession()
|
void DolphinApp::OnEndSession()
|
||||||
{
|
{
|
||||||
SConfig::GetInstance().SaveSettings();
|
SConfig::GetInstance().SaveSettings();
|
||||||
|
|
|
@ -29,13 +29,6 @@ public:
|
||||||
void OnEndSession();
|
void OnEndSession();
|
||||||
int OnExit();
|
int OnExit();
|
||||||
CFrame* GetCFrame();
|
CFrame* GetCFrame();
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxTimer *m_afterinit;
|
|
||||||
|
|
||||||
void AfterInit(wxTimerEvent& WXUNUSED(event));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_APP(DolphinApp);
|
DECLARE_APP(DolphinApp);
|
||||||
|
|
Loading…
Reference in New Issue