mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
Implemented conflict-popup
As per https://github.com/sourcegit-scm/sourcegit/issues/1210. Included conflict popup + switched focus for immediate conflict handling.
This commit is contained in:
parent
de31d4bad4
commit
f57e535f08
15 changed files with 108 additions and 1 deletions
|
@ -178,6 +178,8 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Farbe</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Name</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Zuletzt geöffnete Tabs beim Starten wiederherstellen</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Nicht aufgelöste Konflikte</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">In Ihrer Arbeitskopie befinden sich nicht aufgelöste Konflikte!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Konventionelle Commit-Hilfe</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Breaking Change:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Geschlossenes Ticket:</x:String>
|
||||
|
|
|
@ -186,6 +186,8 @@
|
|||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">Empty commit detected! Do you want to continue (--allow-empty)?</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.StageAllThenCommit" xml:space="preserve">STAGE ALL & COMMIT</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.WithLocalChanges" xml:space="preserve">Empty commit detected! Do you want to continue (--allow-empty) or stage all then commit?</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Unresolved Conflicts</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">There are unresolved conflicts in your working copy!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Conventional Commit Helper</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Breaking Change:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Closed Issue:</x:String>
|
||||
|
|
|
@ -187,6 +187,8 @@
|
|||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">¡Commit vacío detectado! ¿Quieres continuar (--allow-empty)?</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.StageAllThenCommit" xml:space="preserve">HACER STAGE A TODO & COMMIT</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.WithLocalChanges" xml:space="preserve">¡Commit vacío detectado! ¿Quieres continuar (--allow-empty) o hacer stage a todo y después commit?</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Conflictos sin resolver</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">¡Hay conflictos sin resolver en tu copia de trabajo!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Asistente de Commit Convencional</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Cambio Importante:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Incidencia Cerrada:</x:String>
|
||||
|
|
|
@ -181,6 +181,8 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Couleur</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Nom</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Restaurer les onglets au démarrage</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Conflits non résolus</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">Il y a des conflits non résolus dans votre copie de travail !</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Assistant Commits Conventionnels</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Changement Radical :</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Incident Clos :</x:String>
|
||||
|
|
|
@ -181,6 +181,8 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Colore</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Nome</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Ripristina schede all'avvio</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Conflitti non risolti</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">Ci sono conflitti non risolti nella tua copia di lavoro!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Guida Commit Convenzionali</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Modifica Sostanziale:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Issue Chiusa:</x:String>
|
||||
|
|
|
@ -181,6 +181,8 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">色</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">名前</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">起動時にタブを復元</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">未解決の競合</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">作業コピーに未解決の競合があります!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Conventional Commitヘルパー</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">破壊的変更:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">閉じたIssue:</x:String>
|
||||
|
|
|
@ -163,6 +163,8 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Cor</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Nome</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Restaurar abas ao inicializar</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Conflitos não resolvidos</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">Há conflitos não resolvidos na sua cópia de trabalho!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Assistente de Conventional Commit</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Breaking Change:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Ticket encerrado:</x:String>
|
||||
|
|
|
@ -186,6 +186,8 @@
|
|||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">Обнаружена пустая ревизия! Вы хотите продолжить (--allow-empty)?</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.StageAllThenCommit" xml:space="preserve">Подготовить все и зафиксировать ревизию</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.WithLocalChanges" xml:space="preserve">Обнаружена пустая ревизия! Вы хотите продолжить (--allow-empty) или отложить все, затем зафиксировать ревизию?</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Неразрешённые конфликты</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">В вашей рабочей копии есть неразрешённые конфликты!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Общепринятый помощник по ревизии</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Кардинальные изменения:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Закрытая тема:</x:String>
|
||||
|
|
|
@ -181,6 +181,8 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">நிறம்</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">பெயர்</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">தாவல்களை மீட்டமை</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">தீர்க்கப்படாத மோதல்கள்</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">உங்கள் வேலை நகலில் தீர்க்கப்படாத மோதல்கள் உள்ளன!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">வழக்கமான உறுதிமொழி உதவியாளர்</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">உடைக்கும் மாற்றம்:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">மூடப்பட்ட வெளியீடு சிக்கல்:</x:String>
|
||||
|
|
|
@ -185,6 +185,8 @@
|
|||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">Виявлено порожній коміт! Продовжити (--allow-empty)?</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.StageAllThenCommit" xml:space="preserve">ІНДЕКСУВАТИ ВСЕ ТА ЗАКОМІТИТИ</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.WithLocalChanges" xml:space="preserve">Виявлено порожній коміт! Продовжити (--allow-empty) чи індексувати все та закомітити?</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">Невирішені конфлікти</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">У вашій робочій копії є невирішені конфлікти!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Допомога Conventional Commit</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Зворотньо несумісні зміни:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Закрите завдання:</x:String>
|
||||
|
|
|
@ -190,6 +190,8 @@
|
|||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">提交未包含变更文件!是否继续(--allow-empty)?</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.StageAllThenCommit" xml:space="preserve">自动暂存并提交</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.WithLocalChanges" xml:space="preserve">提交未包含变更文件!是否继续(--allow-empty)或是自动暂存所有变更并提交?</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">未解决的冲突</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">您的工作副本中存在未解决的冲突!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">规范化提交信息生成</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">破坏性更新:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">关闭的ISSUE:</x:String>
|
||||
|
|
|
@ -190,6 +190,8 @@
|
|||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">未包含任何檔案變更! 您是否仍要提交 (--allow-empty)?</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.StageAllThenCommit" xml:space="preserve">自动暂存并提交</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.WithLocalChanges" xml:space="preserve">未包含任何檔案變更! 您是否仍要提交 (--allow-empty)或者自動暫存全部變更並提交?</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Title">未解決的衝突</x:String>
|
||||
<x:String x:Key="Text.ConflictDialog.Message">您的工作副本中有未解決的衝突!</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">產生約定式提交訊息</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">破壞性變更:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">關閉的 Issue:</x:String>
|
||||
|
|
|
@ -9,6 +9,8 @@ using Avalonia.Threading;
|
|||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
using SourceGit.Views;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class WorkingCopy : ObservableObject
|
||||
|
@ -300,6 +302,15 @@ namespace SourceGit.ViewModels
|
|||
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
if((visibleUnstaged.Count > 0) && (hasConflict))
|
||||
{
|
||||
_repo.RefreshBranches();
|
||||
_repo.RefreshCommits();
|
||||
_repo.SelectedViewIndex = 1;
|
||||
selectedUnstaged.Add(visibleUnstaged[0]);
|
||||
App.OpenDialog(new ConflictDialog());
|
||||
}
|
||||
|
||||
_isLoadingData = true;
|
||||
HasUnsolvedConflicts = hasConflict;
|
||||
VisibleUnstaged = visibleUnstaged;
|
||||
|
@ -310,8 +321,8 @@ namespace SourceGit.ViewModels
|
|||
SelectedStaged = selectedStaged;
|
||||
_isLoadingData = false;
|
||||
|
||||
UpdateDetail();
|
||||
UpdateInProgressState();
|
||||
UpdateDetail();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
54
src/Views/ConflictDialog.axaml
Normal file
54
src/Views/ConflictDialog.axaml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<v:ChromelessWindow 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:v="using:SourceGit.Views"
|
||||
mc:Ignorable="d"
|
||||
x:Class="SourceGit.Views.ConflictDialog"
|
||||
x:Name="ThisControl"
|
||||
Icon="/App.ico"
|
||||
Title="{DynamicResource Text.ConflictDialog.Title}"
|
||||
Width="420" Height="160"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<!-- Custom title bar -->
|
||||
<Grid Grid.Row="0" Height="28" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
||||
<Border Background="{DynamicResource Brush.TitleBar}"
|
||||
BorderThickness="0,0,0,1"
|
||||
BorderBrush="{DynamicResource Brush.Border0}"
|
||||
PointerPressed="BeginMoveWindow"/>
|
||||
|
||||
<Path Width="14" Height="14"
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Data="{StaticResource Icons.Warn}"/>
|
||||
|
||||
<TextBlock Classes="bold"
|
||||
Text="{DynamicResource Text.ConflictDialog.Title}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsHitTestVisible="False"/>
|
||||
|
||||
<v:CaptionButtons HorizontalAlignment="Right"
|
||||
IsCloseButtonOnly="True"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Content -->
|
||||
<StackPanel Grid.Row="1" Margin="20" Spacing="16" VerticalAlignment="Center">
|
||||
<TextBlock x:Name="MessageText"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource Brush.FG1}"
|
||||
Text="{DynamicResource Text.ConflictDialog.Message}" />
|
||||
|
||||
<Button Width="80"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Classes="primary"
|
||||
Content="{DynamicResource Text.Sure}"
|
||||
Click="OnOK"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</v:ChromelessWindow>
|
18
src/Views/ConflictDialog.axaml.cs
Normal file
18
src/Views/ConflictDialog.axaml.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class ConflictDialog : ChromelessWindow
|
||||
{
|
||||
public ConflictDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnOK(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue