mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-21 18:35:00 +00:00
feature: when trying to checkout a local branch from its tracking upstream and it is behind the upstream, show Checkout & Fast-Forward
popup
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
6c04f5390a
commit
7d0536d94b
8 changed files with 203 additions and 6 deletions
62
src/Views/CheckoutAndFastForward.axaml
Normal file
62
src/Views/CheckoutAndFastForward.axaml
Normal file
|
@ -0,0 +1,62 @@
|
|||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
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:m="using:SourceGit.Models"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.CheckoutAndFastForward"
|
||||
x:DataType="vm:CheckoutAndFastForward">
|
||||
<StackPanel Orientation="Vertical" Margin="8,0">
|
||||
<TextBlock FontSize="18"
|
||||
Classes="bold"
|
||||
Text="{DynamicResource Text.Checkout.WithFastForward}"/>
|
||||
|
||||
<Grid Margin="0,16,0,0" ColumnDefinitions="140,*">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="Auto" MinHeight="32"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"
|
||||
Text="{DynamicResource Text.Checkout.Target}"/>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
||||
<Path Width="14" Height="14" Margin="4,0" Data="{StaticResource Icons.Branch}"/>
|
||||
<TextBlock Text="{Binding LocalBranch.Name}"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"
|
||||
Text="{DynamicResource Text.Checkout.WithFastForward.Upstream}"/>
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
|
||||
<Path Width="14" Height="14" Margin="4,0" Data="{StaticResource Icons.Branch}"/>
|
||||
<TextBlock Text="{Binding RemoteBrach.FriendlyName}"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"
|
||||
Text="{DynamicResource Text.Checkout.LocalChanges}"/>
|
||||
<WrapPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<RadioButton GroupName="LocalChanges"
|
||||
Margin="0,0,8,0"
|
||||
Content="{DynamicResource Text.Checkout.LocalChanges.StashAndReply}"
|
||||
IsChecked="{Binding !DiscardLocalChanges, Mode=TwoWay}"/>
|
||||
<RadioButton GroupName="LocalChanges"
|
||||
Content="{DynamicResource Text.Checkout.LocalChanges.Discard}"/>
|
||||
</WrapPanel>
|
||||
|
||||
<CheckBox Grid.Row="3" Grid.Column="1"
|
||||
Height="32"
|
||||
Content="{DynamicResource Text.Checkout.RecurseSubmodules}"
|
||||
IsChecked="{Binding RecurseSubmodules, Mode=TwoWay}"
|
||||
IsVisible="{Binding IsRecurseSubmoduleVisible}"
|
||||
ToolTip.Tip="--recurse-submodules"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</UserControl>
|
12
src/Views/CheckoutAndFastForward.axaml.cs
Normal file
12
src/Views/CheckoutAndFastForward.axaml.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using Avalonia.Controls;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class CheckoutAndFastForward : UserControl
|
||||
{
|
||||
public CheckoutAndFastForward()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue