diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index c7e3ac8d3..e3b3fac1f 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1642,6 +1642,18 @@ bool dirExists(String s) { void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { bool hasOpened=false; + + String shortName; + size_t shortNamePos=curFileName.rfind(DIR_SEPARATOR); + if (shortNamePos!=String::npos && (shortNamePos+1)getIns(curIns)->name:"" ); break; case GUI_FILE_WAVE_OPEN: @@ -1838,7 +1853,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Save Sample", {"Wave file", "*.wav"}, workingDirSample, - dpiScale + dpiScale, + (settings.autoFillSave)?e->getSample(curSample)->name:"" ); break; case GUI_FILE_SAMPLE_SAVE_RAW: @@ -1847,7 +1863,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Save Raw Sample", {"all files", "*"}, workingDirSample, - dpiScale + dpiScale, + (settings.autoFillSave)?e->getSample(curSample)->name:"" ); break; case GUI_FILE_EXPORT_AUDIO_ONE: @@ -1856,7 +1873,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Export Audio", {"Wave file", "*.wav"}, workingDirAudioExport, - dpiScale + dpiScale, + (settings.autoFillSave)?shortName:"" ); break; case GUI_FILE_EXPORT_AUDIO_PER_SYS: @@ -1865,7 +1883,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Export Audio", {"Wave file", "*.wav"}, workingDirAudioExport, - dpiScale + dpiScale, + (settings.autoFillSave)?shortName:"" ); break; case GUI_FILE_EXPORT_AUDIO_PER_CHANNEL: @@ -1874,7 +1893,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Export Audio", {"Wave file", "*.wav"}, workingDirAudioExport, - dpiScale + dpiScale, + (settings.autoFillSave)?shortName:"" ); break; case GUI_FILE_EXPORT_VGM: @@ -1883,7 +1903,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Export VGM", {"VGM file", "*.vgm"}, workingDirVGMExport, - dpiScale + dpiScale, + (settings.autoFillSave)?shortName:"" ); break; case GUI_FILE_EXPORT_ZSM: @@ -1892,7 +1913,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Export ZSM", {"ZSM file", "*.zsm"}, workingDirZSMExport, - dpiScale + dpiScale, + (settings.autoFillSave)?shortName:"" ); break; case GUI_FILE_EXPORT_TEXT: @@ -1901,7 +1923,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Export Command Stream", {"text file", "*.txt"}, workingDirROMExport, - dpiScale + dpiScale, + (settings.autoFillSave)?shortName:"" ); break; case GUI_FILE_EXPORT_CMDSTREAM: @@ -1910,7 +1933,8 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { "Export Command Stream", {"binary file", "*.bin"}, workingDirROMExport, - dpiScale + dpiScale, + (settings.autoFillSave)?shortName:"" ); break; case GUI_FILE_EXPORT_ROM: