mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
enhance: add a button to clear git.http.proxy configuration
This commit is contained in:
parent
20b45a1cf4
commit
a3a3a0e4e9
2 changed files with 15 additions and 3 deletions
|
@ -37,8 +37,8 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
public string HttpProxy
|
public string HttpProxy
|
||||||
{
|
{
|
||||||
get;
|
get => _httpProxy;
|
||||||
set;
|
set => SetProperty(ref _httpProxy, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RepositoryConfigure(Repository repo)
|
public RepositoryConfigure(Repository repo)
|
||||||
|
@ -60,6 +60,11 @@ namespace SourceGit.ViewModels
|
||||||
HttpProxy = proxy;
|
HttpProxy = proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearHttpProxy()
|
||||||
|
{
|
||||||
|
HttpProxy = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
SetIfChanged("user.name", UserName);
|
SetIfChanged("user.name", UserName);
|
||||||
|
@ -90,5 +95,6 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
private readonly Repository _repo = null;
|
private readonly Repository _repo = null;
|
||||||
private readonly Dictionary<string, string> _cached = null;
|
private readonly Dictionary<string, string> _cached = null;
|
||||||
|
private string _httpProxy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,13 @@
|
||||||
Height="28"
|
Height="28"
|
||||||
CornerRadius="3"
|
CornerRadius="3"
|
||||||
Watermark="{DynamicResource Text.Configure.Proxy.Placeholder}"
|
Watermark="{DynamicResource Text.Configure.Proxy.Placeholder}"
|
||||||
Text="{Binding HttpProxy, Mode=TwoWay}"/>
|
Text="{Binding HttpProxy, Mode=TwoWay}">
|
||||||
|
<TextBox.InnerRightContent>
|
||||||
|
<Button Classes="icon_button" IsVisible="{Binding HttpProxy, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" Command="{Binding ClearHttpProxy}">
|
||||||
|
<Path Width="16" Height="16" Margin="0,0,0,0" Data="{StaticResource Icons.Clear}" Fill="{DynamicResource Brush.FG1}"/>
|
||||||
|
</Button>
|
||||||
|
</TextBox.InnerRightContent>
|
||||||
|
</TextBox>
|
||||||
|
|
||||||
<TextBlock Grid.Row="3" Grid.Column="0"
|
<TextBlock Grid.Row="3" Grid.Column="0"
|
||||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||||
|
|
Loading…
Reference in a new issue