From 7d2bbd9e7b68e398044fe24294e45e903181e56c Mon Sep 17 00:00:00 2001 From: DuckSoft Date: Tue, 12 May 2020 20:12:49 +0800 Subject: [PATCH] add warning when users switch off api subsystem --- src/ui/w_PreferencesWindow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ui/w_PreferencesWindow.cpp b/src/ui/w_PreferencesWindow.cpp index a83ae8a9..6af797ce 100644 --- a/src/ui/w_PreferencesWindow.cpp +++ b/src/ui/w_PreferencesWindow.cpp @@ -1157,7 +1157,15 @@ void PreferencesWindow::on_enableAPI_stateChanged(int arg1) { LOADINGCHECK NEEDRESTART + CurrentConfig.apiConfig.enableAPI = arg1 == Qt::Checked; + if (arg1 == Qt::Unchecked) + { + const auto msgAPIDisableTitle = tr("Disabling API Subsystem"); + const auto msgAPIDisableMsg = tr("Disabling API subsystem will also disable the statistics function of Qv2ray.") + NEWLINE + // + tr("Speed chart and traffic statistics will be disabled."); + QvMessageBoxWarn(this, msgAPIDisableTitle, msgAPIDisableMsg); + } } void PreferencesWindow::on_updateChannelCombo_currentIndexChanged(int index)