ENH: some improvements and fixs

1. create user folder if not exists
2. add a tips for binding a printer
3. fix sdcard tips
4. modify icons
5. refine layout of task options

Change-Id: Ic0529cf1e8bdde0128052bc42454f6e6aaae87ca
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2022-10-18 16:47:42 +08:00 committed by Lane.Wei
parent 13b5e589cb
commit f968374b46
8 changed files with 41 additions and 13 deletions

View file

@ -252,6 +252,10 @@ PresetsConfigSubstitutions PresetBundle::load_presets(AppConfig &config, Forward
else {
dir_user_presets = data_dir() + "/" + PRESET_USER_DIR + "/default";
}
fs::path user_folder(data_dir() + "/" + PRESET_USER_DIR);
if (!fs::exists(user_folder))
fs::create_directory(user_folder);
fs::path folder(dir_user_presets);
if (!fs::exists(folder))
fs::create_directory(folder);
@ -700,6 +704,11 @@ void PresetBundle::save_user_presets(AppConfig& config, std::vector<std::string>
const std::string dir_user_presets = data_dir() + "/" + PRESET_USER_DIR + "/"+ config.get("preset_folder");
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" enter, save to %1%")%dir_user_presets;
fs::path user_folder(data_dir() + "/" + PRESET_USER_DIR);
if (!fs::exists(user_folder))
fs::create_directory(user_folder);
fs::path folder(dir_user_presets);
if (!fs::exists(folder))
fs::create_directory(folder);