main: add compile time option to disable updates

This commit is contained in:
selsta 2022-05-01 06:09:29 +02:00
parent 2e2ae5c88f
commit 9b7bca6116
No known key found for this signature in database
GPG key ID: 2EA0A99A8B07AE5E
2 changed files with 9 additions and 0 deletions

View file

@ -13,6 +13,7 @@ option(STATIC "Link libraries statically, requires static Qt")
option(USE_DEVICE_TREZOR "Trezor support compilation" ON) option(USE_DEVICE_TREZOR "Trezor support compilation" ON)
option(WITH_SCANNER "Enable webcam QR scanner" OFF) option(WITH_SCANNER "Enable webcam QR scanner" OFF)
option(WITH_DESKTOP_ENTRY "Ask to install desktop entry on first startup" ON) option(WITH_DESKTOP_ENTRY "Ask to install desktop entry on first startup" ON)
option(WITH_UPDATER "Regularly check for new updates" ON)
option(DEV_MODE "Checkout latest monero master on build" OFF) option(DEV_MODE "Checkout latest monero master on build" OFF)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake") list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
@ -87,6 +88,10 @@ if(WITH_DESKTOP_ENTRY)
add_definitions(-DWITH_DESKTOP_ENTRY) add_definitions(-DWITH_DESKTOP_ENTRY)
endif() endif()
if(WITH_UPDATER)
add_definitions(-DWITH_UPDATER)
endif()
# Sodium # Sodium
find_library(SODIUM_LIBRARY sodium) find_library(SODIUM_LIBRARY sodium)
message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}") message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}")

View file

@ -498,7 +498,11 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
engine.rootContext()->setContextProperty("homePath", QDir::homePath()); engine.rootContext()->setContextProperty("homePath", QDir::homePath());
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath()); engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
engine.rootContext()->setContextProperty("idealThreadCount", QThread::idealThreadCount()); engine.rootContext()->setContextProperty("idealThreadCount", QThread::idealThreadCount());
#ifdef WITH_UPDATER
engine.rootContext()->setContextProperty("disableCheckUpdatesFlag", parser.isSet(disableCheckUpdatesOption)); engine.rootContext()->setContextProperty("disableCheckUpdatesFlag", parser.isSet(disableCheckUpdatesOption));
#else
engine.rootContext()->setContextProperty("disableCheckUpdatesFlag", true);
#endif
engine.rootContext()->setContextProperty("socksProxyFlag", parser.value(socksProxyOption)); engine.rootContext()->setContextProperty("socksProxyFlag", parser.value(socksProxyOption));
engine.rootContext()->setContextProperty("socksProxyFlagSet", parser.isSet(socksProxyOption)); engine.rootContext()->setContextProperty("socksProxyFlagSet", parser.isSet(socksProxyOption));