From 968e0be3e498453db94d2ec2df10c0fe0768b18f Mon Sep 17 00:00:00 2001 From: hiker Date: Fri, 8 Feb 2019 18:13:36 +1100 Subject: [PATCH] Make sure that HW reports stays disabled when internet is being enabled in the options (GDPR compliance - opt-in required from user to send data). Made chat-message visible/invisible same as hw-statistics. --- src/config/user_config.hpp | 2 +- .../options/options_screen_general.cpp | 23 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index 4dc23bf16..e7985b979 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -954,7 +954,7 @@ namespace UserConfigParams "A random number to avoid duplicated reports.") ); PARAM_PREFIX BoolUserConfigParam m_hw_report_enable - PARAM_DEFAULT( BoolUserConfigParam( true, + PARAM_DEFAULT( BoolUserConfigParam( false, "hw-report-enabled", &m_hw_report_group, "If HW reports are enabled.")); diff --git a/src/states_screens/options/options_screen_general.cpp b/src/states_screens/options/options_screen_general.cpp index a2790b144..2fb0b62bf 100644 --- a/src/states_screens/options/options_screen_general.cpp +++ b/src/states_screens/options/options_screen_general.cpp @@ -81,29 +81,35 @@ void OptionsScreenGeneral::init() ribbon->setFocusForPlayer(PLAYER_ID_GAME_MASTER); ribbon->select( "tab_general", PLAYER_ID_GAME_MASTER ); - CheckBoxWidget* news = getWidget("enable-internet"); - assert( news != NULL ); - news->setState( UserConfigParams::m_internet_status + CheckBoxWidget* internet_enabled = getWidget("enable-internet"); + assert( internet_enabled != NULL ); + internet_enabled->setState( UserConfigParams::m_internet_status ==RequestManager::IPERM_ALLOWED ); CheckBoxWidget* stats = getWidget("enable-hw-report"); assert( stats != NULL ); LabelWidget *stats_label = getWidget("label-hw-report"); assert( stats_label ); - stats->setState(UserConfigParams::m_hw_report_enable); + stats->setState(UserConfigParams::m_hw_report_enable); - getWidget("enable-lobby-chat") - ->setState(UserConfigParams::m_lobby_chat); + + CheckBoxWidget* chat = getWidget("enable-lobby-chat"); + LabelWidget* chat_label = getWidget("label-lobby-chat"); - if(news->getState()) + if(internet_enabled->getState()) { stats_label->setVisible(true); stats->setVisible(true); stats->setState(UserConfigParams::m_hw_report_enable); + chat_label->setVisible(true); + chat->setVisible(true); + chat->setState(UserConfigParams::m_lobby_chat); } else { stats_label->setVisible(false); stats->setVisible(false); + chat_label->setVisible(false); + chat->setVisible(false); } CheckBoxWidget* difficulty = getWidget("perPlayerDifficulty"); assert( difficulty != NULL ); @@ -186,6 +192,9 @@ void OptionsScreenGeneral::eventCallback(Widget* widget, const std::string& name chat_label->setVisible(false); stats->setVisible(false); stats_label->setVisible(false); + // Disable this, so that the user has to re-check this if + // enabled later (for GDPR compliance). + UserConfigParams::m_hw_report_enable = false; PlayerProfile* profile = PlayerManager::getCurrentPlayer(); if (profile != NULL && profile->isLoggedIn()) profile->requestSignOut();