mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[File Explorer] Fix restart as admin notification (#14004)
This commit is contained in:
@@ -180,11 +180,7 @@ void PowerPreviewModule::apply_settings(const PowerToysSettings::PowerToyValues&
|
|||||||
{
|
{
|
||||||
const bool isElevated = is_process_elevated(false);
|
const bool isElevated = is_process_elevated(false);
|
||||||
bool notifyShell = false;
|
bool notifyShell = false;
|
||||||
if (!isElevated)
|
bool updatesNeeded = false;
|
||||||
{
|
|
||||||
show_update_warning_message();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& fileExplorerModule : m_fileExplorerModules)
|
for (auto& fileExplorerModule : m_fileExplorerModules)
|
||||||
{
|
{
|
||||||
@@ -195,6 +191,11 @@ void PowerPreviewModule::apply_settings(const PowerToysSettings::PowerToyValues&
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Mark that updates were to the registry were needed
|
||||||
|
updatesNeeded = true;
|
||||||
|
}
|
||||||
|
|
||||||
// (Un)Apply registry changes depending on the new setting value
|
// (Un)Apply registry changes depending on the new setting value
|
||||||
const bool updated = *toggle ? fileExplorerModule.registryChanges.apply() : fileExplorerModule.registryChanges.unApply();
|
const bool updated = *toggle ? fileExplorerModule.registryChanges.apply() : fileExplorerModule.registryChanges.unApply();
|
||||||
@@ -209,6 +210,10 @@ void PowerPreviewModule::apply_settings(const PowerToysSettings::PowerToyValues&
|
|||||||
Trace::PowerPreviewSettingsUpdateFailed(fileExplorerModule.settingName.c_str(), !*toggle, *toggle, true);
|
Trace::PowerPreviewSettingsUpdateFailed(fileExplorerModule.settingName.c_str(), !*toggle, *toggle, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!isElevated && updatesNeeded)
|
||||||
|
{
|
||||||
|
show_update_warning_message();
|
||||||
|
}
|
||||||
if (notifyShell)
|
if (notifyShell)
|
||||||
{
|
{
|
||||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user