mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
[FileExplorer]GcodeThumbnailProvider and GcodePreviewHandler (#14827)
* Adds the GcodeThumbnailProvider * Registers the GcodeThumbnailProvider * Adds Settings support * Reverts solution changes back to original * Corrects "Gcode" text with "G-code" * Adds gcode thumbnail setting description * Follow up on PR review comments * Adds GcodePreviewHandler * Follow up on PR review comments * Renames assemblies following #14903
This commit is contained in:
@@ -30,11 +30,21 @@ const CLSID CLSID_SvgThumbnailProvider = { 0x36B27788, 0xA8BB, 0x4698, { 0xA7, 0
|
||||
|
||||
// BCC13D15-9720-4CC4-8371-EA74A274741E
|
||||
const GUID CLSID_PdfThumbnailProvider = { 0xbcc13d15, 0x9720, 0x4cc4, { 0x83, 0x71, 0xea, 0x74, 0xa2, 0x74, 0x74, 0x1e } };
|
||||
|
||||
// 516CB24F-562F-422F-8B01-6B580474D093
|
||||
const CLSID CLSID_SHIMActivateGcodePreviewHandler = { 0x516cb24f, 0x562f, 0x422f, { 0x8b, 0x1, 0x6b, 0x58, 0x4, 0x74, 0xd0, 0x93 } };
|
||||
|
||||
// ec52dea8-7c9f-4130-a77b-1737d0418507
|
||||
const CLSID CLSID_GcodePreviewHandler = { 0xec52dea8, 0x7c9f, 0x4130, { 0xa7, 0x7b, 0x17, 0x37, 0xd0, 0x41, 0x85, 0x07 } };
|
||||
|
||||
// BFEE99B4-B74D-4348-BCA5-E757029647FF
|
||||
const GUID CLSID_GcodeThumbnailProvider = { 0xbfee99b4, 0xb74d, 0x4348, { 0xbc, 0xa5, 0xe7, 0x57, 0x02, 0x96, 0x47, 0xff } };
|
||||
|
||||
// Pairs of NativeClsid vs ManagedClsid used for preview handlers.
|
||||
const std::vector<std::pair<CLSID, CLSID>> NativeToManagedClsid({
|
||||
{ CLSID_SHIMActivateMdPreviewHandler, CLSID_MdPreviewHandler },
|
||||
{ CLSID_SHIMActivatePdfPreviewHandler, CLSID_PdfPreviewHandler },
|
||||
{ CLSID_SHIMActivateGcodePreviewHandler, CLSID_GcodePreviewHandler },
|
||||
{ CLSID_SHIMActivateSvgPreviewHandler, CLSID_SvgPreviewHandler },
|
||||
{ CLSID_SHIMActivateSvgThumbnailProvider, CLSID_SvgThumbnailProvider }
|
||||
});
|
||||
@@ -177,4 +177,13 @@
|
||||
<data name="Pdf_Thumbnail_Provider_Settings_Description" xml:space="preserve">
|
||||
<value>Pdf Thumbnail Provider</value>
|
||||
</data>
|
||||
<data name="Gcode_Thumbnail_Provider_Settings_Description" xml:space="preserve">
|
||||
<value>G-code Thumbnail Provider</value>
|
||||
</data>
|
||||
<data name="Prevpane_Gcode_Settings_Description" xml:space="preserve">
|
||||
<value>G-code Previewer</value>
|
||||
</data>
|
||||
<data name="Prevpane_Gcode_Settings_Displayname" xml:space="preserve">
|
||||
<value>G-code Previewer</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -38,6 +38,10 @@ PowerPreviewModule::PowerPreviewModule() :
|
||||
.settingDescription = GET_RESOURCE_STRING(IDS_PREVPANE_PDF_SETTINGS_DESCRIPTION),
|
||||
.registryChanges = getPdfPreviewHandlerChangeSet(installationDir, installPerUser) });
|
||||
|
||||
m_fileExplorerModules.push_back({ .settingName = L"gcode-previewer-toggle-setting",
|
||||
.settingDescription = GET_RESOURCE_STRING(IDS_PREVPANE_GCODE_SETTINGS_DESCRIPTION),
|
||||
.registryChanges = getGcodePreviewHandlerChangeSet(installationDir, installPerUser) });
|
||||
|
||||
m_fileExplorerModules.push_back({ .settingName = L"svg-thumbnail-toggle-setting",
|
||||
.settingDescription = GET_RESOURCE_STRING(IDS_SVG_THUMBNAIL_PROVIDER_SETTINGS_DESCRIPTION),
|
||||
.registryChanges = getSvgThumbnailHandlerChangeSet(installationDir, installPerUser) });
|
||||
@@ -45,6 +49,10 @@ PowerPreviewModule::PowerPreviewModule() :
|
||||
m_fileExplorerModules.push_back({ .settingName = L"pdf-thumbnail-toggle-setting",
|
||||
.settingDescription = GET_RESOURCE_STRING(IDS_PDF_THUMBNAIL_PROVIDER_SETTINGS_DESCRIPTION),
|
||||
.registryChanges = getPdfThumbnailHandlerChangeSet(installationDir, installPerUser) });
|
||||
|
||||
m_fileExplorerModules.push_back({ .settingName = L"gcode-thumbnail-toggle-setting",
|
||||
.settingDescription = GET_RESOURCE_STRING(IDS_GCODE_THUMBNAIL_PROVIDER_SETTINGS_DESCRIPTION),
|
||||
.registryChanges = getGcodeThumbnailHandlerChangeSet(installationDir, installPerUser) });
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user