Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void SlowInitializeProperties()
contextItem.SlowInitializeProperties();
});

if (!string.IsNullOrEmpty(model.Command.Name))
if (!string.IsNullOrEmpty(model.Command?.Name))
{
_defaultCommandContextItem = new(new CommandContextItem(model.Command!), PageContext)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public override void UpdateQuery(string query)
{
if (string.IsNullOrWhiteSpace(query))
{
Command = null;
Title = string.Empty;
Subtitle = string.Empty;
return;
Expand All @@ -58,6 +59,7 @@ public override void UpdateQuery(string query)

if (result == null)
{
Command = null;
Title = string.Empty;
Subtitle = string.Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Microsoft.CmdPal.Ext.System.Pages;

public sealed partial class SystemCommandPage : ListPage
{
private SettingsManager _settingsManager;
private readonly SettingsManager _settingsManager;

public SystemCommandPage(SettingsManager settingsManager)
{
Title = Resources.Microsoft_plugin_ext_system_page_name;
Name = Resources.Microsoft_plugin_ext_system_page_name;
Title = Resources.Microsoft_plugin_ext_system_page_title;
Name = Resources.Microsoft_plugin_command_name_open;
Icon = IconHelpers.FromRelativePath("Assets\\SystemCommand.svg");
_settingsManager = settingsManager;
ShowDetails = true;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@
<data name="Microsoft_plugin_ext_settings_hideDisconnectedNetworkInfo" xml:space="preserve">
<value>Hide disconnected network info</value>
</data>
<data name="Microsoft_plugin_ext_system_page_title" xml:space="preserve">
<value>Windows System Commands</value>
</data>
<data name="Microsoft_plugin_ext_system_page_name" xml:space="preserve">
<value>Windows System Command</value>
<value>System Commands</value>
</data>
<data name="Microsoft_plugin_sys_AdapterName" xml:space="preserve">
<value>Adapter name</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class SystemCommandExtensionProvider : CommandProvider
private readonly ICommandItem[] _commands;
private static readonly SettingsManager _settingsManager = new();
public static readonly SystemCommandPage Page = new(_settingsManager);
private readonly FallbackSystemCommandItem _fallbackFileItem = new(_settingsManager);
private readonly FallbackSystemCommandItem _fallbackSystemItem = new(_settingsManager);

public SystemCommandExtensionProvider()
{
Expand All @@ -23,7 +23,7 @@ public SystemCommandExtensionProvider()
_commands = [
new CommandItem(Page)
{
Title = Resources.Microsoft_plugin_ext_system_page_name,
Title = Resources.Microsoft_plugin_ext_system_page_title,
Icon = Page.Icon,
MoreCommands = [new CommandContextItem(_settingsManager.Settings.SettingsPage)],
},
Expand All @@ -38,5 +38,5 @@ public override ICommandItem[] TopLevelCommands()
return _commands;
}

public override IFallbackCommandItem[] FallbackCommands() => [_fallbackFileItem];
public override IFallbackCommandItem[] FallbackCommands() => [_fallbackSystemItem];
}
Loading