Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime and compiletime option to disable version checks in gui (… #7650

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions src/libslic3r/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 8 additions & 5 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/Utils/PresetUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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())
Expand Down