now automounts the newly created image

This commit is contained in:
penfold42 2018-07-20 14:10:38 +10:00
parent 876f417edd
commit d8135fbf1e
3 changed files with 10 additions and 15 deletions

View file

@ -902,7 +902,7 @@ void FileBrowser::UpdateInputFolders()
char newFileName[64]; char newFileName[64];
strncpy (newFileName, options.GetAutoBaseName(), 63); strncpy (newFileName, options.GetAutoBaseName(), 63);
int num = folder.FindNextAutoName( newFileName ); int num = folder.FindNextAutoName( newFileName );
m_IEC_Commands.CreateD64(newFileName, "42"); m_IEC_Commands.CreateD64(newFileName, "42", true);
FolderChanged(); FolderChanged();
} }
else else

View file

@ -1103,23 +1103,12 @@ void IEC_Commands::New(void)
if(!(strstr(filenameNew, ".d64") || strstr(filenameNew, ".D64"))) if(!(strstr(filenameNew, ".d64") || strstr(filenameNew, ".D64")))
strcat(filenameNew, ".d64"); strcat(filenameNew, ".d64");
int ret = CreateD64(filenameNew, ID); int ret = CreateD64(filenameNew, ID, true);
if (ret==0) if (ret==0)
{
updateAction = REFRESH; updateAction = REFRESH;
// Mount the new disk? Shoud we do this or let them do it manually?
if (f_stat(filenameNew, &filInfo) == FR_OK)
{
DIR dir;
Enter(dir, filInfo);
}
}
else else
{
Error(ret); Error(ret);
}
} }
} }
@ -1884,7 +1873,7 @@ void IEC_Commands::CloseFile(u8 secondary)
channel.Close(); channel.Close();
} }
int IEC_Commands::CreateD64(char* filenameNew, char* ID) int IEC_Commands::CreateD64(char* filenameNew, char* ID, bool automount)
{ {
FILINFO filInfo; FILINFO filInfo;
FRESULT res; FRESULT res;
@ -1941,6 +1930,12 @@ int IEC_Commands::CreateD64(char* filenameNew, char* ID)
} }
f_close(&fpOut); f_close(&fpOut);
} }
// Mount the new disk? Shoud we do this or let them do it manually?
if (automount && f_stat(filenameNew, &filInfo) == FR_OK)
{
DIR dir;
Enter(dir, filInfo);
}
return(ERROR_00_OK); return(ERROR_00_OK);
} }
else else

View file

@ -79,7 +79,7 @@ public:
const FILINFO* GetImageSelected() const { return &filInfoSelectedImage; } const FILINFO* GetImageSelected() const { return &filInfoSelectedImage; }
void SetStarFileName(const char* fileName) { starFileName = fileName; } void SetStarFileName(const char* fileName) { starFileName = fileName; }
int CreateD64(char* filenameNew, char* ID); int CreateD64(char* filenameNew, char* ID, bool automount);
protected: protected:
enum ATNSequence enum ATNSequence