Skip to content

Commit efc8fd6

Browse files
committed
PR Feedback, improve font correlation data
1 parent 8c0168f commit efc8fd6

File tree

11 files changed

+86
-100
lines changed

11 files changed

+86
-100
lines changed

doc/ReleaseNotes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Manifest Schema version updated to 1.12.0 to add support for fonts.
2424

2525
Experimental initial Font Install and Uninstall via manifest for user and machine scopes has been added.
2626

27-
The font 'list' command has been updated with a new '--files' feature for an alternate view of the installed fonts.
27+
The font 'list' command has been updated with a new '--details' feature for an alternate view of the installed fonts.

src/AppInstallerCLICore/Argument.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ namespace AppInstaller::CLI
203203
// Font command
204204
case Execution::Args::Type::Family:
205205
return { type, "family"_liv, ArgTypeCategory::None };
206-
case Execution::Args::Type::Files:
207-
return { type, "files"_liv, ArgTypeCategory::None };
206+
case Execution::Args::Type::Details:
207+
return { type, "details"_liv, ArgTypeCategory::None };
208208

209209
// Configuration commands
210210
case Execution::Args::Type::ConfigurationFile:
@@ -474,8 +474,8 @@ namespace AppInstaller::CLI
474474
return Argument{ type, Resource::String::NoProxyArgumentDescription, ArgumentType::Flag, TogglePolicy::Policy::ProxyCommandLineOptions, BoolAdminSetting::ProxyCommandLineOptions };
475475
case Args::Type::Family:
476476
return Argument{ type, Resource::String::FontFamilyNameArgumentDescription, ArgumentType::Positional, false };
477-
case Args::Type::Files:
478-
return Argument{ type, Resource::String::FontFilesArgumentDescription, ArgumentType::Flag, false };
477+
case Args::Type::Details:
478+
return Argument{ type, Resource::String::FontDetailsArgumentDescription, ArgumentType::Flag, false };
479479
case Args::Type::Correlation:
480480
return Argument{ type, Resource::String::CorrelationArgumentDescription, ArgumentType::Standard, Argument::Visibility::Hidden };
481481
default:

src/AppInstallerCLICore/Commands/FontCommand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace AppInstaller::CLI
5151
{
5252
return {
5353
Argument::ForType(Args::Type::Family),
54-
Argument::ForType(Args::Type::Files),
54+
Argument::ForType(Args::Type::Details),
5555
};
5656
}
5757

src/AppInstallerCLICore/ExecutionArgs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ namespace AppInstaller::CLI::Execution
125125

126126
// Font Command
127127
Family,
128-
Files,
128+
Details,
129129

130130
// Stub package (extended features)
131131
ExtendedFeaturesEnable,

src/AppInstallerCLICore/Resources.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ namespace AppInstaller::CLI::Resource
311311
WINGET_DEFINE_RESOURCE_STRINGID(FontFamily);
312312
WINGET_DEFINE_RESOURCE_STRINGID(FontFamilyNameArgumentDescription);
313313
WINGET_DEFINE_RESOURCE_STRINGID(FontFileNotSupported);
314-
WINGET_DEFINE_RESOURCE_STRINGID(FontFilesArgumentDescription);
314+
WINGET_DEFINE_RESOURCE_STRINGID(FontDetailsArgumentDescription);
315315
WINGET_DEFINE_RESOURCE_STRINGID(FontFilePaths);
316316
WINGET_DEFINE_RESOURCE_STRINGID(FontInstallFailed);
317317
WINGET_DEFINE_RESOURCE_STRINGID(FontListCommandLongDescription);

src/AppInstallerCLICore/Workflows/FontFlow.cpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ namespace AppInstaller::CLI::Workflow
139139

140140
OutputInstalledFontFacesTable(context, lines);
141141
}
142-
else if (context.Args.Contains(Args::Type::Files))
142+
else if (context.Args.Contains(Args::Type::Details))
143143
{
144144
const auto& fontFiles = AppInstaller::Fonts::GetInstalledFontFiles();
145145
std::vector<InstalledFontFilesTableLine> lines;
@@ -159,19 +159,9 @@ namespace AppInstaller::CLI::Workflow
159159
break;
160160
}
161161

162-
std::wstring packageId;
163-
if (!fontFile.PackageId.empty())
164-
{
165-
packageId = fontFile.PackageId;
166-
}
167-
else
168-
{
169-
packageId = fontFile.PackageIdentifier;
170-
}
171-
172162
InstalledFontFilesTableLine line(
173163
Utility::LocIndString(Utility::ConvertToUTF8(fontFile.Title)),
174-
Utility::LocIndString(Utility::ConvertToUTF8(packageId)),
164+
Utility::LocIndString(Utility::ConvertToUTF8(fontFile.PackageIdentifier)),
175165
status,
176166
fontFile.FilePath.u8string());
177167

@@ -267,6 +257,7 @@ namespace AppInstaller::CLI::Workflow
267257
AICLI_TERMINATE_CONTEXT(APPINSTALLER_CLI_ERROR_FONT_INSTALL_FAILED);
268258
}
269259

260+
context.Add<Execution::Data::CorrelatedAppsAndFeaturesEntries>({ fontContext.GetAppsAndFeaturesEntry() });
270261
context.Add<Execution::Data::OperationReturnCode>(installResult.HResult);
271262
}
272263
catch (...)
@@ -317,9 +308,9 @@ namespace AppInstaller::CLI::Workflow
317308
}
318309
else
319310
{
320-
const std::string packageId = context.Get<Execution::Data::InstalledPackageVersion>()->GetProperty(AppInstaller::Repository::PackageVersionProperty::Id);
311+
const std::string moniker = context.Get<Execution::Data::InstalledPackageVersion>()->GetProperty(AppInstaller::Repository::PackageVersionProperty::Moniker);
321312
const std::string version = context.Get<Execution::Data::InstalledPackageVersion>()->GetProperty(AppInstaller::Repository::PackageVersionProperty::Version);
322-
fontContext.PackageId = ConvertToUTF16(packageId);
313+
fontContext.PackageId = ConvertToUTF16(moniker);
323314
fontContext.PackageVersion = ConvertToUTF16(version);
324315
fontContext.Scope = scope;
325316
}

src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3426,8 +3426,8 @@ An unlocalized JSON fragment will follow on another line.</comment>
34263426
<data name="APPINSTALLER_CLI_ERROR_FONT_ROLLBACK_FAILED" xml:space="preserve">
34273427
<value>Font rollback failed. The font may not be in a good state. Try uninstalling after a restart.</value>
34283428
</data>
3429-
<data name="FontFilesArgumentDescription" xml:space="preserve">
3430-
<value>Show fonts by installed font file</value>
3429+
<data name="FontDetailsArgumentDescription" xml:space="preserve">
3430+
<value>Show font file detailed information.</value>
34313431
</data>
34323432
<data name="FontValidationFailed" xml:space="preserve">
34333433
<value>Validation of the font package failed.</value>

src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@
386386
<ClCompile Include="ContextOrchestrator.cpp">
387387
<Filter>Source Files\CLI</Filter>
388388
</ClCompile>
389+
<ClCompile Include="FontHelper.cpp">
390+
<Filter>Source Files\Repository</Filter>
391+
</ClCompile>
389392
</ItemGroup>
390393
<ItemGroup>
391394
<None Include="PropertySheet.props" />

0 commit comments

Comments
 (0)