* Minor improvements to remote SSH profiles. Username prefilled, and line ending defaults to LF. * Implementing "Set Default" on SSH Profiles. * Simplifying profile view models. * Fixing null themes issue. * Changing line ending of a sinfle file to CRLF. * Changing file to LF, to avoid false differences. * Converting a file to LF in order to avoid false differences. * Fixining a bug with shortcuts.
454 lines
25 KiB
XML
454 lines
25 KiB
XML
<Page
|
|
x:Class="FluentTerminal.App.Views.SettingsPages.ShellProfileSettings"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:models="using:FluentTerminal.Models"
|
|
xmlns:settings="using:FluentTerminal.App.ViewModels.Settings"
|
|
xmlns:viewmodels="using:FluentTerminal.App.ViewModels"
|
|
xmlns:views="using:FluentTerminal.App.Views"
|
|
xmlns:enums="using:FluentTerminal.Models.Enums"
|
|
mc:Ignorable="d">
|
|
<Page.Resources>
|
|
<views:TabThemeTemplateSelector x:Key="TabThemeTemplateSelector">
|
|
<views:TabThemeTemplateSelector.DefaultTemplate>
|
|
<DataTemplate x:DataType="models:TabTheme">
|
|
<StackPanel Orientation="Horizontal">
|
|
<FontIcon
|
|
Margin="0,0,6,0"
|
|
FontFamily="Segoe MDL2 Assets"
|
|
Glyph="" />
|
|
<TextBlock Text="{x:Bind Name, Mode=OneWay}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</views:TabThemeTemplateSelector.DefaultTemplate>
|
|
<views:TabThemeTemplateSelector.ColoredTemplate>
|
|
<DataTemplate x:DataType="models:TabTheme">
|
|
<StackPanel Orientation="Horizontal">
|
|
<FontIcon
|
|
Margin="0,0,6,0"
|
|
FontFamily="Segoe MDL2 Assets"
|
|
Foreground="{x:Bind Color}"
|
|
Glyph="" />
|
|
<TextBlock Text="{x:Bind Name, Mode=OneWay}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</views:TabThemeTemplateSelector.ColoredTemplate>
|
|
</views:TabThemeTemplateSelector>
|
|
<views:TerminalThemeTemplateSelector x:Key="TerminalThemeTemplateSelector">
|
|
<views:TerminalThemeTemplateSelector.DefaultTemplate>
|
|
<DataTemplate x:DataType="models:TerminalTheme">
|
|
<TextBlock FontStyle="Italic" Text="{x:Bind Name}" />
|
|
</DataTemplate>
|
|
</views:TerminalThemeTemplateSelector.DefaultTemplate>
|
|
<views:TerminalThemeTemplateSelector.ThemeTemplate>
|
|
<DataTemplate x:DataType="models:TerminalTheme">
|
|
<TextBlock Text="{x:Bind Name}" />
|
|
</DataTemplate>
|
|
</views:TerminalThemeTemplateSelector.ThemeTemplate>
|
|
</views:TerminalThemeTemplateSelector>
|
|
<views:TerminalKeybindTemplateSelector x:Key="TerminalKeybindTemplateSelector">
|
|
<views:TerminalKeybindTemplateSelector.DefaultTemplate>
|
|
<DataTemplate x:DataType="settings:KeyBindingsViewModel">
|
|
<TextBlock x:Uid="None" FontStyle="Italic" />
|
|
</DataTemplate>
|
|
</views:TerminalKeybindTemplateSelector.DefaultTemplate>
|
|
<views:TerminalKeybindTemplateSelector.KeyBindingsTemplate>
|
|
<DataTemplate x:DataType="settings:KeyBindingsViewModel">
|
|
<views:KeyBindingsView
|
|
Margin="0,6,0,0"
|
|
ShowCommandName="False"
|
|
ViewModel="{x:Bind}" />
|
|
</DataTemplate>
|
|
</views:TerminalKeybindTemplateSelector.KeyBindingsTemplate>
|
|
</views:TerminalKeybindTemplateSelector>
|
|
<views:NoValueTemplateSelector x:Key="NoValueTemplateSelector">
|
|
<views:NoValueTemplateSelector.DefaultTemplate>
|
|
<DataTemplate x:DataType="x:String">
|
|
<TextBlock x:Uid="None" FontStyle="Italic" />
|
|
</DataTemplate>
|
|
</views:NoValueTemplateSelector.DefaultTemplate>
|
|
<views:NoValueTemplateSelector.CustomTemplate>
|
|
<DataTemplate x:DataType="x:String">
|
|
<TextBlock Text="{x:Bind}" />
|
|
</DataTemplate>
|
|
</views:NoValueTemplateSelector.CustomTemplate>
|
|
</views:NoValueTemplateSelector>
|
|
<views:BooleanTemplateSelector x:Key="UseConPtyTemplateSelector">
|
|
<views:BooleanTemplateSelector.TrueTemplate>
|
|
<DataTemplate x:DataType="x:Boolean">
|
|
<TextBlock x:Uid="Yes" />
|
|
</DataTemplate>
|
|
</views:BooleanTemplateSelector.TrueTemplate>
|
|
<views:BooleanTemplateSelector.FalseTemplate>
|
|
<DataTemplate x:DataType="x:Boolean">
|
|
<TextBlock x:Uid="No" />
|
|
</DataTemplate>
|
|
</views:BooleanTemplateSelector.FalseTemplate>
|
|
</views:BooleanTemplateSelector>
|
|
</Page.Resources>
|
|
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="160" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="32" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Border
|
|
Grid.RowSpan="3"
|
|
Grid.Column="0"
|
|
Background="{ThemeResource SystemControlAcrylicWindowBrush}" />
|
|
<Grid
|
|
Grid.Row="1"
|
|
Grid.ColumnSpan="2"
|
|
Margin="{StaticResource HeaderMargin}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
x:Uid="Profiles"
|
|
Margin="0,10,0,0"
|
|
VerticalAlignment="Center"
|
|
FontSize="28"
|
|
Style="{StaticResource TitleTextBlockStyle}"
|
|
Text="Profiles" />
|
|
<CommandBar
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
Background="Transparent"
|
|
DefaultLabelPosition="Right"
|
|
Visibility="{x:Bind ViewModel.SelectedShellProfile.InEditMode, Mode=OneWay, Converter={StaticResource FalseToVisibleConverter}}">
|
|
<AppBarButton
|
|
x:Uid="SetDefaultAppBarButton"
|
|
Command="{x:Bind ViewModel.SelectedShellProfile.SetDefaultCommand, Mode=OneWay}"
|
|
Icon="Accept"
|
|
IsEnabled="{x:Bind ViewModel.SelectedShellProfile.IsDefault, Mode=OneWay, Converter={StaticResource NegateConverter}}"
|
|
Label="Set Default" />
|
|
<AppBarButton
|
|
x:Uid="CloneAppBarButton"
|
|
Command="{x:Bind ViewModel.CloneCommand, Mode=OneWay}"
|
|
CommandParameter="{x:Bind ViewModel.SelectedShellProfile, Mode=OneWay}"
|
|
Icon="Copy"
|
|
Label="Clone" />
|
|
<AppBarButton
|
|
x:Uid="EditAppBarButton"
|
|
Command="{x:Bind ViewModel.SelectedShellProfile.EditCommand, Mode=OneWay}"
|
|
Icon="Edit"
|
|
Label="Edit" />
|
|
<AppBarButton
|
|
x:Uid="DeleteAppBarButton"
|
|
Command="{x:Bind ViewModel.SelectedShellProfile.DeleteCommand, Mode=OneWay}"
|
|
Icon="Delete"
|
|
Label="Delete"
|
|
Visibility="{x:Bind ViewModel.SelectedShellProfile.PreInstalled, Mode=OneWay, Converter={StaticResource FalseToVisibleConverter}}" />
|
|
<AppBarButton
|
|
x:Uid="Restore"
|
|
Command="{x:Bind ViewModel.SelectedShellProfile.RestoreDefaultsCommand, Mode=OneWay}"
|
|
Icon="Undo"
|
|
Label="Restore Defaults"
|
|
Visibility="{x:Bind ViewModel.SelectedShellProfile.PreInstalled, Mode=OneWay, Converter={StaticResource TrueToVisibleConverter}}" />
|
|
</CommandBar>
|
|
<CommandBar
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
Background="Transparent"
|
|
DefaultLabelPosition="Right"
|
|
Visibility="{x:Bind ViewModel.SelectedShellProfile.InEditMode, Mode=OneWay, Converter={StaticResource TrueToVisibleConverter}}">
|
|
<AppBarButton
|
|
x:Uid="SaveAppBarButton"
|
|
Command="{x:Bind ViewModel.SelectedShellProfile.SaveChangesCommand, Mode=OneWay}"
|
|
Icon="Save"
|
|
Label="Save" />
|
|
<AppBarButton
|
|
x:Uid="CancelAppBarButton"
|
|
Command="{x:Bind ViewModel.SelectedShellProfile.CancelEditCommand, Mode=OneWay}"
|
|
Icon="Cancel"
|
|
Label="Cancel" />
|
|
</CommandBar>
|
|
</Grid>
|
|
<ScrollViewer
|
|
Grid.Row="2"
|
|
Grid.Column="0"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<StackPanel Margin="{StaticResource ItemMargin}">
|
|
<ListView ItemsSource="{x:Bind ViewModel.ShellProfiles}" SelectedItem="{x:Bind ViewModel.SelectedShellProfile, Mode=TwoWay}">
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate x:DataType="viewmodels:ShellProfileViewModel">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0" Text="{x:Bind Name, Mode=OneWay}" />
|
|
<Viewbox
|
|
Grid.Column="1"
|
|
Width="16"
|
|
Height="16"
|
|
HorizontalAlignment="Right">
|
|
<SymbolIcon Symbol="Accept" Visibility="{x:Bind IsDefault, Mode=OneWay, Converter={StaticResource TrueToVisibleConverter}}" />
|
|
</Viewbox>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
<ListView.ItemContainerStyle>
|
|
<Style TargetType="ListViewItem">
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
</ListView>
|
|
<Button
|
|
Height="48"
|
|
Margin="0,12,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Left"
|
|
Background="Transparent"
|
|
Command="{x:Bind ViewModel.CreateShellProfileCommand}"
|
|
Style="{StaticResource ButtonRevealStyle}">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Viewbox
|
|
Width="12"
|
|
Height="12"
|
|
Margin="0,0,6,0">
|
|
<SymbolIcon Symbol="Add" />
|
|
</Viewbox>
|
|
<TextBlock
|
|
x:Uid="CreateProfile"
|
|
Style="{StaticResource CaptionTextBlockStyle}"
|
|
Text="Create new" />
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
<ScrollViewer
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<ContentControl
|
|
Margin="{StaticResource ContainerMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Content="{x:Bind ViewModel.SelectedShellProfile, Mode=OneWay}">
|
|
<ContentControl.ContentTemplate>
|
|
<DataTemplate x:DataType="viewmodels:ShellProfileViewModel">
|
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
|
<StackPanel Visibility="{x:Bind InEditMode, Converter={StaticResource TrueToVisibleConverter}, Mode=OneWay}">
|
|
<TextBox
|
|
x:Uid="ProfileName"
|
|
Width="300"
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalAlignment="Left"
|
|
Header="Name"
|
|
IsEnabled="{x:Bind PreInstalled, Converter={StaticResource NegateConverter}, Mode=OneWay}"
|
|
IsSpellCheckEnabled="False"
|
|
Text="{x:Bind Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
<StackPanel Margin="{StaticResource ItemMargin}" Orientation="Horizontal">
|
|
<TextBox
|
|
x:Uid="ShellLocation"
|
|
Width="300"
|
|
Header="Shell executable location"
|
|
IsEnabled="{x:Bind PreInstalled, Converter={StaticResource NegateConverter}, Mode=OneWay}"
|
|
IsSpellCheckEnabled="False"
|
|
Text="{x:Bind Location, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
<Button
|
|
Margin="6,0,0,0"
|
|
VerticalAlignment="Bottom"
|
|
Command="{x:Bind BrowseForCustomShellCommand}"
|
|
Content="..."
|
|
IsEnabled="{x:Bind PreInstalled, Converter={StaticResource NegateConverter}, Mode=OneWay}"
|
|
Style="{StaticResource ButtonRevealStyle}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Margin="{StaticResource ItemMargin}" Orientation="Horizontal">
|
|
<TextBox
|
|
x:Uid="WorkingDir"
|
|
Width="300"
|
|
Header="Working directory"
|
|
IsEnabled="{x:Bind InEditMode, Mode=OneWay}"
|
|
IsSpellCheckEnabled="False"
|
|
Text="{x:Bind WorkingDirectory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
<Button
|
|
Margin="6,0,0,0"
|
|
VerticalAlignment="Bottom"
|
|
Command="{x:Bind BrowseForWorkingDirectoryCommand}"
|
|
Content="..."
|
|
Style="{StaticResource ButtonRevealStyle}" />
|
|
</StackPanel>
|
|
|
|
<TextBox
|
|
x:Uid="Arguments"
|
|
Width="300"
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalAlignment="Left"
|
|
Header="Arguments"
|
|
IsEnabled="{x:Bind InEditMode, Mode=OneWay}"
|
|
IsSpellCheckEnabled="False"
|
|
Text="{x:Bind Arguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
<ComboBox
|
|
x:Uid="TabColor"
|
|
Width="150"
|
|
Margin="{StaticResource ItemMargin}"
|
|
Header="Tab color"
|
|
IsEnabled="{x:Bind InEditMode, Mode=OneWay}"
|
|
ItemTemplateSelector="{StaticResource TabThemeTemplateSelector}"
|
|
ItemsSource="{x:Bind TabThemes, Mode=OneWay}"
|
|
SelectedItem="{Binding SelectedTabTheme, Mode=TwoWay}" />
|
|
|
|
<ComboBox
|
|
x:Uid="ProfileTheme"
|
|
Width="150"
|
|
Margin="{StaticResource ItemMargin}"
|
|
Header="Theme"
|
|
IsEnabled="{x:Bind InEditMode, Mode=OneWay}"
|
|
ItemTemplateSelector="{StaticResource TerminalThemeTemplateSelector}"
|
|
ItemsSource="{x:Bind TerminalThemes, Mode=OneWay}"
|
|
SelectedItem="{Binding SelectedTerminalTheme, Mode=TwoWay}" />
|
|
|
|
<ToggleSwitch
|
|
Margin="{StaticResource ItemMargin}"
|
|
Header="Use ConPty"
|
|
IsEnabled="{x:Bind InEditMode, Mode=OneWay}"
|
|
IsOn="{x:Bind UseConPty, Mode=TwoWay}" />
|
|
|
|
<ComboBox
|
|
x:Uid="LineEndingModeOnPaste"
|
|
Margin="{StaticResource ItemMargin}"
|
|
VerticalAlignment="Center"
|
|
ItemsSource="{x:Bind LineEndingStyles}"
|
|
SelectedItem="{Binding LineEndingTranslation, Mode=TwoWay}">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="enums:LineEndingStyle">
|
|
<TextBlock Text="{x:Bind Converter={StaticResource I18NConverter}, ConverterParameter=LineEndingStyle}" />
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
|
|
<StackPanel Margin="{StaticResource ItemMargin}">
|
|
<TextBlock
|
|
x:Uid="KeyboardShortcut1"
|
|
Margin="0,0,6,0"
|
|
VerticalAlignment="Center"
|
|
Text="Keyboard shortcut" />
|
|
<HyperlinkButton
|
|
x:Uid="AddKeyShort"
|
|
Command="{x:Bind AddKeyboardShortcutCommand}"
|
|
Content="Add" />
|
|
<views:KeyBindingsView ShowCommandName="False" ViewModel="{x:Bind KeyBindings}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<StackPanel Visibility="{x:Bind InEditMode, Mode=OneWay, Converter={StaticResource FalseToVisibleConverter}}">
|
|
<TextBlock
|
|
Margin="{StaticResource ItemMargin}"
|
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
|
Text="{x:Bind Name, Mode=OneWay}" />
|
|
|
|
<controls:HeaderedTextBlock
|
|
x:Uid="ShellLocation"
|
|
Margin="{StaticResource ItemMargin}"
|
|
Header="Shell executable location"
|
|
Text="{x:Bind Location, Mode=OneWay}" />
|
|
|
|
<controls:HeaderedContentControl
|
|
x:Uid="WorkingDir"
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Header="Working directory">
|
|
<ContentControl
|
|
Content="{x:Bind WorkingDirectory, Mode=OneWay}"
|
|
ContentTemplateSelector="{StaticResource NoValueTemplateSelector}"
|
|
FontSize="18"
|
|
FontWeight="Light" />
|
|
</controls:HeaderedContentControl>
|
|
|
|
<controls:HeaderedContentControl
|
|
x:Uid="Arguments"
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Header="Arguments">
|
|
<ContentControl
|
|
Content="{x:Bind Arguments, Mode=OneWay}"
|
|
ContentTemplateSelector="{StaticResource NoValueTemplateSelector}"
|
|
FontSize="18"
|
|
FontWeight="Light" />
|
|
</controls:HeaderedContentControl>
|
|
|
|
<controls:HeaderedContentControl
|
|
x:Uid="TabColor"
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Header="Tab color">
|
|
<ContentControl
|
|
Margin="0,6,0,0"
|
|
Content="{x:Bind SelectedTabTheme, Mode=OneWay}"
|
|
ContentTemplateSelector="{StaticResource TabThemeTemplateSelector}"
|
|
FontSize="18"
|
|
FontWeight="Light" />
|
|
</controls:HeaderedContentControl>
|
|
|
|
<controls:HeaderedContentControl
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Header="Theme">
|
|
<ContentControl
|
|
Margin="0,6,0,0"
|
|
Content="{x:Bind SelectedTerminalTheme, Mode=OneWay}"
|
|
ContentTemplateSelector="{StaticResource TerminalThemeTemplateSelector}"
|
|
FontSize="18"
|
|
FontWeight="Light" />
|
|
</controls:HeaderedContentControl>
|
|
|
|
<controls:HeaderedContentControl
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Header="Use ConPty">
|
|
<ContentControl
|
|
Margin="0,6,0,0"
|
|
Content="{x:Bind UseConPty, Mode=OneWay}"
|
|
ContentTemplateSelector="{StaticResource UseConPtyTemplateSelector}"
|
|
FontSize="18"
|
|
FontWeight="Light" />
|
|
</controls:HeaderedContentControl>
|
|
|
|
<controls:HeaderedContentControl
|
|
x:Uid="LineEndingMode"
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Header="Line ending translation mode">
|
|
<ContentControl
|
|
Content="{x:Bind LineEndingTranslation, Mode=OneWay, Converter={StaticResource I18NConverter}, ConverterParameter=LineEndingStyle}"
|
|
ContentTemplateSelector="{StaticResource TerminalThemeTemplateSelector}"
|
|
FontSize="18"
|
|
FontWeight="Light" />
|
|
</controls:HeaderedContentControl>
|
|
|
|
<controls:HeaderedContentControl
|
|
x:Uid="KeyboardShortcut"
|
|
Margin="{StaticResource ItemMargin}"
|
|
HorizontalContentAlignment="Stretch"
|
|
Header="Keyboard shortcut">
|
|
<ContentControl
|
|
Content="{x:Bind KeyBindings, Mode=OneWay}"
|
|
ContentTemplateSelector="{StaticResource TerminalKeybindTemplateSelector}"
|
|
FontSize="18"
|
|
FontWeight="Light" />
|
|
</controls:HeaderedContentControl>
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ContentControl.ContentTemplate>
|
|
</ContentControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</Page>
|