Files
PowerToys/src/settings-ui/Settings.UI/SettingsXAML/Views/CmdNotFoundPage.xaml
Carlos Zamora e1832a0a4a [CommandNotFound]Upgrade to use PSGallery release and support arm64 (#32766)
* [CommandNotFound] Add support for upgrading the module

* upgrade module as a part of upgrade installation; actually set content in EnableModule.ps1

* Fix XAML style to pass CI

* Remove CmdNotFound project from sln as well

* Remove CmdNotFound psd1 file from installer

* More installer fixes

* UpgradeCommandNotFound runs after InstallFiles

* Fix NOTICE.md

* Fix custom action condition

* Pass install folder to the custom action

* Upgrade-Module --> Update-Module

* actually install the module

* spell

* verify updated scripts work; make necessary changes

---------

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2024-05-16 13:45:06 +01:00

157 lines
9.9 KiB
XML

<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.CmdNotFoundPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"
xmlns:tkconverters="using:CommunityToolkit.WinUI.Converters"
xmlns:ui="using:CommunityToolkit.WinUI"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<tkconverters:BoolToVisibilityConverter
x:Key="BoolToInvertedVisibilityConverter"
FalseValue="Visible"
TrueValue="Collapsed" />
<tkconverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Page.Resources>
<controls:SettingsPageControl x:Uid="CmdNotFound" ModuleImageSource="ms-appx:///Assets/Settings/Modules/CmdNotFound.png">
<controls:SettingsPageControl.ModuleContent>
<StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
<InfoBar
x:Uid="GPO_SettingIsManaged"
IsClosable="False"
IsOpen="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}"
IsTabStop="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}"
Severity="Informational" />
<tkcontrols:SettingsExpander
x:Uid="CmdNotFound_Enable"
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/CommandNotFound.png}"
IsEnabled="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
IsExpanded="True">
<tkcontrols:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsCommandNotFoundModuleInstalled, Mode=OneWay}">
<tkcontrols:Case Value="True">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock
x:Uid="InstalledLabel"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<FontIcon
Margin="0,0,4,0"
VerticalAlignment="Center"
AutomationProperties.AccessibilityView="Raw"
Foreground="{ThemeResource SystemFillColorSuccessBrush}"
Glyph="&#xEC61;" />
<HyperlinkButton x:Uid="CmdNotFound_UninstallButton" Command="{x:Bind ViewModel.UninstallModuleEventHandler}" />
</StackPanel>
</tkcontrols:Case>
<tkcontrols:Case Value="False">
<Button
x:Uid="CmdNotFound_InstallButton"
Command="{x:Bind ViewModel.InstallModuleEventHandler}"
Style="{StaticResource AccentButtonStyle}" />
</tkcontrols:Case>
</tkcontrols:SwitchPresenter>
<tkcontrols:SettingsExpander.ItemsHeader>
<StackPanel>
<InfoBar
x:Uid="CmdNotFound_RequirementsBar"
BorderThickness="0"
CornerRadius="0"
IsClosable="False"
IsOpen="True">
<InfoBar.ActionButton>
<HyperlinkButton x:Uid="CmdNotFound_CheckCompatibility" Command="{x:Bind ViewModel.CheckRequirementsEventHandler}">
<ToolTipService.ToolTip>
<TextBlock x:Uid="CmdNotFound_CheckCompatibilityTooltip" TextWrapping="Wrap" />
</ToolTipService.ToolTip>
</HyperlinkButton>
</InfoBar.ActionButton>
</InfoBar>
</StackPanel>
</tkcontrols:SettingsExpander.ItemsHeader>
<tkcontrols:SettingsExpander.Items>
<tkcontrols:SettingsCard x:Uid="CmdNotFound_PowerShellDetection">
<tkcontrols:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsPowerShell7Detected, Mode=OneWay}">
<tkcontrols:Case Value="True">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock
x:Uid="DetectedLabel"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<FontIcon
AutomationProperties.AccessibilityView="Raw"
Foreground="{ThemeResource SystemFillColorSuccessBrush}"
Glyph="&#xEC61;" />
</StackPanel>
</tkcontrols:Case>
<tkcontrols:Case Value="False">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock
x:Uid="NotDetectedLabel"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<FontIcon
AutomationProperties.AccessibilityView="Raw"
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
Glyph="&#xEB90;" />
<Button x:Uid="CmdNotFound_InstallButton" Command="{x:Bind ViewModel.InstallPowerShell7EventHandler}" />
</StackPanel>
</tkcontrols:Case>
</tkcontrols:SwitchPresenter>
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard x:Uid="CmdNotFound_WinGetClientDetection">
<tkcontrols:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsWinGetClientModuleDetected, Mode=OneWay}">
<tkcontrols:Case Value="True">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock
x:Uid="DetectedLabel"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<FontIcon
AutomationProperties.AccessibilityView="Raw"
Foreground="{ThemeResource SystemFillColorSuccessBrush}"
Glyph="&#xEC61;" />
</StackPanel>
</tkcontrols:Case>
<tkcontrols:Case Value="False">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock
x:Uid="NotDetectedLabel"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<FontIcon
AutomationProperties.AccessibilityView="Raw"
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
Glyph="&#xEB90;" />
<Button x:Uid="CmdNotFound_InstallButton" Command="{x:Bind ViewModel.InstallWinGetClientModuleEventHandler}" />
</StackPanel>
</tkcontrols:Case>
</tkcontrols:SwitchPresenter>
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.Items>
</tkcontrols:SettingsExpander>
<TextBlock
x:Uid="CmdNotFound_ModuleInstallationLogs"
Margin="0,12,0,4"
Style="{ThemeResource BodyStrongTextBlockStyle}" />
<TextBox
Height="300"
FontFamily="Consolas"
IsEnabled="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
IsReadOnly="True"
Text="{x:Bind ViewModel.CommandOutputLog, Mode=OneWay}"
TextWrapping="Wrap" />
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink x:Uid="LearnMore_CmdNotFound" Link="https://aka.ms/PowerToysOverview_CmdNotFound" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>