From 11932af65e2e3193fc646ebe617a46f68c5ff658 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 6 Jul 2021 02:08:56 +0200 Subject: [PATCH] Add preference to opt-out of new version checks Windows and macOS users don't have an easy way to disable this otherwise (commandline option or edit URLs in the config, or compile without PHONE_HOME support). It's all the rage currently. --- gtk2_ardour/ardour_ui_startup.cc | 7 ++++++- gtk2_ardour/rc_option_editor.cc | 21 +++++++++++++++++++++ gtk2_ardour/ui_config_vars.h | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/ardour_ui_startup.cc b/gtk2_ardour/ardour_ui_startup.cc index 661b845c3c..f66c15abc8 100644 --- a/gtk2_ardour/ardour_ui_startup.cc +++ b/gtk2_ardour/ardour_ui_startup.cc @@ -73,6 +73,7 @@ #include "plugin_scan_dialog.h" #include "public_editor.h" #include "splash.h" +#include "ui_config.h" #include "pbd/i18n.h" @@ -504,7 +505,11 @@ ARDOUR_UI::starting () app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::load_from_application_api)); - if (ARDOUR_COMMAND_LINE::check_announcements) { + if (ARDOUR_COMMAND_LINE::check_announcements +#ifndef MIXBUS + && UIConfiguration::instance().get_check_announcements () +#endif + ) { check_announcements (); } diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 124b965d98..89916c154d 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -2384,6 +2384,27 @@ RCOptionEditor::RCOptionEditor () sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_save_export_mixer_screenshot) )); +#if defined PHONE_HOME && !defined MIXBUS + add_option (_("General"), new OptionEditorHeading (_("New Version Check"))); + bo = new BoolOption ( + "check-announcements", + _("Check for announcements at application start"), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_check_announcements), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_check_announcements) + ); + bo ->set_note (string_compose (_("An anomized request is performed to query announcements by contacting\n%1"), +#ifdef __APPLE__ + Config->get_osx_pingback_url () +#elif defined PLATFORM_WINDOWS + Config->get_windows_pingback_url () +#else + Config->get_linux_pingback_url () +#endif + )); + add_option (_("General"), bo); + +#endif + /* APPEARANCE ***************************************************************/ if (!ARDOUR::Profile->get_mixbus()) { diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index 73be3f97ea..846f4f4e80 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -115,6 +115,7 @@ UI_CONFIG_VARIABLE (bool, prefer_inline_over_gui, "prefer-inline-over-gui", true UI_CONFIG_VARIABLE (uint32_t, max_inline_controls, "max-inline-controls", 32) /* per processor */ UI_CONFIG_VARIABLE (uint32_t, action_table_columns, "action-table-columns", 3) UI_CONFIG_VARIABLE (bool, hide_splash_screen, "hide-splash-screen", false) +UI_CONFIG_VARIABLE (bool, check_announcements, "check-announcements,", true) UI_CONFIG_VARIABLE (bool, use_wm_visibility, "use-wm-visibility", true) UI_CONFIG_VARIABLE (std::string, stripable_color_palette, "stripable-color-palette", "#AA3939:#FFAAAA:#D46A6A:#801515:#550000:#AA8E39:#FFEAAA:#D4BA6A:#806515:#554000:#343477:#8080B3:#565695:#1A1A59:#09093B:#2D882D:#88CC88:#55AA55:#116611:#004400") /* Gtk::ColorSelection::palette_to_string */ UI_CONFIG_VARIABLE (bool, use_note_bars_for_velocity, "use-note-bars-for-velocity", true)