ENH: adjust user preset handling

1. async fetch user presets from server (in thread)
2. always load default user presets
3. load user presets from cache immediately
4. not remove user presets cache
5. hide some loading ui

Change-Id: I1d29ed18e09606d0b2f69a69eea2eb5042c26223
This commit is contained in:
chunmao.guo 2023-01-06 11:36:55 +08:00 committed by Lane.Wei
parent dbb5ec9115
commit a4cf284c3d
7 changed files with 99 additions and 68 deletions

View file

@ -47,6 +47,7 @@ public:
void load_selections(AppConfig &config, const PresetPreferences& preferred_selection = PresetPreferences());
// BBS Load user presets
PresetsConfigSubstitutions load_user_presets(std::string user, ForwardCompatibilitySubstitutionRule rule);
PresetsConfigSubstitutions load_user_presets(AppConfig &config, std::map<std::string, std::map<std::string, std::string>>& my_presets, ForwardCompatibilitySubstitutionRule rule);
PresetsConfigSubstitutions import_presets(std::vector<std::string> &files, std::function<int(std::string const &)> override_confirm, ForwardCompatibilitySubstitutionRule rule);
void save_user_presets(AppConfig& config, std::vector<std::string>& need_to_delete_list);