diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9bf7bc9..3fb8b9d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,6 +6,9 @@ if (APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "" FORCE) endif() +OPTION (ENABLE_CHECK_VERSION "Check for version updates" ON) +OPTION (ENABLE_TELEMETRY "Enable sending telemetry" ON) + project(rpi-imager LANGUAGES CXX C) set(IMAGER_VERSION_MAJOR 1) set(IMAGER_VERSION_MINOR 7) @@ -107,6 +110,18 @@ else() message(STATUS "LTO not supported: <${ipoerror}>") endif() +if(ENABLE_TELEMETRY) + add_definitions(-DTELEMETRY_ENABLED_DEFAULT=true) +else() + add_definitions(-DTELEMETRY_ENABLED_DEFAULT=false) +endif() + +if(ENABLE_CHECK_VERSION) + add_definitions(-DCHECK_VERSION_DEFAULT=true) +else() + add_definitions(-DCHECK_VERSION_DEFAULT=false) +endif() + # Because dependencies are typically not available by default on Windows, build bundled code if (WIN32) # Target Windows 7 (needed for drivelist module) diff --git a/src/config.h b/src/config.h index 75a4110..7262339 100644 --- a/src/config.h +++ b/src/config.h @@ -15,7 +15,6 @@ /* Phone home the name of images downloaded for image popularity ranking */ #define TELEMETRY_URL "https://rpi-imager-stats.raspberrypi.com/downloads" -#define TELEMETRY_ENABLED_DEFAULT true /* Hash algorithm for verifying (uncompressed image) checksum */ #define OSLIST_HASH_ALGORITHM QCryptographicHash::Sha256 diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp index 6260f17..a73027a 100644 --- a/src/imagewriter.cpp +++ b/src/imagewriter.cpp @@ -1006,6 +1006,8 @@ bool ImageWriter::getBoolSetting(const QString &key) return _settings.value(key, TELEMETRY_ENABLED_DEFAULT).toBool(); else if (key == "eject") return _settings.value(key, true).toBool(); + else if (key == "check_version") + return _settings.value(key, CHECK_VERSION_DEFAULT).toBool(); else return _settings.value(key).toBool(); } diff --git a/src/main.qml b/src/main.qml index b4bc899..b9f605c 100644 --- a/src/main.qml +++ b/src/main.qml @@ -1143,7 +1143,7 @@ ApplicationWindow { if ("imager" in o) { var imager = o["imager"] - if ("latest_version" in imager && "url" in imager) { + if (imageWriter.getBoolSetting("check_version") && "latest_version" in imager && "url" in imager) { if (!imageWriter.isEmbeddedMode() && imageWriter.isVersionNewer(imager["latest_version"])) { updatepopup.url = imager["url"] updatepopup.openPopup()