Added suggested file names to AVI/WAV Record As file dialogs.

This commit is contained in:
mjbudd77 2021-10-01 16:39:13 -04:00
parent 7717e699cd
commit df56e32027
1 changed files with 28 additions and 2 deletions

View File

@ -3630,7 +3630,7 @@ void consoleWin_t::aviRecordAsStart(void)
QString filename;
std::string lastPath;
//char dir[512];
const char *base;
const char *base, *rom;
QFileDialog dialog(this, tr("Save AVI Movie for Recording") );
QList<QUrl> urls;
QDir d;
@ -3670,6 +3670,19 @@ void consoleWin_t::aviRecordAsStart(void)
dialog.setDirectory( QString::fromStdString(lastPath) );
}
rom = getRomFile();
if ( rom )
{
char baseName[512];
getFileBaseName( rom, baseName );
if ( baseName[0] != 0 )
{
dialog.selectFile(baseName);
}
}
// Check config option to use native file dialog or not
g_config->getOption ("SDL.UseNativeFileDialog", &useNativeFileDialogVal);
@ -3877,7 +3890,7 @@ void consoleWin_t::wavRecordAsStart(void)
QString filename;
std::string lastPath;
//char dir[512];
const char *base;
const char *base, *rom;
QFileDialog dialog(this, tr("Save WAV Movie for Recording") );
QList<QUrl> urls;
QDir d;
@ -3917,6 +3930,19 @@ void consoleWin_t::wavRecordAsStart(void)
dialog.setDirectory( QString::fromStdString(lastPath) );
}
rom = getRomFile();
if ( rom )
{
char baseName[512];
getFileBaseName( rom, baseName );
if ( baseName[0] != 0 )
{
dialog.selectFile(baseName);
}
}
// Check config option to use native file dialog or not
g_config->getOption ("SDL.UseNativeFileDialog", &useNativeFileDialogVal);