| 394 | } |
| 395 | |
| 396 | void UserPrefsEditor::Save() |
| 397 | { |
| 398 | //make a copy |
| 399 | ofxJSONElement prefsFile = UserPrefs.mUserPrefsFile; |
| 400 | |
| 401 | //remove legacy prefs |
| 402 | prefsFile.removeMember("vstsearchdirs"); |
| 403 | prefsFile.removeMember("youtube-dl_path"); |
| 404 | |
| 405 | for (int i = 0; i < (int)UserPrefs.mUserPrefs.size(); ++i) |
| 406 | UserPrefs.mUserPrefs[i]->Save(i, prefsFile); |
| 407 | |
| 408 | std::string output = prefsFile.getRawString(true); |
| 409 | CleanUpSave(output); |
| 410 | |
| 411 | juce::File file(TheSynth->GetUserPrefsPath()); |
| 412 | file.create(); |
| 413 | file.replaceWithText(output); |
| 414 | |
| 415 | if (TheSynth->HasFatalError()) //this popup spawned at load due to a bad init setting. in this case, the button says "save and exit" |
| 416 | juce::JUCEApplicationBase::quit(); |
| 417 | } |
| 418 | |
| 419 | void UserPrefsEditor::ButtonClicked(ClickButton* button, double time) |
| 420 | { |
nothing calls this directly
no test coverage detected