[General]Add setting to disable elevated apps warning (#30628)

This commit is contained in:
gokcekantarci
2024-01-03 20:22:54 +03:00
committed by GitHub
parent 7c0f24df65
commit f60c4fd2f3
8 changed files with 47 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
#include <common/notifications/notifications.h>
#include <common/notifications/dont_show_again.h>
#include <common/utils/resources.h>
#include <common/SettingsAPI/settings_helpers.h>
#include "Generated Files/resource.h"
@@ -19,8 +20,11 @@ namespace notifications
{
using namespace NonLocalizable;
auto settings = PTSettingsHelper::load_general_settings();
auto enableWarningsElevatedApps = settings.GetNamedBoolean(L"enable_warnings_elevated_apps", true);
static bool warning_shown = false;
if (!warning_shown && !is_toast_disabled(ElevatedDontShowAgainRegistryPath, ElevatedDisableIntervalInDays))
if (enableWarningsElevatedApps && !warning_shown && !is_toast_disabled(ElevatedDontShowAgainRegistryPath, ElevatedDisableIntervalInDays))
{
std::vector<action_t> actions = {
link_button{ button1, RunAsAdminInfoPage },