diff --git a/CMakeLists.txt b/CMakeLists.txt index 197694e020..bab0c7160c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,13 @@ endif () option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF) option(SLIC3R_BUILD_TESTS "Build unit tests" OFF) option(ORCA_TOOLS "Build Orca tools" OFF) +option(ORCA_VERSION_CHECK_DEFAULT "Whether to check for new versions on startup by default" ON) + +if (ORCA_VERSION_CHECK_DEFAULT) + add_definitions(-DORCA_VERSION_CHECK_DEFAULT=true) +else () + add_definitions(-DORCA_VERSION_CHECK_DEFAULT=false) +endif () if (IS_CROSS_COMPILE) message("Detected cross compilation setup. Tests and encoding checks will be forcedly disabled!") diff --git a/README.md b/README.md index 88f587db95..5a592501d4 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,10 @@ If you're running Klipper, it's recommended to add the following configuration t resolution: 0.1 ``` +# Note if building for a package manager + +If you're building this as a package for a package manager (`apt`, `brew`, `pacman`, `nix`, `chocolatey`, etc.) where the user is not going to be manually updating the software, you should disable the version check with `-DORCA_VERSION_CHECK_DEFAULT=OFF` flag to cmake + # Supports **Orca Slicer** is an open-source project, and I'm deeply grateful to all my sponsors and backers. Their generous support enables me to purchase filaments and other essential 3D printing materials for the project. diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 0decfaac12..11d7d4f31a 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -406,6 +406,12 @@ void AppConfig::set_defaults() if (get("print", "timelapse").empty()) { set_str("print", "timelapse", "1"); } + if (get("do_version_check").empty()) { +#ifndef ORCA_VERSION_CHECK_DEFAULT +#define ORCA_VERSION_CHECK_DEFAULT true +#endif + set_bool("do_version_check", ORCA_VERSION_CHECK_DEFAULT); + } // Remove legacy window positions/sizes erase("app", "main_frame_maximized"); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 72eed3e7c1..e290d9f4a1 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -971,7 +971,10 @@ void GUI_App::post_init() bool sys_preset = app_config->get("sync_system_preset") == "true"; this->preset_updater->sync(http_url, language, network_ver, sys_preset ? preset_bundle : nullptr); - this->check_new_version_sf(); + if (this->preset_updater->version_check_enabled()) { + this->check_new_version_sf(); + } + if (is_user_login() && !app_config->get_stealth_mode()) { // this->check_privacy_version(0); request_user_handle(0); @@ -1964,14 +1967,14 @@ void GUI_App::init_app_config() #endif //BBS: remove GCodeViewer as seperate APP logic - if (!app_config) + if (!app_config) app_config = new AppConfig(); //app_config = new AppConfig(is_editor() ? AppConfig::EAppMode::Editor : AppConfig::EAppMode::GCodeViewer); m_config_corrupted = false; - // load settings - m_app_conf_exists = app_config->exists(); - if (m_app_conf_exists) { + // load settings + m_app_conf_exists = app_config->exists(); + if (m_app_conf_exists) { std::string error = app_config->load(); if (!error.empty()) { // Orca: if the config file is corrupted, we will show a error dialog and create a default config file. diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index cdd91eb22e..60de482484 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -242,7 +242,6 @@ PresetUpdater::priv::priv() , cancel(false) { //BBS: refine preset updater logic - enabled_version_check = true; set_download_prefs(GUI::wxGetApp().app_config); // Install indicies from resources. Only installs those that are either missing or older than in resources. check_installed_vendor_profiles(); @@ -255,6 +254,7 @@ PresetUpdater::priv::priv() void PresetUpdater::priv::set_download_prefs(AppConfig *app_config) { version_check_url = app_config->version_check_url(); + enabled_version_check = app_config->get_bool("do_version_check"); auto profile_update_url = app_config->profile_update_url(); if (!profile_update_url.empty())