Skip to content

Commit

Permalink
[Installer]Don't enable pdf preview by default (#17274)
Browse files Browse the repository at this point in the history
* [Installer]Don't enable pdf preview by default

* Change settings UI when there's no settings as well

* clear analyzer errors
  • Loading branch information
jaimecbernardo committed Mar 25, 2022
1 parent bdbf0b8 commit ba73bc7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion installer/PowerToysSetupCustomActions/CustomAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ UINT __stdcall ApplyModulesRegistryChangeSetsCA(MSIHANDLE hInstall)
hr = getInstallFolder(hInstall, installationFolder);
ExitOnFailure(hr, "Failed to get installFolder.");

for (const auto& changeSet : getAllModulesChangeSets(installationFolder))
for (const auto& changeSet : getAllOnByDefaultModulesChangeSets(installationFolder))
{
if (!changeSet.apply())
{
Expand Down
12 changes: 12 additions & 0 deletions src/common/utils/modulesRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,18 @@ inline registry::ChangeSet getStlThumbnailHandlerChangeSet(const std::wstring in
NonLocalizable::ExtSTL);
}

inline std::vector<registry::ChangeSet> getAllOnByDefaultModulesChangeSets(const std::wstring installationDir)
{
constexpr bool PER_USER = true;
return { getSvgPreviewHandlerChangeSet(installationDir, PER_USER),
getMdPreviewHandlerChangeSet(installationDir, PER_USER),
getMonacoPreviewHandlerChangeSet(installationDir, PER_USER),
getGcodePreviewHandlerChangeSet(installationDir, PER_USER),
getSvgThumbnailHandlerChangeSet(installationDir, PER_USER),
getGcodeThumbnailHandlerChangeSet(installationDir, PER_USER),
getStlThumbnailHandlerChangeSet(installationDir, PER_USER) };
}

inline std::vector<registry::ChangeSet> getAllModulesChangeSets(const std::wstring installationDir)
{
constexpr bool PER_USER = true;
Expand Down
4 changes: 2 additions & 2 deletions src/settings-ui/Settings.UI.Library/PowerPreviewProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public bool EnableMonacoPreviewWordWrap
}
}

private bool enablePdfPreview = true;
private bool enablePdfPreview;

[JsonPropertyName("pdf-previewer-toggle-setting")]
[JsonConverter(typeof(BoolPropertyJsonConverter))]
Expand All @@ -114,7 +114,7 @@ public bool EnablePdfPreview
}
}

private bool enablePdfThumbnail = true;
private bool enablePdfThumbnail;

[JsonPropertyName("pdf-thumbnail-toggle-setting")]
[JsonConverter(typeof(BoolPropertyJsonConverter))]
Expand Down

0 comments on commit ba73bc7

Please sign in to comment.