GUI: prepare to add auto-fill on save

This commit is contained in:
tildearrow 2024-05-24 00:19:03 -05:00
parent 56f8d15d66
commit 3f34a46575
3 changed files with 17 additions and 1 deletions

View file

@ -1649,7 +1649,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
"Open File", "Open File",
{"compatible files", "*.fur *.dmf *.mod *.fc13 *.fc14 *.smod *.fc *.ftm *.0cc *.dnm *.eft *.fub *.tfe", {"compatible files", "*.fur *.dmf *.mod *.fc13 *.fc14 *.smod *.fc *.ftm *.0cc *.dnm *.eft *.fub *.tfe",
"all files", "*"}, "all files", "*"},
workingDirSong, workingDirSong+"/CRAP",
dpiScale dpiScale
); );
break; break;

View file

@ -1932,6 +1932,7 @@ class FurnaceGUI {
int backupEnable; int backupEnable;
int backupInterval; int backupInterval;
int backupMaxCopies; int backupMaxCopies;
int autoFillSave;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
float vibrationStrength; float vibrationStrength;
int vibrationLength; int vibrationLength;
@ -2186,6 +2187,7 @@ class FurnaceGUI {
backupEnable(1), backupEnable(1),
backupInterval(30), backupInterval(30),
backupMaxCopies(5), backupMaxCopies(5),
autoFillSave(0),
maxUndoSteps(100), maxUndoSteps(100),
vibrationStrength(0.5f), vibrationStrength(0.5f),
vibrationLength(20), vibrationLength(20),

View file

@ -908,6 +908,15 @@ void FurnaceGUI::drawSettings() {
ImGui::SetTooltip("when enabled, loading an instrument will use the stored name (if present).\notherwise, it will use the file name."); ImGui::SetTooltip("when enabled, loading an instrument will use the stored name (if present).\notherwise, it will use the file name.");
} }
bool autoFillSaveB=settings.autoFillSave;
if (ImGui::Checkbox("Auto-fill file name when saving",&autoFillSaveB)) {
settings.autoFillSave=autoFillSaveB;
settingsChanged=true;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("fill the file name field with an appropriate file name when saving or exporting.");
}
// SUBSECTION NEW SONG // SUBSECTION NEW SONG
CONFIG_SUBSECTION("New Song"); CONFIG_SUBSECTION("New Song");
ImGui::AlignTextToFramePadding(); ImGui::AlignTextToFramePadding();
@ -4653,6 +4662,8 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.backupEnable=conf.getInt("backupEnable",1); settings.backupEnable=conf.getInt("backupEnable",1);
settings.backupInterval=conf.getInt("backupInterval",30); settings.backupInterval=conf.getInt("backupInterval",30);
settings.backupMaxCopies=conf.getInt("backupMaxCopies",5); settings.backupMaxCopies=conf.getInt("backupMaxCopies",5);
settings.autoFillSave=conf.getInt("autoFillSave",0);
} }
if (groups&GUI_SETTINGS_AUDIO) { if (groups&GUI_SETTINGS_AUDIO) {
@ -5155,6 +5166,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
clampSetting(settings.backupEnable,0,1); clampSetting(settings.backupEnable,0,1);
clampSetting(settings.backupInterval,10,86400); clampSetting(settings.backupInterval,10,86400);
clampSetting(settings.backupMaxCopies,1,100); clampSetting(settings.backupMaxCopies,1,100);
clampSetting(settings.autoFillSave,0,1);
if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportLoops<0.0) settings.exportLoops=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
@ -5232,6 +5244,8 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("backupEnable",settings.backupEnable); conf.set("backupEnable",settings.backupEnable);
conf.set("backupInterval",settings.backupInterval); conf.set("backupInterval",settings.backupInterval);
conf.set("backupMaxCopies",settings.backupMaxCopies); conf.set("backupMaxCopies",settings.backupMaxCopies);
conf.set("autoFillSave",settings.autoFillSave);
} }
// audio // audio