Disable update check for homebrew builds.

This commit is contained in:
casey langen 2023-04-13 14:16:42 -07:00
parent fd06b85ae9
commit 1c022196eb
4 changed files with 22 additions and 1 deletions

View File

@ -9,6 +9,7 @@
- libopenmpt@0.6.9
- asio@1.27.0
* update to PDCursesMod@4.3.6 for Windows builds
* disable update check for `homebrew` builds
--------------------------------------------------------------------------------

View File

@ -71,6 +71,13 @@ add_definitions(
-D_WEBSOCKETPP_CPP11_RANDOM_DEVICE_
-DASIO_STANDALONE)
# disable update check for environments that we know will provided hosted,
# prebuilt binaries.
if (DEFINED ENV{HOMEBREW_PREFIX})
message(STATUS "[build] detected homebrew, disabling update check functionality.")
add_definitions(-DDISABLE_UPDATE_CHECK)
endif()
if (${BUILD_STANDALONE} MATCHES "true")
find_vendor_library(LIBCURL curl)
find_vendor_library(LIBSSL ssl)

View File

@ -351,6 +351,7 @@ void MainLayout::OnTrackChanged(size_t index, musik::core::TrackPtr track) {
}
void MainLayout::RunUpdateCheck() {
#ifndef DISABLE_UPDATE_CHECK
if (!prefs->GetBool(cube::prefs::keys::AutoUpdateCheck, true)) {
return;
}
@ -360,4 +361,5 @@ void MainLayout::RunUpdateCheck() {
UpdateCheck::ShowUpgradeAvailableOverlay(version, url);
}
});
#endif
}

View File

@ -105,7 +105,9 @@ static const std::string arrow = "> ";
static inline std::shared_ptr<ISchema> AdvancedSettingsSchema() {
auto schema = std::make_shared<TSchema<>>();
#ifndef DISABLE_UPDATE_CHECK
schema->AddBool(cube::prefs::keys::AutoUpdateCheck, false);
#endif
#ifdef ENABLE_MINIMIZE_TO_TRAY
schema->AddBool(cube::prefs::keys::MinimizeToTray, false);
schema->AddBool(cube::prefs::keys::StartMinimized, false);
@ -310,6 +312,7 @@ void SettingsLayout::OnAdvancedSettingsActivate(cursespp::TextLabel* label) {
}
void SettingsLayout::OnUpdateDropdownActivate(cursespp::TextLabel* label) {
#ifndef DISABLE_UPDATE_CHECK
updateCheck.Run([this](bool updateRequired, std::string version, std::string url) {
if (updateRequired) {
UpdateCheck::ShowUpgradeAvailableOverlay(version, url, false);
@ -318,6 +321,7 @@ void SettingsLayout::OnUpdateDropdownActivate(cursespp::TextLabel* label) {
UpdateCheck::ShowNoUpgradeFoundOverlay();
}
});
#endif
}
void SettingsLayout::OnThemeDropdownActivate(cursespp::TextLabel* label) {
@ -386,8 +390,9 @@ void SettingsLayout::OnLayout() {
this->saveSessionCheckbox->MoveAndResize(column2, y++, columnCx, kLabelHeight);
this->pluginsDropdown->MoveAndResize(column2, y++, columnCx, kLabelHeight);
this->advancedDropdown->MoveAndResize(column2, y++, columnCx, kLabelHeight);
#ifndef DISABLE_UPDATE_CHECK
this->updateDropdown->MoveAndResize(column2, y++, columnCx, kLabelHeight);
#endif
this->appVersion->MoveAndResize(0, cy - 1, cx, kLabelHeight);
}
@ -445,9 +450,11 @@ void SettingsLayout::InitializeWindows() {
this->serverDropdown->Activated.connect(this, &SettingsLayout::OnServerDropdownActivate);
}
#ifndef DISABLE_UPDATE_CHECK
this->updateDropdown = std::make_shared<TextLabel>();
this->updateDropdown->SetText(arrow + _TSTR("settings_check_for_updates"));
this->updateDropdown->Activated.connect(this, &SettingsLayout::OnUpdateDropdownActivate);
#endif
this->advancedDropdown = std::make_shared<TextLabel>();
this->advancedDropdown->SetText(arrow + _TSTR("settings_advanced_settings"));
@ -496,7 +503,9 @@ void SettingsLayout::InitializeWindows() {
this->saveSessionCheckbox->SetFocusOrder(order++);
this->pluginsDropdown->SetFocusOrder(order++);
this->advancedDropdown->SetFocusOrder(order++);
#ifndef DISABLE_UPDATE_CHECK
this->updateDropdown->SetFocusOrder(order++);
#endif
this->AddWindow(this->libraryTypeDropdown);
this->AddWindow(this->localLibraryLayout);
@ -528,7 +537,9 @@ void SettingsLayout::InitializeWindows() {
this->AddWindow(this->saveSessionCheckbox);
this->AddWindow(this->pluginsDropdown);
this->AddWindow(this->advancedDropdown);
#ifndef DISABLE_UPDATE_CHECK
this->AddWindow(this->updateDropdown);
#endif
this->AddWindow(this->appVersion);
}