feature: add powershell support for Windows

This commit is contained in:
leo 2024-04-08 17:39:52 +08:00
parent 8f70778ec2
commit 4ac705f8ca
13 changed files with 88 additions and 46 deletions

View file

@ -231,7 +231,7 @@
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Preference.Git}"/>
</TabItem.Header>
<Grid Margin="8" RowDefinitions="32,32,32,32,32,32,32" ColumnDefinitions="Auto,*">
<Grid Margin="8" RowDefinitions="32,32,32,32,32,32,Auto,32" ColumnDefinitions="Auto,*">
<TextBlock Grid.Row="0" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Path}"
HorizontalAlignment="Right"
@ -310,6 +310,12 @@
</ComboBox>
<CheckBox Grid.Row="6" Grid.Column="1"
Height="32"
Content="{DynamicResource Text.Preference.Git.UsePowershellOnWindows}"
IsChecked="{Binding UsePowershellOnWindows, Mode=TwoWay}"
IsVisible="{OnPlatform False, Windows=True}"/>
<CheckBox Grid.Row="7" Grid.Column="1"
Content="{DynamicResource Text.Preference.Git.AutoFetch}"
IsChecked="{Binding GitAutoFetch, Mode=TwoWay}"/>
</Grid>

View file

@ -22,7 +22,7 @@
<Path Width="13" Height="13" Data="{StaticResource Icons.Terminal}"/>
</Button>
<Button Classes="icon_button" Width="32" Click="OnOpenWithExternalEditor" ToolTip.Tip="{DynamicResource Text.Repository.OpenWithExternalTools}">
<Button Classes="icon_button" Width="32" Click="OnOpenWithExternalTools" ToolTip.Tip="{DynamicResource Text.Repository.OpenWithExternalTools}">
<Path Width="13" Height="13" Data="{StaticResource Icons.OpenWith}"/>
</Button>

View file

@ -61,11 +61,11 @@ namespace SourceGit.Views
InitializeComponent();
}
private void OnOpenWithExternalEditor(object sender, RoutedEventArgs e)
private void OnOpenWithExternalTools(object sender, RoutedEventArgs e)
{
if (sender is Button button && DataContext is ViewModels.Repository repo)
{
var menu = repo.CreateContextMenuForExternalEditors();
var menu = repo.CreateContextMenuForExternalTools();
if (menu != null)
{
menu.Open(button);