For Qt GUI, added feature that allows save state files to be loaded via window drag n drop from a file dialog.
This commit is contained in:
parent
46654ed585
commit
b6a8b46de0
|
@ -786,9 +786,21 @@ void consoleWin_t::dropEvent(QDropEvent *event)
|
|||
QFileInfo fi( filename );
|
||||
QString suffix = fi.suffix();
|
||||
|
||||
bool isStateSaveFile = (suffix.size() == 3) &&
|
||||
(suffix[0] == 'f') && (suffix[1] == 'c') &&
|
||||
( (suffix[2] == 's') || suffix[2].isDigit() );
|
||||
|
||||
//printf("DragNDrop Suffix: %s\n", suffix.toStdString().c_str() );
|
||||
|
||||
if ( suffix.compare("lua", Qt::CaseInsensitive) == 0 )
|
||||
if (isStateSaveFile)
|
||||
{
|
||||
FCEU_WRAPPER_LOCK();
|
||||
FCEUI_LoadState( filename.toStdString().c_str() );
|
||||
FCEU_WRAPPER_UNLOCK();
|
||||
|
||||
event->accept();
|
||||
}
|
||||
else if ( suffix.compare("lua", Qt::CaseInsensitive) == 0 )
|
||||
{
|
||||
int luaLoadSuccess;
|
||||
|
||||
|
|
Loading…
Reference in New Issue