From 021aab84087fd348a56283fda640caa9c89ec054 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 16:07:40 +0800 Subject: [PATCH] enhance: add a button to clear all git command logs Signed-off-by: leo --- build/scripts/localization-check.js | 3 +-- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 3 ++- src/Resources/Locales/zh_TW.axaml | 3 ++- src/ViewModels/ViewLogs.cs | 6 ++++++ src/Views/ViewLogs.axaml | 11 ++++++++++- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/build/scripts/localization-check.js b/build/scripts/localization-check.js index fc27fd1b..8d636b5b 100644 --- a/build/scripts/localization-check.js +++ b/build/scripts/localization-check.js @@ -62,8 +62,7 @@ async function calculateTranslationRate() { // Add an empty line before the first x:String xmlStr = xmlStr.replace(' 0) { const progress = ((enUSKeys.size - missingKeys.length) / enUSKeys.size) * 100; diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 5d1bb7e1..1e92ae38 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -699,6 +699,7 @@ Use --remote option URL: Logs + CLEAR ALL Warning Welcome Page Create Group diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index cb99d6f0..0471285f 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -703,6 +703,7 @@ 启用 '--remote' 仓库地址 : 日志列表 + 清空日志 警告 起始页 新建分组 @@ -759,4 +760,4 @@ 锁定工作树 移除工作树 解除工作树锁定 - \ No newline at end of file + diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 2fa67983..edd8cf8c 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -703,6 +703,7 @@ 啟用 [--remote] 選項 存放庫網址: 日誌清單 + 清除所有日誌 警告 起始頁 新增群組 @@ -759,4 +760,4 @@ 鎖定工作區 移除工作區 解除鎖定工作區 - \ No newline at end of file + diff --git a/src/ViewModels/ViewLogs.cs b/src/ViewModels/ViewLogs.cs index 44c819ce..21ab81ab 100644 --- a/src/ViewModels/ViewLogs.cs +++ b/src/ViewModels/ViewLogs.cs @@ -21,6 +21,12 @@ namespace SourceGit.ViewModels _repo = repo; } + public void ClearAll() + { + SelectedLog = null; + Logs.Clear(); + } + private Repository _repo = null; private CommandLog _selectedLog = null; } diff --git a/src/Views/ViewLogs.axaml b/src/Views/ViewLogs.axaml index 8272078d..125caa22 100644 --- a/src/Views/ViewLogs.axaml +++ b/src/Views/ViewLogs.axaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:SourceGit.ViewModels" xmlns:v="using:SourceGit.Views" + xmlns:c="using:SourceGit.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.ViewLogs" x:DataType="vm:ViewLogs" @@ -13,7 +14,7 @@ Width="800" Height="500" CanResize="False" WindowStartupLocation="CenterOwner"> - + + + +