build: Added option to disable update checking (#1036)

This is aimed at use by linux distros, where package updates come from a
central location, and users shouldn't need to worry about updating ImHex
on their own. This disables parts of the ImHex UI that would not be
useful in that case.

Tested and confirmed that this works in both states of the of the
`-DIMHEX_DISABLE_UPDATE_CHECK` switch.
This commit is contained in:
classabbyamp
2023-05-05 16:03:45 -04:00
committed by GitHub
parent e44eb2aa8e
commit 82f5900759
5 changed files with 15 additions and 3 deletions

View File

@@ -535,6 +535,7 @@ namespace hex::plugin::builtin {
loadDefaultLayout();
});
#if defined(HEX_UPDATE_CHECK)
EventManager::subscribe<EventWindowInitialized>([] {
// documentation of the value above the setting definition
auto showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2);
@@ -550,6 +551,7 @@ namespace hex::plugin::builtin {
);
}
});
#endif
// Clear project context if we go back to the welcome screen
EventManager::subscribe<EventProviderChanged>([](hex::prv::Provider *oldProvider, hex::prv::Provider *newProvider) {