mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
NEW:add the download path edit in the preferences
Change-Id: I8dfd3373a25bdd9d70360b61605d92f20052d478
This commit is contained in:
parent
79480405a0
commit
b5979375b4
5 changed files with 88 additions and 3 deletions
|
@ -1174,6 +1174,7 @@ GUI_App::GUI_App()
|
|||
{
|
||||
//app config initializes early becasuse it is used in instance checking in BambuStudio.cpp
|
||||
this->init_app_config();
|
||||
this->init_download_path();
|
||||
|
||||
reset_to_active();
|
||||
}
|
||||
|
@ -1764,6 +1765,26 @@ static boost::optional<Semver> parse_semver_from_ini(std::string path)
|
|||
return Semver::parse(body);
|
||||
}
|
||||
|
||||
void GUI_App::init_download_path()
|
||||
{
|
||||
std::string down_path = app_config->get("download_path");
|
||||
|
||||
if (down_path.empty()) {
|
||||
std::string user_down_path = wxStandardPaths::Get().GetUserDir(wxStandardPaths::Dir_Downloads).ToUTF8().data();
|
||||
app_config->set("download_path", user_down_path);
|
||||
}
|
||||
else {
|
||||
fs::path dp(down_path);
|
||||
if (!fs::exists(dp)) {
|
||||
|
||||
if (!fs::create_directory(dp)) {
|
||||
std::string user_down_path = wxStandardPaths::Get().GetUserDir(wxStandardPaths::Dir_Downloads).ToUTF8().data();
|
||||
app_config->set("download_path", user_down_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GUI_App::init_app_config()
|
||||
{
|
||||
// Profiles for the alpha are stored into the PrusaSlicer-alpha directory to not mix with the current release.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue