ux: init repo popup tips (#2182)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2026-03-12 11:32:36 +08:00
parent 6a13c1dd7c
commit 73d38c4730
5 changed files with 20 additions and 3 deletions

View File

@@ -524,6 +524,8 @@
<x:String x:Key="Text.Hunk.Stage" xml:space="preserve">Stage</x:String>
<x:String x:Key="Text.Hunk.Unstage" xml:space="preserve">Unstage</x:String>
<x:String x:Key="Text.Init" xml:space="preserve">Initialize Repository</x:String>
<x:String x:Key="Text.Init.CommandTip" xml:space="preserve">Do you want to run `git init` command under this path?</x:String>
<x:String x:Key="Text.Init.ErrorMessageTip" xml:space="preserve">Open repository failed. Reason: </x:String>
<x:String x:Key="Text.Init.Path" xml:space="preserve">Path:</x:String>
<x:String x:Key="Text.InProgress.CherryPick" xml:space="preserve">Cherry-Pick in progress.</x:String>
<x:String x:Key="Text.InProgress.CherryPick.Head" xml:space="preserve">Processing commit</x:String>

View File

@@ -528,6 +528,8 @@
<x:String x:Key="Text.Hunk.Stage" xml:space="preserve">暂存</x:String>
<x:String x:Key="Text.Hunk.Unstage" xml:space="preserve">移出暂存区</x:String>
<x:String x:Key="Text.Init" xml:space="preserve">初始化新仓库</x:String>
<x:String x:Key="Text.Init.CommandTip" xml:space="preserve">是否在该路径下执行 `git init` 命令(初始化仓库)?</x:String>
<x:String x:Key="Text.Init.ErrorMessageTip" xml:space="preserve">打开本地仓库失败,原因:</x:String>
<x:String x:Key="Text.Init.Path" xml:space="preserve">路径 </x:String>
<x:String x:Key="Text.InProgress.CherryPick" xml:space="preserve">挑选Cherry-Pick操作进行中。</x:String>
<x:String x:Key="Text.InProgress.CherryPick.Head" xml:space="preserve">正在处理提交</x:String>

View File

@@ -528,6 +528,8 @@
<x:String x:Key="Text.Hunk.Stage" xml:space="preserve">暫存</x:String>
<x:String x:Key="Text.Hunk.Unstage" xml:space="preserve">取消暫存</x:String>
<x:String x:Key="Text.Init" xml:space="preserve">初始化存放庫</x:String>
<x:String x:Key="Text.Init.CommandTip" xml:space="preserve">在該路徑執行 git init 以初始化 git 倉庫?</x:String>
<x:String x:Key="Text.Init.ErrorMessageTip" xml:space="preserve">無法在指定路徑開啟本機儲存庫。原因:</x:String>
<x:String x:Key="Text.Init.Path" xml:space="preserve">路徑:</x:String>
<x:String x:Key="Text.InProgress.CherryPick" xml:space="preserve">揀選 (cherry-pick) 操作進行中。</x:String>
<x:String x:Key="Text.InProgress.CherryPick.Head" xml:space="preserve">正在處理提交</x:String>

View File

@@ -21,7 +21,9 @@ namespace SourceGit.ViewModels
_pageId = pageId;
_targetPath = path;
_parentNode = parent;
Reason = string.IsNullOrEmpty(reason) ? "Invalid repository detected!" : reason;
Reason = string.IsNullOrEmpty(reason) ? "unknown error" : reason;
Reason = Reason.Trim();
}
public override async Task<bool> Sure()

View File

@@ -16,11 +16,12 @@
Classes="bold"
Text="{DynamicResource Text.Init}"/>
</StackPanel>
<Grid Margin="0,16,8,0" ColumnDefinitions="100,*">
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition Height="Auto" MinHeight="32"/>
<RowDefinition Height="Auto" MinHeight="32"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0"
@@ -29,9 +30,17 @@
Margin="0,0,8,0"/>
<TextBlock Grid.Row="0" Grid.Column="1"
Text="{Binding TargetPath}"/>
<TextBlock Grid.Row="1" Grid.Column="1"
Foreground="{DynamicResource Brush.FG2}"
Text="{Binding Reason}"
TextWrapping="Wrap">
<Run Text="{DynamicResource Text.Init.ErrorMessageTip}"/>
<Run Text="{Binding Reason, Mode=OneWay}" />
</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1"
Margin="0,8,0,0"
Text="{DynamicResource Text.Init.CommandTip}"
TextWrapping="Wrap"/>
</Grid>
</StackPanel>