[File Explorer] Fix restart as admin notification (#14004)
This commit is contained in:
parent
a5edc29be7
commit
c4951dc605
|
@ -180,11 +180,7 @@ void PowerPreviewModule::apply_settings(const PowerToysSettings::PowerToyValues&
|
|||
{
|
||||
const bool isElevated = is_process_elevated(false);
|
||||
bool notifyShell = false;
|
||||
if (!isElevated)
|
||||
{
|
||||
show_update_warning_message();
|
||||
return;
|
||||
}
|
||||
bool updatesNeeded = false;
|
||||
|
||||
for (auto& fileExplorerModule : m_fileExplorerModules)
|
||||
{
|
||||
|
@ -195,6 +191,11 @@ void PowerPreviewModule::apply_settings(const PowerToysSettings::PowerToyValues&
|
|||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Mark that updates were to the registry were needed
|
||||
updatesNeeded = true;
|
||||
}
|
||||
|
||||
// (Un)Apply registry changes depending on the new setting value
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (!isElevated && updatesNeeded)
|
||||
{
|
||||
show_update_warning_message();
|
||||
}
|
||||
if (notifyShell)
|
||||
{
|
||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
||||
|
|
Loading…
Reference in a new issue