diff --git a/README.md b/README.md
index 8c12c646..f9ba3072 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ You can find the current translation status in [TRANSLATION.md](https://github.c
**To use this tool, you need to install Git(>=2.25.1) first.**
-You can download the latest stable from [Releases](https://github.com/sourcegit-scm/sourcegit/releases/latest) or download workflow artifacts from [Github Actions](https://github.com/sourcegit-scm/sourcegit/actions) to try this app based on latest commits.
+You can download the latest stable from [Releases](https://github.com/sourcegit-scm/sourcegit/releases/latest) or download workflow artifacts from [GitHub Actions](https://github.com/sourcegit-scm/sourcegit/actions) to try this app based on latest commits.
This software creates a folder `$"{System.Environment.SpecialFolder.ApplicationData}/SourceGit"`, which is platform-dependent, to store user settings, downloaded avatars and crash logs.
@@ -93,7 +93,7 @@ For **macOS** users:
brew tap ybeapps/homebrew-sourcegit
brew install --cask --no-quarantine sourcegit
```
-* If you want to install `SourceGit.app` from Github Release manually, you need run following command to make sure it works:
+* If you want to install `SourceGit.app` from GitHub Release manually, you need run following command to make sure it works:
```shell
sudo xattr -cr /Applications/SourceGit.app
```
diff --git a/TRANSLATION.md b/TRANSLATION.md
index 94ff684b..ba51b82c 100644
--- a/TRANSLATION.md
+++ b/TRANSLATION.md
@@ -6,11 +6,12 @@ This document shows the translation status of each locale file in the repository
### 
-### 
+### 
Missing keys in de_DE.axaml
+- Text.Avatar.Load
- Text.BranchCM.ResetToSelectedCommit
- Text.CommitDetail.Changes.Count
- Text.CreateBranch.OverwriteExisting
@@ -42,13 +43,21 @@ This document shows the translation status of each locale file in the repository
-### 
+### 
-### 
+
+Missing keys in es_ES.axaml
+
+- Text.Avatar.Load
+
+
+
+### 
Missing keys in fr_FR.axaml
+- Text.Avatar.Load
- Text.Bisect
- Text.Bisect.Abort
- Text.Bisect.Bad
@@ -113,11 +122,12 @@ This document shows the translation status of each locale file in the repository
-### 
+### 
Missing keys in it_IT.axaml
+- Text.Avatar.Load
- Text.BranchCM.ResetToSelectedCommit
- Text.CommitDetail.Changes.Count
- Text.CreateBranch.OverwriteExisting
@@ -144,6 +154,7 @@ This document shows the translation status of each locale file in the repository
Missing keys in ja_JP.axaml
+- Text.Avatar.Load
- Text.Bisect
- Text.Bisect.Abort
- Text.Bisect.Bad
@@ -185,7 +196,6 @@ This document shows the translation status of each locale file in the repository
- Text.Repository.FilterCommits
- Text.Repository.Search.ByContent
- Text.Repository.ShowSubmodulesAsTree
-- Text.Repository.Tags.OrderByNameDes
- Text.Repository.ViewLogs
- Text.Repository.Visit
- Text.ResetWithoutCheckout
@@ -222,6 +232,7 @@ This document shows the translation status of each locale file in the repository
- Text.ApplyStash.DropAfterApply
- Text.ApplyStash.RestoreIndex
- Text.ApplyStash.Stash
+- Text.Avatar.Load
- Text.Bisect
- Text.Bisect.Abort
- Text.Bisect.Bad
@@ -308,8 +319,7 @@ This document shows the translation status of each locale file in the repository
- Text.Repository.ShowSubmodulesAsTree
- Text.Repository.Skip
- Text.Repository.Tags.OrderByCreatorDate
-- Text.Repository.Tags.OrderByNameAsc
-- Text.Repository.Tags.OrderByNameDes
+- Text.Repository.Tags.OrderByName
- Text.Repository.Tags.Sort
- Text.Repository.UseRelativeTimeInHistories
- Text.Repository.ViewLogs
@@ -347,22 +357,14 @@ This document shows the translation status of each locale file in the repository
-### 
+### 
-
-Missing keys in ru_RU.axaml
-
-- Text.BranchCM.CompareWithCurrent
-- Text.Repository.ClearStashes
-- Text.WorkingCopy.ResetAuthor
-
-
-
-### 
+### 
Missing keys in ta_IN.axaml
+- Text.Avatar.Load
- Text.Bisect
- Text.Bisect.Abort
- Text.Bisect.Bad
@@ -428,11 +430,12 @@ This document shows the translation status of each locale file in the repository
-### 
+### 
Missing keys in uk_UA.axaml
+- Text.Avatar.Load
- Text.Bisect
- Text.Bisect.Abort
- Text.Bisect.Bad
diff --git a/VERSION b/VERSION
index 67a3d7e0..b89504d0 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2025.20
\ No newline at end of file
+2025.21
\ No newline at end of file
diff --git a/build/README.md b/build/README.md
index b4358a55..17305edf 100644
--- a/build/README.md
+++ b/build/README.md
@@ -12,4 +12,4 @@
dotnet publish -c Release -r $RUNTIME_IDENTIFIER -o $DESTINATION_FOLDER src/SourceGit.csproj
```
> [!NOTE]
-> Please replace the `$RUNTIME_IDENTIFIER` with one of `win-x64`,`win-arm64`,`linux-x64`,`linux-arm64`,`osx-x64`,`osx-arm64`, and replece the `$DESTINATION_FOLDER` with the real path that will store the output executable files.
+> Please replace the `$RUNTIME_IDENTIFIER` with one of `win-x64`,`win-arm64`,`linux-x64`,`linux-arm64`,`osx-x64`,`osx-arm64`, and replace the `$DESTINATION_FOLDER` with the real path that will store the output executable files.
diff --git a/src/App.axaml.cs b/src/App.axaml.cs
index 411f5cfb..b5868ca1 100644
--- a/src/App.axaml.cs
+++ b/src/App.axaml.cs
@@ -338,7 +338,7 @@ namespace SourceGit
return null;
}
- public static ViewModels.Launcher GetLauncer()
+ public static ViewModels.Launcher GetLauncher()
{
return Current is App app ? app._launcher : null;
}
diff --git a/src/App.manifest b/src/App.manifest
index b3bc3bdf..11a2ff11 100644
--- a/src/App.manifest
+++ b/src/App.manifest
@@ -1,7 +1,7 @@
diff --git a/src/Commands/Blame.cs b/src/Commands/Blame.cs
index 0bb45c98..4fa8b317 100644
--- a/src/Commands/Blame.cs
+++ b/src/Commands/Blame.cs
@@ -89,7 +89,7 @@ namespace SourceGit.Commands
private readonly Models.BlameData _result = new Models.BlameData();
private readonly StringBuilder _content = new StringBuilder();
- private readonly string _dateFormat = Models.DateTimeFormat.Actived.DateOnly;
+ private readonly string _dateFormat = Models.DateTimeFormat.Active.DateOnly;
private string _lastSHA = string.Empty;
private bool _needUnifyCommitSHA = false;
private int _minSHALen = 64;
diff --git a/src/Commands/MergeTool.cs b/src/Commands/MergeTool.cs
index f67f5e48..fc6d0d75 100644
--- a/src/Commands/MergeTool.cs
+++ b/src/Commands/MergeTool.cs
@@ -24,7 +24,7 @@ namespace SourceGit.Commands
if (!File.Exists(toolPath))
{
- Dispatcher.UIThread.Post(() => App.RaiseException(repo, $"Can NOT found external merge tool in '{toolPath}'!"));
+ Dispatcher.UIThread.Post(() => App.RaiseException(repo, $"Can NOT find external merge tool in '{toolPath}'!"));
return false;
}
@@ -54,7 +54,7 @@ namespace SourceGit.Commands
if (!File.Exists(toolPath))
{
- Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, $"Can NOT found external diff tool in '{toolPath}'!"));
+ Dispatcher.UIThread.Invoke(() => App.RaiseException(repo, $"Can NOT find external diff tool in '{toolPath}'!"));
return false;
}
diff --git a/src/Commands/QueryFileContent.cs b/src/Commands/QueryFileContent.cs
index f887859c..83d0a575 100644
--- a/src/Commands/QueryFileContent.cs
+++ b/src/Commands/QueryFileContent.cs
@@ -35,5 +35,39 @@ namespace SourceGit.Commands
return stream;
}
+
+ public static Stream FromLFS(string repo, string oid, long size)
+ {
+ var starter = new ProcessStartInfo();
+ starter.WorkingDirectory = repo;
+ starter.FileName = Native.OS.GitExecutable;
+ starter.Arguments = $"lfs smudge";
+ starter.UseShellExecute = false;
+ starter.CreateNoWindow = true;
+ starter.WindowStyle = ProcessWindowStyle.Hidden;
+ starter.RedirectStandardInput = true;
+ starter.RedirectStandardOutput = true;
+
+ var stream = new MemoryStream();
+ try
+ {
+ var proc = new Process() { StartInfo = starter };
+ proc.Start();
+ proc.StandardInput.WriteLine("version https://git-lfs.github.com/spec/v1");
+ proc.StandardInput.WriteLine($"oid sha256:{oid}");
+ proc.StandardInput.WriteLine($"size {size}");
+ proc.StandardOutput.BaseStream.CopyTo(stream);
+ proc.WaitForExit();
+ proc.Close();
+
+ stream.Position = 0;
+ }
+ catch (Exception e)
+ {
+ App.RaiseException(repo, $"Failed to query file content: {e}");
+ }
+
+ return stream;
+ }
}
}
diff --git a/src/Commands/SaveRevisionFile.cs b/src/Commands/SaveRevisionFile.cs
index 99e89093..550844ef 100644
--- a/src/Commands/SaveRevisionFile.cs
+++ b/src/Commands/SaveRevisionFile.cs
@@ -13,12 +13,8 @@ namespace SourceGit.Commands
var isLFSFiltered = new IsLFSFiltered(repo, revision, file).Result();
if (isLFSFiltered)
{
- var tmpFile = saveTo + ".tmp";
- if (ExecCmd(repo, $"show {revision}:\"{file}\"", tmpFile))
- {
- ExecCmd(repo, $"lfs smudge", saveTo, tmpFile);
- }
- File.Delete(tmpFile);
+ var pointerStream = QueryFileContent.Run(repo, revision, file);
+ ExecCmd(repo, $"lfs smudge", saveTo, pointerStream);
}
else
{
@@ -26,7 +22,7 @@ namespace SourceGit.Commands
}
}
- private static bool ExecCmd(string repo, string args, string outputFile, string inputFile = null)
+ private static bool ExecCmd(string repo, string args, string outputFile, Stream input = null)
{
var starter = new ProcessStartInfo();
starter.WorkingDirectory = repo;
@@ -45,21 +41,8 @@ namespace SourceGit.Commands
{
var proc = new Process() { StartInfo = starter };
proc.Start();
-
- if (inputFile != null)
- {
- using (StreamReader sr = new StreamReader(inputFile))
- {
- while (true)
- {
- var line = sr.ReadLine();
- if (line == null)
- break;
- proc.StandardInput.WriteLine(line);
- }
- }
- }
-
+ if (input != null)
+ proc.StandardInput.Write(new StreamReader(input).ReadToEnd());
proc.StandardOutput.BaseStream.CopyTo(sw);
proc.WaitForExit();
var rs = proc.ExitCode == 0;
diff --git a/src/Converters/ObjectConverters.cs b/src/Converters/ObjectConverters.cs
new file mode 100644
index 00000000..f7c57764
--- /dev/null
+++ b/src/Converters/ObjectConverters.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Globalization;
+using Avalonia.Data.Converters;
+
+namespace SourceGit.Converters
+{
+ public static class ObjectConverters
+ {
+ public class IsTypeOfConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || parameter == null)
+ return false;
+
+ return value.GetType().IsAssignableTo((Type)parameter);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return new NotImplementedException();
+ }
+ }
+
+ public static readonly IsTypeOfConverter IsTypeOf = new IsTypeOfConverter();
+ }
+}
diff --git a/src/Models/AvatarManager.cs b/src/Models/AvatarManager.cs
index a9ef3eb4..2edcb619 100644
--- a/src/Models/AvatarManager.cs
+++ b/src/Models/AvatarManager.cs
@@ -17,7 +17,7 @@ namespace SourceGit.Models
{
public interface IAvatarHost
{
- void OnAvatarResourceChanged(string email);
+ void OnAvatarResourceChanged(string email, Bitmap image);
}
public partial class AvatarManager
@@ -119,7 +119,7 @@ namespace SourceGit.Models
Dispatcher.UIThread.InvokeAsync(() =>
{
_resources[email] = img;
- NotifyResourceChanged(email);
+ NotifyResourceChanged(email, img);
});
}
@@ -151,7 +151,7 @@ namespace SourceGit.Models
if (File.Exists(localFile))
File.Delete(localFile);
- NotifyResourceChanged(email);
+ NotifyResourceChanged(email, null);
}
else
{
@@ -186,6 +186,37 @@ namespace SourceGit.Models
return null;
}
+ public void SetFromLocal(string email, string file)
+ {
+ try
+ {
+ Bitmap image = null;
+
+ using (var stream = File.OpenRead(file))
+ {
+ image = Bitmap.DecodeToWidth(stream, 128);
+ }
+
+ if (image == null)
+ return;
+
+ if (_resources.ContainsKey(email))
+ _resources[email] = image;
+ else
+ _resources.Add(email, image);
+
+ _requesting.Remove(email);
+
+ var store = Path.Combine(_storePath, GetEmailHash(email));
+ File.Copy(file, store, true);
+ NotifyResourceChanged(email, image);
+ }
+ catch
+ {
+ // ignore
+ }
+ }
+
private void LoadDefaultAvatar(string key, string img)
{
var icon = AssetLoader.Open(new Uri($"avares://SourceGit/Resources/Images/{img}", UriKind.RelativeOrAbsolute));
@@ -203,12 +234,10 @@ namespace SourceGit.Models
return builder.ToString();
}
- private void NotifyResourceChanged(string email)
+ private void NotifyResourceChanged(string email, Bitmap image)
{
foreach (var avatar in _avatars)
- {
- avatar.OnAvatarResourceChanged(email);
- }
+ avatar.OnAvatarResourceChanged(email, image);
}
}
}
diff --git a/src/Models/Commit.cs b/src/Models/Commit.cs
index d8eb8ab6..865b3ac1 100644
--- a/src/Models/Commit.cs
+++ b/src/Models/Commit.cs
@@ -33,14 +33,14 @@ namespace SourceGit.Models
public User Committer { get; set; } = User.Invalid;
public ulong CommitterTime { get; set; } = 0;
public string Subject { get; set; } = string.Empty;
- public List Parents { get; set; } = new List();
- public List Decorators { get; set; } = new List();
+ public List Parents { get; set; } = new();
+ public List Decorators { get; set; } = new();
public bool HasDecorators => Decorators.Count > 0;
- public string AuthorTimeStr => DateTime.UnixEpoch.AddSeconds(AuthorTime).ToLocalTime().ToString(DateTimeFormat.Actived.DateTime);
- public string CommitterTimeStr => DateTime.UnixEpoch.AddSeconds(CommitterTime).ToLocalTime().ToString(DateTimeFormat.Actived.DateTime);
- public string AuthorTimeShortStr => DateTime.UnixEpoch.AddSeconds(AuthorTime).ToLocalTime().ToString(DateTimeFormat.Actived.DateOnly);
- public string CommitterTimeShortStr => DateTime.UnixEpoch.AddSeconds(CommitterTime).ToLocalTime().ToString(DateTimeFormat.Actived.DateOnly);
+ public string AuthorTimeStr => DateTime.UnixEpoch.AddSeconds(AuthorTime).ToLocalTime().ToString(DateTimeFormat.Active.DateTime);
+ public string CommitterTimeStr => DateTime.UnixEpoch.AddSeconds(CommitterTime).ToLocalTime().ToString(DateTimeFormat.Active.DateTime);
+ public string AuthorTimeShortStr => DateTime.UnixEpoch.AddSeconds(AuthorTime).ToLocalTime().ToString(DateTimeFormat.Active.DateOnly);
+ public string CommitterTimeShortStr => DateTime.UnixEpoch.AddSeconds(CommitterTime).ToLocalTime().ToString(DateTimeFormat.Active.DateOnly);
public bool IsMerged { get; set; } = false;
public bool IsCommitterVisible => !Author.Equals(Committer) || AuthorTime != CommitterTime;
@@ -49,7 +49,7 @@ namespace SourceGit.Models
public int Color { get; set; } = 0;
public double Opacity => IsMerged ? 1 : OpacityForNotMerged;
public FontWeight FontWeight => IsCurrentHead ? FontWeight.Bold : FontWeight.Regular;
- public Thickness Margin { get; set; } = new Thickness(0);
+ public Thickness Margin { get; set; } = new(0);
public IBrush Brush => CommitGraph.Pens[Color].Brush;
public void ParseDecorators(string data)
@@ -121,6 +121,6 @@ namespace SourceGit.Models
public class CommitFullMessage
{
public string Message { get; set; } = string.Empty;
- public List Inlines { get; set; } = [];
+ public InlineElementCollector Inlines { get; set; } = new();
}
}
diff --git a/src/Models/DateTimeFormat.cs b/src/Models/DateTimeFormat.cs
index 4e8aa550..16276c40 100644
--- a/src/Models/DateTimeFormat.cs
+++ b/src/Models/DateTimeFormat.cs
@@ -25,7 +25,7 @@ namespace SourceGit.Models
set;
} = 0;
- public static DateTimeFormat Actived
+ public static DateTimeFormat Active
{
get => Supported[ActiveIndex];
}
diff --git a/src/Models/ImageDecoder.cs b/src/Models/ImageDecoder.cs
new file mode 100644
index 00000000..ce3a44c1
--- /dev/null
+++ b/src/Models/ImageDecoder.cs
@@ -0,0 +1,9 @@
+namespace SourceGit.Models
+{
+ public enum ImageDecoder
+ {
+ None = 0,
+ Builtin,
+ Pfim
+ }
+}
diff --git a/src/Models/InlineElement.cs b/src/Models/InlineElement.cs
index 53761403..ea7bcee8 100644
--- a/src/Models/InlineElement.cs
+++ b/src/Models/InlineElement.cs
@@ -2,8 +2,7 @@
{
public enum InlineElementType
{
- None = 0,
- Keyword,
+ Keyword = 0,
Link,
CommitSHA,
Code,
@@ -11,10 +10,10 @@
public class InlineElement
{
- public InlineElementType Type { get; set; } = InlineElementType.None;
- public int Start { get; set; } = 0;
- public int Length { get; set; } = 0;
- public string Link { get; set; } = "";
+ public InlineElementType Type { get; }
+ public int Start { get; }
+ public int Length { get; }
+ public string Link { get; }
public InlineElement(InlineElementType type, int start, int length, string link)
{
@@ -24,7 +23,7 @@
Link = link;
}
- public bool Intersect(int start, int length)
+ public bool IsIntersecting(int start, int length)
{
if (start == Start)
return true;
diff --git a/src/Models/InlineElementCollector.cs b/src/Models/InlineElementCollector.cs
new file mode 100644
index 00000000..d81aaf8d
--- /dev/null
+++ b/src/Models/InlineElementCollector.cs
@@ -0,0 +1,38 @@
+using System.Collections.Generic;
+
+namespace SourceGit.Models
+{
+ public class InlineElementCollector
+ {
+ public int Count => _implementation.Count;
+ public InlineElement this[int index] => _implementation[index];
+
+ public InlineElement Intersect(int start, int length)
+ {
+ foreach (var elem in _implementation)
+ {
+ if (elem.IsIntersecting(start, length))
+ return elem;
+ }
+
+ return null;
+ }
+
+ public void Add(InlineElement element)
+ {
+ _implementation.Add(element);
+ }
+
+ public void Sort()
+ {
+ _implementation.Sort((l, r) => l.Start.CompareTo(r.Start));
+ }
+
+ public void Clear()
+ {
+ _implementation.Clear();
+ }
+
+ private readonly List _implementation = [];
+ }
+}
diff --git a/src/Models/IpcChannel.cs b/src/Models/IpcChannel.cs
index d47a46bd..c2a6c6c7 100644
--- a/src/Models/IpcChannel.cs
+++ b/src/Models/IpcChannel.cs
@@ -19,7 +19,7 @@ namespace SourceGit.Models
{
try
{
- _singletoneLock = File.Open(Path.Combine(Native.OS.DataDir, "process.lock"), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
+ _singletonLock = File.Open(Path.Combine(Native.OS.DataDir, "process.lock"), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
_isFirstInstance = true;
_server = new NamedPipeServerStream(
"SourceGitIPCChannel" + Environment.UserName,
@@ -67,7 +67,7 @@ namespace SourceGit.Models
public void Dispose()
{
_cancellationTokenSource?.Cancel();
- _singletoneLock?.Dispose();
+ _singletonLock?.Dispose();
}
private async void StartServer()
@@ -96,7 +96,7 @@ namespace SourceGit.Models
}
}
- private FileStream _singletoneLock = null;
+ private FileStream _singletonLock = null;
private bool _isFirstInstance = false;
private NamedPipeServerStream _server = null;
private CancellationTokenSource _cancellationTokenSource = null;
diff --git a/src/Models/IssueTrackerRule.cs b/src/Models/IssueTrackerRule.cs
index fe0fe8e0..40c84b9e 100644
--- a/src/Models/IssueTrackerRule.cs
+++ b/src/Models/IssueTrackerRule.cs
@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
+using System.Text.RegularExpressions;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -46,7 +45,7 @@ namespace SourceGit.Models
set => SetProperty(ref _urlTemplate, value);
}
- public void Matches(List outs, string message)
+ public void Matches(InlineElementCollector outs, string message)
{
if (_regex == null || string.IsNullOrEmpty(_urlTemplate))
return;
@@ -60,17 +59,7 @@ namespace SourceGit.Models
var start = match.Index;
var len = match.Length;
- var intersect = false;
- foreach (var exist in outs)
- {
- if (exist.Intersect(start, len))
- {
- intersect = true;
- break;
- }
- }
-
- if (intersect)
+ if (outs.Intersect(start, len) != null)
continue;
var link = _urlTemplate;
diff --git a/src/Models/LFSObject.cs b/src/Models/LFSObject.cs
index 0f281253..8bc2dda2 100644
--- a/src/Models/LFSObject.cs
+++ b/src/Models/LFSObject.cs
@@ -1,8 +1,22 @@
-namespace SourceGit.Models
+using System.Text.RegularExpressions;
+
+namespace SourceGit.Models
{
- public class LFSObject
+ public partial class LFSObject
{
+ [GeneratedRegex(@"^version https://git-lfs.github.com/spec/v\d+\r?\noid sha256:([0-9a-f]+)\r?\nsize (\d+)[\r\n]*$")]
+ private static partial Regex REG_FORMAT();
+
public string Oid { get; set; } = string.Empty;
public long Size { get; set; } = 0;
+
+ public static LFSObject Parse(string content)
+ {
+ var match = REG_FORMAT().Match(content);
+ if (match.Success)
+ return new() { Oid = match.Groups[1].Value, Size = long.Parse(match.Groups[2].Value) };
+
+ return null;
+ }
}
}
diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs
index 34189073..3a864ffe 100644
--- a/src/Models/RepositorySettings.cs
+++ b/src/Models/RepositorySettings.cs
@@ -32,7 +32,7 @@ namespace SourceGit.Models
set;
} = false;
- public bool OnlyHighlighCurrentBranchInHistories
+ public bool OnlyHighlightCurrentBranchInHistories
{
get;
set;
@@ -188,7 +188,7 @@ namespace SourceGit.Models
set;
} = false;
- public string PreferedOpenAIService
+ public string PreferredOpenAIService
{
get;
set;
@@ -453,5 +453,19 @@ namespace SourceGit.Models
if (act != null)
CustomActions.Remove(act);
}
+
+ public void MoveCustomActionUp(CustomAction act)
+ {
+ var idx = CustomActions.IndexOf(act);
+ if (idx > 0)
+ CustomActions.Move(idx - 1, idx);
+ }
+
+ public void MoveCustomActionDown(CustomAction act)
+ {
+ var idx = CustomActions.IndexOf(act);
+ if (idx < CustomActions.Count - 1)
+ CustomActions.Move(idx + 1, idx);
+ }
}
}
diff --git a/src/Models/RevisionFile.cs b/src/Models/RevisionFile.cs
index 8cc1be2a..29a23efa 100644
--- a/src/Models/RevisionFile.cs
+++ b/src/Models/RevisionFile.cs
@@ -1,4 +1,6 @@
-using Avalonia.Media.Imaging;
+using System.Globalization;
+using System.IO;
+using Avalonia.Media.Imaging;
namespace SourceGit.Models
{
@@ -9,10 +11,17 @@ namespace SourceGit.Models
public class RevisionImageFile
{
- public Bitmap Image { get; set; } = null;
- public long FileSize { get; set; } = 0;
- public string ImageType { get; set; } = string.Empty;
+ public Bitmap Image { get; }
+ public long FileSize { get; }
+ public string ImageType { get; }
public string ImageSize => Image != null ? $"{Image.PixelSize.Width} x {Image.PixelSize.Height}" : "0 x 0";
+
+ public RevisionImageFile(string file, Bitmap img, long size)
+ {
+ Image = img;
+ FileSize = size;
+ ImageType = Path.GetExtension(file)!.Substring(1).ToUpper(CultureInfo.CurrentCulture);
+ }
}
public class RevisionTextFile
diff --git a/src/Models/Stash.cs b/src/Models/Stash.cs
index 257b6d33..369ab145 100644
--- a/src/Models/Stash.cs
+++ b/src/Models/Stash.cs
@@ -11,6 +11,6 @@ namespace SourceGit.Models
public ulong Time { get; set; } = 0;
public string Message { get; set; } = "";
- public string TimeStr => DateTime.UnixEpoch.AddSeconds(Time).ToLocalTime().ToString(DateTimeFormat.Actived.DateTime);
+ public string TimeStr => DateTime.UnixEpoch.AddSeconds(Time).ToLocalTime().ToString(DateTimeFormat.Active.DateTime);
}
}
diff --git a/src/Models/Tag.cs b/src/Models/Tag.cs
index 20678530..87944637 100644
--- a/src/Models/Tag.cs
+++ b/src/Models/Tag.cs
@@ -5,8 +5,7 @@ namespace SourceGit.Models
public enum TagSortMode
{
CreatorDate = 0,
- NameInAscending,
- NameInDescending,
+ Name,
}
public class Tag : ObservableObject
diff --git a/src/Models/Watcher.cs b/src/Models/Watcher.cs
index 928951ca..ccdc645f 100644
--- a/src/Models/Watcher.cs
+++ b/src/Models/Watcher.cs
@@ -157,7 +157,7 @@ namespace SourceGit.Models
if (string.IsNullOrEmpty(e.Name))
return;
- var name = e.Name.Replace("\\", "/");
+ var name = e.Name.Replace('\\', '/').TrimEnd('/');
if (name.Contains("fsmonitor--daemon/", StringComparison.Ordinal) ||
name.EndsWith(".lock", StringComparison.Ordinal) ||
name.StartsWith("lfs/", StringComparison.Ordinal))
@@ -205,7 +205,7 @@ namespace SourceGit.Models
if (string.IsNullOrEmpty(e.Name))
return;
- var name = e.Name.Replace("\\", "/");
+ var name = e.Name.Replace('\\', '/').TrimEnd('/');
if (name.Equals(".git", StringComparison.Ordinal) ||
name.StartsWith(".git/", StringComparison.Ordinal) ||
name.EndsWith("/.git", StringComparison.Ordinal))
diff --git a/src/Models/Worktree.cs b/src/Models/Worktree.cs
index 3f954650..26f88a8a 100644
--- a/src/Models/Worktree.cs
+++ b/src/Models/Worktree.cs
@@ -23,7 +23,7 @@ namespace SourceGit.Models
get
{
if (IsDetached)
- return $"deteched HEAD at {Head.AsSpan(10)}";
+ return $"detached HEAD at {Head.AsSpan(10)}";
if (Branch.StartsWith("refs/heads/", StringComparison.Ordinal))
return Branch.Substring(11);
diff --git a/src/Native/Linux.cs b/src/Native/Linux.cs
index 2bdcf561..3f6de903 100644
--- a/src/Native/Linux.cs
+++ b/src/Native/Linux.cs
@@ -120,8 +120,8 @@ namespace SourceGit.Native
private string FindExecutable(string filename)
{
var pathVariable = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
- var pathes = pathVariable.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries);
- foreach (var path in pathes)
+ var paths = pathVariable.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries);
+ foreach (var path in paths)
{
var test = Path.Combine(path, filename);
if (File.Exists(test))
diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs
index 83b11c47..adca05f3 100644
--- a/src/Native/Windows.cs
+++ b/src/Native/Windows.cs
@@ -80,17 +80,17 @@ namespace SourceGit.Native
var p = IntPtrToPixelPoint(lParam);
GetWindowRect(hWnd, out var rcWindow);
- var borderThinkness = (int)(4 * window.RenderScaling);
+ var borderThickness = (int)(4 * window.RenderScaling);
int y = 1;
int x = 1;
- if (p.X >= rcWindow.left && p.X < rcWindow.left + borderThinkness)
+ if (p.X >= rcWindow.left && p.X < rcWindow.left + borderThickness)
x = 0;
- else if (p.X < rcWindow.right && p.X >= rcWindow.right - borderThinkness)
+ else if (p.X < rcWindow.right && p.X >= rcWindow.right - borderThickness)
x = 2;
- if (p.Y >= rcWindow.top && p.Y < rcWindow.top + borderThinkness)
+ if (p.Y >= rcWindow.top && p.Y < rcWindow.top + borderThickness)
y = 0;
- else if (p.Y < rcWindow.bottom && p.Y >= rcWindow.bottom - borderThinkness)
+ else if (p.Y < rcWindow.bottom && p.Y >= rcWindow.bottom - borderThickness)
y = 2;
var zone = y * 3 + x;
@@ -351,10 +351,10 @@ namespace SourceGit.Native
Microsoft.Win32.RegistryView.Registry64);
// VSCodium (system)
- var systemVScodium = localMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{88DA3577-054F-4CA1-8122-7D820494CFFB}_is1");
- if (systemVScodium != null)
+ var systemVSCodium = localMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{88DA3577-054F-4CA1-8122-7D820494CFFB}_is1");
+ if (systemVSCodium != null)
{
- return systemVScodium.GetValue("DisplayIcon") as string;
+ return systemVSCodium.GetValue("DisplayIcon") as string;
}
var currentUser = Microsoft.Win32.RegistryKey.OpenBaseKey(
diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml
index 9da3a51e..001c7ee7 100644
--- a/src/Resources/Icons.axaml
+++ b/src/Resources/Icons.axaml
@@ -89,7 +89,8 @@
M299 811 299 725 384 725 384 811 299 811M469 811 469 725 555 725 555 811 469 811M640 811 640 725 725 725 725 811 640 811M299 640 299 555 384 555 384 640 299 640M469 640 469 555 555 555 555 640 469 640M640 640 640 555 725 555 725 640 640 640M299 469 299 384 384 384 384 469 299 469M469 469 469 384 555 384 555 469 469 469M640 469 640 384 725 384 725 469 640 469M299 299 299 213 384 213 384 299 299 299M469 299 469 213 555 213 555 299 469 299M640 299 640 213 725 213 725 299 640 299Z
M64 363l0 204 265 0L329 460c0-11 6-18 14-20C349 437 355 437 362 441c93 60 226 149 226 149 33 22 34 60 0 82 0 0-133 89-226 149-14 9-32-3-32-18l-1-110L64 693l0 117c0 41 34 75 75 75l746 0c41 0 75-34 75-74L960 364c0-0 0-1 0-1L64 363zM64 214l0 75 650 0-33-80c-16-38-62-69-103-69l-440 0C97 139 64 173 64 214z
M683 409v204L1024 308 683 0v191c-413 0-427 526-427 526c117-229 203-307 427-307zm85 492H102V327h153s38-63 114-122H51c-28 0-51 27-51 61v697c0 34 23 61 51 61h768c28 0 51-27 51-61V614l-102 100v187z
- M841 627A43 43 0 00811 555h-299v85h196l-183 183A43 43 0 00555 896h299v-85h-196l183-183zM299 170H213v512H85l171 171 171-171H299zM725 128h-85c-18 0-34 11-40 28l-117 313h91L606 384h154l32 85h91l-117-313A43 43 0 00725 128zm-88 171 32-85h26l32 85h-90z
+ M841 627A43 43 0 00811 555h-299v85h196l-183 183A43 43 0 00555 896h299v-85h-196l183-183zM299 170H213v512H85l171 171 171-171H299zM725 128h-85c-18 0-34 11-40 28l-117 313h91L606 384h154l32 85h91l-117-313A43 43 0 00725 128zm-88 171 32-85h26l32 85h-90z
+ M512 0a512 512 0 01512 512 57 57 0 01-114 0 398 398 0 10-398 398 57 57 0 010 114A512 512 0 01512 0zm367 600 121 120a57 57 0 01-80 81l-40-40V967a57 57 0 01-50 57l-7 0a57 57 0 01-57-57v-205l-40 40a57 57 0 01-75 5l-5-5a57 57 0 01-0-80l120-121a80 80 0 01113-0zM512 272a57 57 0 0157 57V499h114a57 57 0 0156 50L740 556a57 57 0 01-57 57H512a57 57 0 01-57-57v-228a57 57 0 0150-57L512 272z
M640 96c-158 0-288 130-288 288 0 17 3 31 5 46L105 681 96 691V928h224v-96h96v-96h96v-95c38 18 82 31 128 31 158 0 288-130 288-288s-130-288-288-288zm0 64c123 0 224 101 224 224s-101 224-224 224a235 235 0 01-109-28l-8-4H448v96h-96v96H256v96H160v-146l253-254 12-11-3-17C419 417 416 400 416 384c0-123 101-224 224-224zm64 96a64 64 0 100 128 64 64 0 100-128z
M544 85c49 0 90 37 95 85h75a96 96 0 0196 89L811 267a32 32 0 01-28 32L779 299a32 32 0 01-32-28L747 267a32 32 0 00-28-32L715 235h-91a96 96 0 01-80 42H395c-33 0-62-17-80-42L224 235a32 32 0 00-32 28L192 267v576c0 16 12 30 28 32l4 0h128a32 32 0 0132 28l0 4a32 32 0 01-32 32h-128a96 96 0 01-96-89L128 843V267a96 96 0 0189-96L224 171h75a96 96 0 0195-85h150zm256 256a96 96 0 0196 89l0 7v405a96 96 0 01-89 96L800 939h-277a96 96 0 01-96-89L427 843v-405a96 96 0 0189-96L523 341h277zm-256-192H395a32 32 0 000 64h150a32 32 0 100-64z
m186 532 287 0 0 287c0 11 9 20 20 20s20-9 20-20l0-287 287 0c11 0 20-9 20-20s-9-20-20-20l-287 0 0-287c0-11-9-20-20-20s-20 9-20 20l0 287-287 0c-11 0-20 9-20 20s9 20 20 20z
diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml
index 3c900d42..032e5ce7 100644
--- a/src/Resources/Locales/de_DE.axaml
+++ b/src/Resources/Locales/de_DE.axaml
@@ -39,6 +39,7 @@
ALS UNVERÄNDERT ANGENOMMENE DATEIEN
KEINE ALS UNVERÄNDERT ANGENOMMENEN DATEIEN
ENTFERNEN
+ Aktualisieren
BINÄRE DATEI NICHT UNTERSTÜTZT!!!
Bisect
Abbrechen
@@ -550,7 +551,6 @@
Lokale Änderungen stashen & wieder anwenden
Auf:
Rebase:
- Aktualisieren
Remote hinzufügen
Remote bearbeiten
Name:
@@ -624,8 +624,7 @@
TAGS
NEUER TAG
Nach Erstellungsdatum
- Nach Namen (Aufsteigend)
- Nach Namen (Absteigend)
+ Nach Namen
Sortiere
Öffne im Terminal
Verwende relative Zeitangaben in Verlauf
@@ -767,7 +766,7 @@
UNSTAGED
STAGEN
ALLES STAGEN
- ALS UNVERÄNDERT ANGENOMMENE ANZEIGEN
+ ALS UNVERÄNDERT ANGENOMMENE ANZEIGEN
Template: ${0}$
ARBEITSPLATZ:
Arbeitsplätze konfigurieren...
diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml
index 4834aef9..afdff5da 100644
--- a/src/Resources/Locales/en_US.axaml
+++ b/src/Resources/Locales/en_US.axaml
@@ -35,6 +35,8 @@
FILES ASSUME UNCHANGED
NO FILES ASSUMED AS UNCHANGED
REMOVE
+ Load Image...
+ Refresh
BINARY FILE NOT SUPPORTED!!!
Bisect
Abort
@@ -561,7 +563,6 @@
Stash & reapply local changes
On:
Rebase:
- Refresh
Add Remote
Edit Remote
Name:
@@ -637,8 +638,7 @@
TAGS
New Tag
By Creator Date
- By Name (Ascending)
- By Name (Descending)
+ By Name
Sort
Open in Terminal
Use relative time in histories
@@ -791,7 +791,7 @@
UNSTAGED
STAGE
STAGE ALL
- VIEW ASSUME UNCHANGED
+ VIEW ASSUME UNCHANGED
Template: ${0}$
WORKSPACE:
Configure Workspaces...
diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml
index 36c60346..1d97cb6f 100644
--- a/src/Resources/Locales/es_ES.axaml
+++ b/src/Resources/Locales/es_ES.axaml
@@ -39,6 +39,7 @@
ARCHIVOS ASUMIDOS COMO SIN CAMBIOS
NO HAY ARCHIVOS ASUMIDOS COMO SIN CAMBIOS
REMOVER
+ Refrescar
¡ARCHIVO BINARIO NO SOPORTADO!
Bisect
Abortar
@@ -565,7 +566,6 @@
Stash & reaplicar cambios locales
En:
Rebase:
- Refrescar
Añadir Remoto
Editar Remoto
Nombre:
@@ -641,8 +641,7 @@
ETIQUETAS
NUEVA ETIQUETA
Por Fecha de Creación
- Por Nombre (Ascendiente)
- Por Nombre (Descendiente)
+ Por Nombre
Ordenar
Abrir en Terminal
Usar tiempo relativo en las historias
@@ -795,7 +794,7 @@
UNSTAGED
STAGE
STAGE TODO
- VER ASSUME UNCHANGED
+ VER ASSUME UNCHANGED
Plantilla: ${0}$
ESPACIO DE TRABAJO:
Configura Espacios de Trabajo...
diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml
index 25e6ca3e..635d74c2 100644
--- a/src/Resources/Locales/fr_FR.axaml
+++ b/src/Resources/Locales/fr_FR.axaml
@@ -39,6 +39,7 @@
FICHIERS PRÉSUMÉS INCHANGÉS
PAS DE FICHIERS PRÉSUMÉS INCHANGÉS
SUPPRIMER
+ Rafraîchir
FICHIER BINAIRE NON SUPPORTÉ !!!
Blâme
LE BLÂME SUR CE FICHIER N'EST PAS SUPPORTÉ!!!
@@ -532,7 +533,6 @@
Stash & réappliquer changements locaux
Sur :
Rebase :
- Rafraîchir
Ajouter dépôt distant
Modifier dépôt distant
Nom :
@@ -602,8 +602,7 @@
TAGS
NOUVEAU TAG
Par date de créateur
- Par nom (Croissant)
- Par nom (Décroissant)
+ Par nom
Trier
Ouvrir dans un terminal
Utiliser le temps relatif dans les historiques
@@ -734,7 +733,7 @@
NON INDEXÉ
INDEXER
INDEXER TOUT
- VOIR LES FICHIERS PRÉSUMÉS INCHANGÉS
+ VOIR LES FICHIERS PRÉSUMÉS INCHANGÉS
Modèle: ${0}$
ESPACE DE TRAVAIL :
Configurer les espaces de travail...
diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml
index 22c4e8fe..3aef0043 100644
--- a/src/Resources/Locales/it_IT.axaml
+++ b/src/Resources/Locales/it_IT.axaml
@@ -39,6 +39,7 @@
FILE ASSUNTI COME INVARIATI
NESSUN FILE ASSUNTO COME INVARIATO
RIMUOVI
+ Aggiorna
FILE BINARIO NON SUPPORTATO!!!
Biseca
Annulla
@@ -553,7 +554,6 @@
Stasha e Riapplica modifiche locali
Su:
Riallinea:
- Aggiorna
Aggiungi Remoto
Modifica Remoto
Nome:
@@ -628,8 +628,7 @@
TAG
NUOVO TAG
Per data di creazione
- Per nome (ascendente)
- Per nome (discendente)
+ Per nome
Ordina
Apri nel Terminale
Usa tempo relativo nello storico
@@ -777,7 +776,7 @@
NON IN STAGE
FAI LO STAGE
FAI LO STAGE DI TUTTO
- VISUALIZZA COME NON MODIFICATO
+ VISUALIZZA COME NON MODIFICATO
Template: ${0}$
WORKSPACE:
Configura Workspaces...
diff --git a/src/Resources/Locales/ja_JP.axaml b/src/Resources/Locales/ja_JP.axaml
index 945cf2d9..918a6b4d 100644
--- a/src/Resources/Locales/ja_JP.axaml
+++ b/src/Resources/Locales/ja_JP.axaml
@@ -39,6 +39,7 @@
変更されていないとみなされるファイル
変更されていないとみなされるファイルはありません
削除
+ 更新
バイナリファイルはサポートされていません!!!
Blame
BLAMEではこのファイルはサポートされていません!!!
@@ -531,7 +532,6 @@
ローカルの変更をスタッシュして再適用
On:
リベース:
- 更新
リモートを追加
リモートを編集
名前:
@@ -600,7 +600,7 @@
タグ
新しいタグを作成
作成者日時
- 名前 (昇順)
+ 名前
ソート
ターミナルで開く
履歴に相対時間を使用
@@ -731,7 +731,7 @@
未ステージのファイル
ステージへ移動
すべてステージへ移動
- 変更されていないとみなしたものを表示
+ 変更されていないとみなしたものを表示
テンプレート: ${0}$
ワークスペース:
ワークスペースを設定...
diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml
index a75d6777..f448a908 100644
--- a/src/Resources/Locales/pt_BR.axaml
+++ b/src/Resources/Locales/pt_BR.axaml
@@ -33,6 +33,7 @@
ARQUIVOS CONSIDERADOS SEM ALTERAÇÕES
NENHUM ARQUIVO CONSIDERADO SEM ALTERAÇÕES
REMOVER
+ Atualizar
ARQUIVO BINÁRIO NÃO SUPORTADO!!!
Blame
BLAME NESTE ARQUIVO NÃO É SUPORTADO!!!
@@ -488,7 +489,6 @@
Guardar & reaplicar alterações locais
Em:
Rebase:
- Atualizar
Adicionar Remoto
Editar Remoto
Nome:
@@ -667,7 +667,7 @@
UNSTAGED
STAGE
STAGE TODOS
- VER SUPOR NÃO ALTERADO
+ VER SUPOR NÃO ALTERADO
Template: ${0}$
Workspaces:
Configurar workspaces...
diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml
index 0a6ccba4..a625df98 100644
--- a/src/Resources/Locales/ru_RU.axaml
+++ b/src/Resources/Locales/ru_RU.axaml
@@ -39,6 +39,8 @@
НЕОТСЛЕЖИВАЕМЫЕ ФАЙЛЫ
СПИСОК ПУСТ
УДАЛИТЬ
+ Загрузить картинку...
+ Обновить
ДВОИЧНЫЙ ФАЙЛ НЕ ПОДДЕРЖИВАЕТСЯ!!!
Раздвоить
О
@@ -50,6 +52,7 @@
Расследование
РАССЛЕДОВАНИЕ В ЭТОМ ФАЙЛЕ НЕ ПОДДЕРЖИВАЕТСЯ!!!
Переключиться на ${0}$...
+ Сравнить с ${0}$
Сравнить с рабочим каталогом
Копировать имя ветки
Изменить действие
@@ -564,7 +567,6 @@
Отложить и применить повторно локальные изменения
На:
Переместить:
- Обновить
Добавить внешний репозиторий
Редактировать внешний репозиторий
Имя:
@@ -592,6 +594,7 @@
Очистить (Сбор мусора и удаление)
Запустить команду (git gc) для данного репозитория.
Очистить всё
+ Очистить
Настройка репозитория
ПРОДОЛЖИТЬ
Изменить действия
@@ -639,8 +642,7 @@
МЕТКИ
НОВАЯ МЕТКА
По дате создания
- По имени (по возрастанию)
- По имени (по убыванию)
+ По имени
Сортировать
Открыть в терминале
Использовать относительное время в историях
@@ -784,6 +786,7 @@
ВКЛЮЧИТЬ НЕОТСЛЕЖИВАЕМЫЕ ФАЙЛЫ
НЕТ ПОСЛЕДНИХ ВХОДНЫХ СООБЩЕНИЙ
НЕТ ШАБЛОНОВ РЕВИЗИИ
+ Сбросить автора
Щёлкните правой кнопкой мыши выбранный файл(ы) и разрешите конфликты.
Завершение работы
СФОРМИРОВАННЫЕ
@@ -792,7 +795,7 @@
НЕСФОРМИРОВАННЫЕ
СФОРМИРОВАТЬ
СФОРМИРОВАТЬ ВСЁ
- ОТКРЫТЬ СПИСОК НЕОТСЛЕЖИВАЕМЫХ ФАЙЛОВ
+ ОТКРЫТЬ СПИСОК НЕОТСЛЕЖИВАЕМЫХ ФАЙЛОВ
Шаблон: ${0}$
РАБОЧЕЕ ПРОСТРАНСТВО:
Настройка рабочего пространства...
diff --git a/src/Resources/Locales/ta_IN.axaml b/src/Resources/Locales/ta_IN.axaml
index e66af3ff..abe53252 100644
--- a/src/Resources/Locales/ta_IN.axaml
+++ b/src/Resources/Locales/ta_IN.axaml
@@ -39,6 +39,7 @@
கோப்புகள் மாற்றப்படவில்லை எனக் கருதப்படுகிறது
எந்த கோப்புகளும் மாற்றப்படவில்லை எனக் கருதப்படுகிறது
நீக்கு
+ புதுப்பி
இருமம் கோப்பு ஆதரிக்கப்படவில்லை!!!
குற்றச்சாட்டு
இந்த கோப்பில் குற்றம் சாட்ட ஆதரிக்கப்படவில்லை!!!
@@ -531,7 +532,6 @@
உள்ளக மாற்றங்களை பதுக்கிவை & மீண்டும் இடு
மேல்:
மறுதளம்:
- புதுப்பி
தொலையைச் சேர்
தொலையைத் திருத்து
பெயர்:
@@ -601,8 +601,7 @@
குறிசொற்கள்
புதிய குறிசொல்
படைப்பாளர் தேதியின்படி
- பெயர் (ஏறுவரிசை) மூலம்
- பெயர் (இறகுவரிசை) மூலம்
+ பெயர் மூலம்
வரிசைப்படுத்து
முனையத்தில் திற
வரலாறுகளில் உறவு நேரத்தைப் பயன்படுத்து
@@ -733,7 +732,7 @@
நிலைநீக்கு
நிலைபடுத்து
அனைத்தும் நிலைபடுத்து
- மாறாதது எனநினைப்பதை பார்
+ மாறாதது எனநினைப்பதை பார்
வளர்புரு: ${0}$
பணியிடம்:
பணியிடங்களை உள்ளமை...
diff --git a/src/Resources/Locales/uk_UA.axaml b/src/Resources/Locales/uk_UA.axaml
index 2e7b399b..096b4398 100644
--- a/src/Resources/Locales/uk_UA.axaml
+++ b/src/Resources/Locales/uk_UA.axaml
@@ -39,6 +39,7 @@
ФАЙЛИ, ЩО ВВАЖАЮТЬСЯ НЕЗМІНЕНИМИ
НЕМАЄ ФАЙЛІВ, ЩО ВВАЖАЮТЬСЯ НЕЗМІНЕНИМИ
ВИДАЛИТИ
+ Оновити
БІНАРНИЙ ФАЙЛ НЕ ПІДТРИМУЄТЬСЯ!!!
Автор рядка
ПОШУК АВТОРА РЯДКА ДЛЯ ЦЬОГО ФАЙЛУ НЕ ПІДТРИМУЄТЬСЯ!!!
@@ -536,7 +537,6 @@
Сховати та застосувати локальні зміни
На:
Перебазувати:
- Оновити
Додати віддалене сховище
Редагувати віддалене сховище
Назва:
@@ -606,8 +606,7 @@
ТЕГИ
НОВИЙ ТЕГ
За датою створення
- За назвою (за зростанням)
- За назвою (за спаданням)
+ За назвою
Сортувати
Відкрити в терміналі
Використовувати відносний час в історії
@@ -743,7 +742,7 @@
НЕПРОІНДЕКСОВАНІ
ІНДЕКСУВАТИ
ІНДЕКСУВАТИ ВСЕ
- ПЕРЕГЛЯНУТИ ФАЙЛИ, ЩО ВВАЖАЮТЬСЯ НЕЗМІНЕНИМИ
+ ПЕРЕГЛЯНУТИ ФАЙЛИ, ЩО ВВАЖАЮТЬСЯ НЕЗМІНЕНИМИ
Шаблон: ${0}$
РОБОЧИЙ ПРОСТІР:
Налаштувати робочі простори...
diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml
index 77a55f75..c7e57c97 100644
--- a/src/Resources/Locales/zh_CN.axaml
+++ b/src/Resources/Locales/zh_CN.axaml
@@ -39,6 +39,8 @@
不跟踪更改的文件
没有不跟踪更改的文件
移除
+ 加载本地图片
+ 重新加载
二进制文件不支持该操作!!!
二分定位(bisect)
终止
@@ -565,7 +567,6 @@
自动贮藏并恢复本地变更
目标提交 :
分支 :
- 重新加载
添加远程仓库
编辑远程仓库
远程名 :
@@ -641,8 +642,7 @@
标签列表
新建标签
按创建时间
- 按名称(升序)
- 按名称(降序)
+ 按名称
排序
在终端中打开
在提交列表中使用相对时间
@@ -795,7 +795,7 @@
未暂存
暂存选中
暂存所有
- 查看忽略变更文件
+ 查看忽略变更文件
模板:${0}$
工作区:
配置工作区...
diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml
index aef769de..18a3b04e 100644
--- a/src/Resources/Locales/zh_TW.axaml
+++ b/src/Resources/Locales/zh_TW.axaml
@@ -39,6 +39,8 @@
不追蹤變更的檔案
沒有不追蹤變更的檔案
移除
+ 載入本機圖片...
+ 重新載入
二進位檔案不支援該操作!
二分搜尋 (bisect)
中止
@@ -565,7 +567,6 @@
自動擱置變更並復原本機變更
目標提交:
分支:
- 重新載入
新增遠端存放庫
編輯遠端存放庫
遠端名稱:
@@ -641,8 +642,7 @@
標籤列表
新增標籤
依建立時間
- 依名稱升序
- 依名稱降序
+ 依名稱
排序
在終端機中開啟
在提交列表中使用相對時間
@@ -795,7 +795,7 @@
未暫存
暫存選取的檔案
暫存所有檔案
- 檢視不追蹤變更的檔案
+ 檢視不追蹤變更的檔案
範本: ${0}$
工作區:
設定工作區...
diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml
index 923ef22b..42d9dc3e 100644
--- a/src/Resources/Styles.axaml
+++ b/src/Resources/Styles.axaml
@@ -843,6 +843,10 @@
+
+
+
+
@@ -949,6 +953,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
();
+ if (textDiffView == null)
+ return;
+
+ var presenter = textDiffView.FindDescendantOfType();
+ if (presenter == null)
+ return;
+
+ if (presenter.DataContext is Models.TextDiff combined)
+ combined.ScrollOffset = Vector.Zero;
+ else if (presenter.DataContext is ViewModels.TwoSideTextDiff twoSides)
+ twoSides.File = string.Empty; // Just to reset `SyncScrollOffset` without affect UI refresh.
+
+ (DataContext as ViewModels.DiffContext)?.ToggleFullTextDiff();
+ e.Handled = true;
+ }
}
}
diff --git a/src/Views/FileHistories.axaml b/src/Views/FileHistories.axaml
index e7a5c072..be0c91a0 100644
--- a/src/Views/FileHistories.axaml
+++ b/src/Views/FileHistories.axaml
@@ -139,7 +139,7 @@
-
+
+
+
+
+
+
+
diff --git a/src/Views/FileHistories.axaml.cs b/src/Views/FileHistories.axaml.cs
index 3631eb71..f0e001c8 100644
--- a/src/Views/FileHistories.axaml.cs
+++ b/src/Views/FileHistories.axaml.cs
@@ -25,11 +25,11 @@ namespace SourceGit.Views
e.Handled = true;
}
- private void OnResetToSelectedRevision(object sender, RoutedEventArgs e)
+ private async void OnResetToSelectedRevision(object sender, RoutedEventArgs e)
{
if (sender is Button { DataContext: ViewModels.FileHistoriesSingleRevision single })
{
- single.ResetToSelectedRevision();
+ await single.ResetToSelectedRevision();
NotifyDonePanel.IsVisible = true;
}
diff --git a/src/Views/FilterModeInGraph.axaml b/src/Views/FilterModeInGraph.axaml
new file mode 100644
index 00000000..520a3836
--- /dev/null
+++ b/src/Views/FilterModeInGraph.axaml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Views/FilterModeInGraph.axaml.cs b/src/Views/FilterModeInGraph.axaml.cs
new file mode 100644
index 00000000..c3987f91
--- /dev/null
+++ b/src/Views/FilterModeInGraph.axaml.cs
@@ -0,0 +1,12 @@
+using Avalonia.Controls;
+
+namespace SourceGit.Views
+{
+ public partial class FilterModeInGraph : UserControl
+ {
+ public FilterModeInGraph()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Views/ImageDiffView.axaml b/src/Views/ImageDiffView.axaml
index c3e0f772..d0b79f57 100644
--- a/src/Views/ImageDiffView.axaml
+++ b/src/Views/ImageDiffView.axaml
@@ -44,7 +44,7 @@
-
+
@@ -79,7 +79,7 @@
-
+
@@ -115,7 +115,7 @@
-
+
diff --git a/src/Views/InitGitFlow.axaml b/src/Views/InitGitFlow.axaml
index 836e39a9..75fe696c 100644
--- a/src/Views/InitGitFlow.axaml
+++ b/src/Views/InitGitFlow.axaml
@@ -46,7 +46,7 @@
Height="26"
VerticalAlignment="Center"
CornerRadius="2"
- Text="{Binding FeturePrefix, Mode=TwoWay}"/>
+ Text="{Binding FeaturePrefix, Mode=TwoWay}"/>
-
+
-
-
+
+
+
+
+
+
+
diff --git a/src/Views/Preferences.axaml.cs b/src/Views/Preferences.axaml.cs
index 5c8fb7aa..85de6a14 100644
--- a/src/Views/Preferences.axaml.cs
+++ b/src/Views/Preferences.axaml.cs
@@ -415,6 +415,30 @@ namespace SourceGit.Views
e.Handled = true;
}
+ private void OnMoveSelectedCustomActionUp(object sender, RoutedEventArgs e)
+ {
+ if (SelectedCustomAction == null)
+ return;
+
+ var idx = ViewModels.Preferences.Instance.CustomActions.IndexOf(SelectedCustomAction);
+ if (idx > 0)
+ ViewModels.Preferences.Instance.CustomActions.Move(idx - 1, idx);
+
+ e.Handled = true;
+ }
+
+ private void OnMoveSelectedCustomActionDown(object sender, RoutedEventArgs e)
+ {
+ if (SelectedCustomAction == null)
+ return;
+
+ var idx = ViewModels.Preferences.Instance.CustomActions.IndexOf(SelectedCustomAction);
+ if (idx < ViewModels.Preferences.Instance.CustomActions.Count - 1)
+ ViewModels.Preferences.Instance.CustomActions.Move(idx + 1, idx);
+
+ e.Handled = true;
+ }
+
private void UpdateGitVersion()
{
GitVersion = Native.OS.GitVersionString;
diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml
index 21c1b780..0a196d99 100644
--- a/src/Views/Repository.axaml
+++ b/src/Views/Repository.axaml
@@ -229,7 +229,10 @@
Margin="8,0,0,0"
Click="OnOpenSortLocalBranchMenu"
ToolTip.Tip="{DynamicResource Text.Repository.BranchSort}">
-
+
+
+
+
@@ -259,7 +262,10 @@
Margin="8,0,0,0"
Click="OnOpenSortRemoteBranchMenu"
ToolTip.Tip="{DynamicResource Text.Repository.BranchSort}">
-
+
+
+
+
@@ -294,7 +300,10 @@
Margin="8,0,0,0"
Click="OnOpenSortTagMenu"
ToolTip.Tip="{DynamicResource Text.Repository.Tags.Sort}">
-
+
+
+
+
-
-
+
+
-
-
-
-
+
-
-
-
+
+
+
+
+
+
+
@@ -494,7 +509,7 @@
Height="28" Padding="8,0"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
ItemsSource="{Binding AvailableOpenAIServices}"
- SelectedItem="{Binding PreferedOpenAIService, Mode=TwoWay}">
+ SelectedItem="{Binding PreferredOpenAIService, Mode=TwoWay}">
diff --git a/src/Views/RevisionFileContentViewer.axaml b/src/Views/RevisionFileContentViewer.axaml
index 86393316..7dc6d384 100644
--- a/src/Views/RevisionFileContentViewer.axaml
+++ b/src/Views/RevisionFileContentViewer.axaml
@@ -23,6 +23,7 @@
@@ -38,7 +39,7 @@
-
+
@@ -68,6 +69,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Views/RevisionFileContentViewer.axaml.cs b/src/Views/RevisionFileContentViewer.axaml.cs
index 16f4fc83..4a6f69b0 100644
--- a/src/Views/RevisionFileContentViewer.axaml.cs
+++ b/src/Views/RevisionFileContentViewer.axaml.cs
@@ -24,6 +24,15 @@ namespace SourceGit.Views
set => SetValue(TabWidthProperty, value);
}
+ public static readonly StyledProperty UseSyntaxHighlightingProperty =
+ AvaloniaProperty.Register(nameof(UseSyntaxHighlighting));
+
+ public bool UseSyntaxHighlighting
+ {
+ get => GetValue(UseSyntaxHighlightingProperty);
+ set => SetValue(UseSyntaxHighlightingProperty, value);
+ }
+
protected override Type StyleKeyOverride => typeof(TextEditor);
public RevisionTextFileView() : base(new TextArea(), new TextDocument())
@@ -72,8 +81,9 @@ namespace SourceGit.Views
if (DataContext is Models.RevisionTextFile source)
{
- UpdateTextMate();
Text = source.Content;
+ Models.TextMateHelper.SetGrammarByFileName(_textMate, source.FileName);
+ ScrollToHome();
}
else
{
@@ -86,9 +96,9 @@ namespace SourceGit.Views
base.OnPropertyChanged(change);
if (change.Property == TabWidthProperty)
- {
Options.IndentationSize = TabWidth;
- }
+ else if (change.Property == UseSyntaxHighlightingProperty)
+ UpdateTextMate();
}
private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e)
@@ -124,11 +134,22 @@ namespace SourceGit.Views
private void UpdateTextMate()
{
- if (_textMate == null)
- _textMate = Models.TextMateHelper.CreateForEditor(this);
+ if (UseSyntaxHighlighting)
+ {
+ if (_textMate == null)
+ _textMate = Models.TextMateHelper.CreateForEditor(this);
- if (DataContext is Models.RevisionTextFile file)
- Models.TextMateHelper.SetGrammarByFileName(_textMate, file.FileName);
+ if (DataContext is Models.RevisionTextFile file)
+ Models.TextMateHelper.SetGrammarByFileName(_textMate, file.FileName);
+ }
+ else if (_textMate != null)
+ {
+ _textMate.Dispose();
+ _textMate = null;
+ GC.Collect();
+
+ TextArea.TextView.Redraw();
+ }
}
private TextMate.Installation _textMate = null;
diff --git a/src/Views/RevisionFileTreeView.axaml.cs b/src/Views/RevisionFileTreeView.axaml.cs
index b671851c..410f747e 100644
--- a/src/Views/RevisionFileTreeView.axaml.cs
+++ b/src/Views/RevisionFileTreeView.axaml.cs
@@ -313,16 +313,13 @@ namespace SourceGit.Views
private void OnRowsSelectionChanged(object sender, SelectionChangedEventArgs _)
{
- if (_disableSelectionChangingEvent)
+ if (_disableSelectionChangingEvent || DataContext is not ViewModels.CommitDetail vm)
return;
- if (sender is ListBox { SelectedItem: ViewModels.RevisionFileTreeNode node } && DataContext is ViewModels.CommitDetail vm)
- {
- if (!node.IsFolder)
- vm.ViewRevisionFile(node.Backend);
- else
- vm.ViewRevisionFile(null);
- }
+ if (sender is ListBox { SelectedItem: ViewModels.RevisionFileTreeNode { IsFolder: false } node })
+ vm.ViewRevisionFile(node.Backend);
+ else
+ vm.ViewRevisionFile(null);
}
private List GetChildrenOfTreeNode(ViewModels.RevisionFileTreeNode node)
diff --git a/src/Views/RevisionFiles.axaml b/src/Views/RevisionFiles.axaml
index 6575dc66..b4bd3354 100644
--- a/src/Views/RevisionFiles.axaml
+++ b/src/Views/RevisionFiles.axaml
@@ -2,6 +2,7 @@
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"
xmlns:v="using:SourceGit.Views"
xmlns:c="using:SourceGit.Converters"
@@ -113,7 +114,39 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Views/Statistics.axaml b/src/Views/Statistics.axaml
index a2d18393..163ce031 100644
--- a/src/Views/Statistics.axaml
+++ b/src/Views/Statistics.axaml
@@ -136,7 +136,7 @@
-
+