Files
FluentTerminal/FluentTerminal.App/Dialogs/CustomCommandDialog.xaml
T
Aleksandar Pesic e88fb78e9d Quick command implementation (#472)
* Separating "SSH Info" and "Quick Launch", and updating translations.

* Adding "Quick Launch" to menu.

* Auto-complete, initial version.

* Builds, but not finished.

* Improved, but there are still some bugs...

* Minor changes.

* Refactroing request/response identifiers.

* Improving command history.

* Minor refactoring.

* Deleting history by using "Del" key.

* Handling mosh special case in quick commands.

* SSH command handled as any other command in the path.

* New resource strings.

* Fixing quick command links.

* Fixing after-merging bugs.

* Improving filtering.

* Finishing filtering.

* Changing placeholder text.

* Minor refactoring.

* Updating resources.

* Renaming NewRemoteTab back to NewSshTab.
2019-08-08 08:02:09 +02:00

161 lines
6.7 KiB
XML

<ContentDialog
x:Class="FluentTerminal.App.Dialogs.CustomCommandDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:FluentTerminal.App.Views"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:enums="using:FluentTerminal.Models.Enums"
xmlns:viewModels="using:FluentTerminal.App.ViewModels"
mc:Ignorable="d"
x:Uid="QuickCommandDialog"
Title="Quick Launch"
d:DataContext="{d:DesignInstance viewModels:CommandProfileProviderViewModel, IsDesignTimeCreatable=False}"
DefaultButton="Primary"
Loading="OnLoading"
PrimaryButtonText="Button1"
SecondaryButtonText="Button2"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick">
<ContentDialog.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<views:TemplateSelectors />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ContentDialog.Resources>
<StackPanel Orientation="Vertical" Width="500">
<AutoSuggestBox x:Name="CommandTextBox"
x:Uid="CommandTextBox"
TextChanged="CommandTextBox_OnTextChanged"
SuggestionChosen="CommandTextBox_OnSuggestionChosen"
QuerySubmitted="CommandTextBox_OnQuerySubmitted"
PreviewKeyUp="CommandTextBox_OnPreviewKeyUp"
QueryIcon="Find"
PlaceholderText="Enter a command (e.g. 'ssh username@host')"
Text="{Binding Command, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
KeyUp="CommandTextBox_OnKeyUp"
Margin="0 8 2 0"
AutoMaximizeSuggestionArea="True"
ItemsSource="{Binding Commands, Mode=OneWay}" >
<AutoSuggestBox.ItemTemplate>
<DataTemplate x:DataType="viewModels:CommandItemViewModel">
<ContentControl Content="{Binding RichTextBlock, Mode=OneWay}" HorizontalAlignment="Stretch"/>
</DataTemplate>
</AutoSuggestBox.ItemTemplate>
<AutoSuggestBox.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</AutoSuggestBox.ItemContainerStyle>
</AutoSuggestBox>
<controls:Expander
x:Uid="AdvancedExpander"
Margin="0,10,0,0"
Padding="0,10,0,10"
HorizontalContentAlignment="Stretch"
Header="Advanced"
IsExpanded="False">
<Grid Margin="5,20,5,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Row -->
<TextBlock
x:Uid="LineEndingModeOnPaste"
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center"
Text="Line ending on paste:"
Margin="0,8,8,0" />
<ComboBox
Grid.Row="0"
Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
ItemsSource="{Binding LineEndingStyles}"
SelectedItem="{Binding LineEndingTranslation, Mode=TwoWay}"
Margin="0,8,0,0">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="enums:LineEndingStyle">
<TextBlock
Text="{x:Bind Converter={StaticResource I18NConverter}, ConverterParameter=LineEndingStyle}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Row -->
<TextBlock
x:Uid="SshInfoDialog_TabColor"
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center"
Text="Tab color:"
Margin="0,8,8,0" />
<ComboBox
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Stretch"
ItemTemplateSelector="{StaticResource TabThemeTemplateSelector}"
ItemsSource="{Binding TabThemes, Mode=OneWay}"
SelectedItem="{Binding SelectedTabTheme, Mode=TwoWay}"
Margin="0,8,0,0" />
<!-- Row -->
<TextBlock
x:Uid="Theme"
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"
Text="Theme:"
Margin="0,8,8,0" />
<ComboBox
Grid.Row="2"
Grid.Column="1"
HorizontalAlignment="Stretch"
ItemTemplateSelector="{StaticResource TerminalThemeTemplateSelector}"
ItemsSource="{Binding TerminalThemes, Mode=OneWay}"
SelectedItem="{Binding SelectedTerminalTheme, Mode=TwoWay}"
Margin="0,8,0,0" />
<!-- Row -->
<CheckBox
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="2"
Content="{x:Bind Converter={StaticResource I18NConverter}, ConverterParameter=UseConPty}"
IsChecked="{Binding UseConPty, Mode=TwoWay}"
Margin="0,8,0,0" />
</Grid>
</controls:Expander>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button
x:Uid="SaveShortcutButton"
Grid.Row="0"
Grid.Column="1"
Margin="0,10,4,0"
HorizontalAlignment="Stretch"
Click="SaveLink_OnClick"
Content="Save Shortcut" />
</Grid>
</StackPanel>
</ContentDialog>