From a3a3a0e4e9c1bca482a6aaac071080653d80ec08 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 28 Jul 2024 10:11:10 +0800 Subject: [PATCH] enhance: add a button to clear git.http.proxy configuration --- src/ViewModels/RepositoryConfigure.cs | 10 ++++++++-- src/Views/RepositoryConfigure.axaml | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ViewModels/RepositoryConfigure.cs b/src/ViewModels/RepositoryConfigure.cs index bad30749..d8626842 100644 --- a/src/ViewModels/RepositoryConfigure.cs +++ b/src/ViewModels/RepositoryConfigure.cs @@ -37,8 +37,8 @@ namespace SourceGit.ViewModels public string HttpProxy { - get; - set; + get => _httpProxy; + set => SetProperty(ref _httpProxy, value); } public RepositoryConfigure(Repository repo) @@ -60,6 +60,11 @@ namespace SourceGit.ViewModels HttpProxy = proxy; } + public void ClearHttpProxy() + { + HttpProxy = string.Empty; + } + public void Save() { SetIfChanged("user.name", UserName); @@ -90,5 +95,6 @@ namespace SourceGit.ViewModels private readonly Repository _repo = null; private readonly Dictionary _cached = null; + private string _httpProxy; } } diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index 38f6dc87..e1872458 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -77,7 +77,13 @@ Height="28" CornerRadius="3" Watermark="{DynamicResource Text.Configure.Proxy.Placeholder}" - Text="{Binding HttpProxy, Mode=TwoWay}"/> + Text="{Binding HttpProxy, Mode=TwoWay}"> + + + +