| 195 | } |
| 196 | |
| 197 | void MainProgram::save_config() { |
| 198 | using json = nlohmann::json; |
| 199 | json j; |
| 200 | |
| 201 | j["version"] = VersionConstants::CURRENT_VERSION_STRING; |
| 202 | j["settings"] = conf.get_config_json(input); |
| 203 | j["window"]["pos"] = window.writtenPos; |
| 204 | j["window"]["size"] = window.writtenSize; |
| 205 | j["window"]["maximized"] = window.maximized; |
| 206 | j["window"]["fullscreen"] = window.fullscreen; |
| 207 | j["fileselectorpath"] = conf.currentSearchPath; |
| 208 | j["toolConfig"] = toolConfig; |
| 209 | |
| 210 | std::stringstream f; |
| 211 | f << std::setw(4) << j; |
| 212 | SDL_SaveFile((conf.configPath / "config.json").string().c_str(), f.view().data(), f.view().size()); |
| 213 | |
| 214 | conf.save_palettes(); |
| 215 | } |
| 216 | |
| 217 | void MainProgram::load_config() { |
| 218 | conf.currentSearchPath = homePath; |
no test coverage detected