Compare commits

..

No commits in common. "4e57cd50cd53c773f5d1261eed88482381a45bee" and "6d1dfad8a1dc98dc19e73a4321e2cc536e8121ef" have entirely different histories.

16 changed files with 58 additions and 183 deletions

View file

@ -5,16 +5,16 @@ namespace SourceGit.Commands
{ {
public class Clean : Command public class Clean : Command
{ {
public Clean(string repo, bool includeIgnored) public Clean(string repo)
{ {
WorkingDirectory = repo; WorkingDirectory = repo;
Context = repo; Context = repo;
Args = includeIgnored ? "clean -qfdx" : "clean -qfd"; Args = "clean -qfd";
} }
public Clean(string repo, List<string> files) public Clean(string repo, List<string> files)
{ {
var builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append("clean -qfd --"); builder.Append("clean -qfd --");
foreach (var f in files) foreach (var f in files)
{ {

View file

@ -5,10 +5,10 @@ namespace SourceGit.Commands
{ {
public static class Discard public static class Discard
{ {
public static void All(string repo, bool includeIgnored) public static void All(string repo)
{ {
new Restore(repo).Exec(); new Restore(repo).Exec();
new Clean(repo, includeIgnored).Exec(); new Clean(repo).Exec();
} }
public static void Changes(string repo, List<Models.Change> changes) public static void Changes(string repo, List<Models.Change> changes)

View file

@ -4,12 +4,6 @@ namespace SourceGit.Models
{ {
public class RepositorySettings public class RepositorySettings
{ {
public string DefaultRemote
{
get;
set;
} = string.Empty;
public DealWithLocalChanges DealWithLocalChangesOnCheckoutBranch public DealWithLocalChanges DealWithLocalChangesOnCheckoutBranch
{ {
get; get;

View file

@ -138,7 +138,6 @@
<x:String x:Key="Text.Configure.Git" xml:space="preserve">GIT</x:String> <x:String x:Key="Text.Configure.Git" xml:space="preserve">GIT</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetch" xml:space="preserve">Fetch remotes automatically</x:String> <x:String x:Key="Text.Configure.Git.AutoFetch" xml:space="preserve">Fetch remotes automatically</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetchIntervalSuffix" xml:space="preserve">Minute(s)</x:String> <x:String x:Key="Text.Configure.Git.AutoFetchIntervalSuffix" xml:space="preserve">Minute(s)</x:String>
<x:String x:Key="Text.Configure.Git.DefaultRemote" xml:space="preserve">Default Remote</x:String>
<x:String x:Key="Text.Configure.IssueTracker" xml:space="preserve">ISSUE TRACKER</x:String> <x:String x:Key="Text.Configure.IssueTracker" xml:space="preserve">ISSUE TRACKER</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleGithub" xml:space="preserve">Add Sample Github Rule</x:String> <x:String x:Key="Text.Configure.IssueTracker.AddSampleGithub" xml:space="preserve">Add Sample Github Rule</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleJira" xml:space="preserve">Add Sample Jira Rule</x:String> <x:String x:Key="Text.Configure.IssueTracker.AddSampleJira" xml:space="preserve">Add Sample Jira Rule</x:String>
@ -224,7 +223,6 @@
<x:String x:Key="Text.Discard" xml:space="preserve">Discard Changes</x:String> <x:String x:Key="Text.Discard" xml:space="preserve">Discard Changes</x:String>
<x:String x:Key="Text.Discard.All" xml:space="preserve">All local changes in working copy.</x:String> <x:String x:Key="Text.Discard.All" xml:space="preserve">All local changes in working copy.</x:String>
<x:String x:Key="Text.Discard.Changes" xml:space="preserve">Changes:</x:String> <x:String x:Key="Text.Discard.Changes" xml:space="preserve">Changes:</x:String>
<x:String x:Key="Text.Discard.IncludeIgnored" xml:space="preserve">Include ignored files</x:String>
<x:String x:Key="Text.Discard.Total" xml:space="preserve">Total {0} changes will be discard</x:String> <x:String x:Key="Text.Discard.Total" xml:space="preserve">Total {0} changes will be discard</x:String>
<x:String x:Key="Text.Discard.Warning" xml:space="preserve">You can't undo this action!!!</x:String> <x:String x:Key="Text.Discard.Warning" xml:space="preserve">You can't undo this action!!!</x:String>
<x:String x:Key="Text.EditRepositoryNode.Bookmark" xml:space="preserve">Bookmark:</x:String> <x:String x:Key="Text.EditRepositoryNode.Bookmark" xml:space="preserve">Bookmark:</x:String>

View file

@ -141,7 +141,6 @@
<x:String x:Key="Text.Configure.Git" xml:space="preserve">GIT配置</x:String> <x:String x:Key="Text.Configure.Git" xml:space="preserve">GIT配置</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetch" xml:space="preserve">启用定时自动拉取远程更新</x:String> <x:String x:Key="Text.Configure.Git.AutoFetch" xml:space="preserve">启用定时自动拉取远程更新</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetchIntervalSuffix" xml:space="preserve">分钟</x:String> <x:String x:Key="Text.Configure.Git.AutoFetchIntervalSuffix" xml:space="preserve">分钟</x:String>
<x:String x:Key="Text.Configure.Git.DefaultRemote" xml:space="preserve">默认远程</x:String>
<x:String x:Key="Text.Configure.IssueTracker" xml:space="preserve">ISSUE追踪</x:String> <x:String x:Key="Text.Configure.IssueTracker" xml:space="preserve">ISSUE追踪</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleGithub" xml:space="preserve">新增匹配Github Issue规则</x:String> <x:String x:Key="Text.Configure.IssueTracker.AddSampleGithub" xml:space="preserve">新增匹配Github Issue规则</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleJira" xml:space="preserve">新增匹配Jira规则</x:String> <x:String x:Key="Text.Configure.IssueTracker.AddSampleJira" xml:space="preserve">新增匹配Jira规则</x:String>
@ -227,7 +226,6 @@
<x:String x:Key="Text.Discard" xml:space="preserve">放弃更改确认</x:String> <x:String x:Key="Text.Discard" xml:space="preserve">放弃更改确认</x:String>
<x:String x:Key="Text.Discard.All" xml:space="preserve">所有本地址未提交的修改。</x:String> <x:String x:Key="Text.Discard.All" xml:space="preserve">所有本地址未提交的修改。</x:String>
<x:String x:Key="Text.Discard.Changes" xml:space="preserve">变更 </x:String> <x:String x:Key="Text.Discard.Changes" xml:space="preserve">变更 </x:String>
<x:String x:Key="Text.Discard.IncludeIgnored" xml:space="preserve">包括所有已忽略的文件</x:String>
<x:String x:Key="Text.Discard.Total" xml:space="preserve">总计{0}项选中更改</x:String> <x:String x:Key="Text.Discard.Total" xml:space="preserve">总计{0}项选中更改</x:String>
<x:String x:Key="Text.Discard.Warning" xml:space="preserve">本操作不支持回退,请确认后继续!!!</x:String> <x:String x:Key="Text.Discard.Warning" xml:space="preserve">本操作不支持回退,请确认后继续!!!</x:String>
<x:String x:Key="Text.EditRepositoryNode.Bookmark" xml:space="preserve">书签 </x:String> <x:String x:Key="Text.EditRepositoryNode.Bookmark" xml:space="preserve">书签 </x:String>

View file

@ -141,7 +141,6 @@
<x:String x:Key="Text.Configure.Git" xml:space="preserve">Git 設定</x:String> <x:String x:Key="Text.Configure.Git" xml:space="preserve">Git 設定</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetch" xml:space="preserve">啟用定時自動提取 (fetch) 遠端更新</x:String> <x:String x:Key="Text.Configure.Git.AutoFetch" xml:space="preserve">啟用定時自動提取 (fetch) 遠端更新</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetchIntervalSuffix" xml:space="preserve">分鐘</x:String> <x:String x:Key="Text.Configure.Git.AutoFetchIntervalSuffix" xml:space="preserve">分鐘</x:String>
<x:String x:Key="Text.Configure.Git.DefaultRemote" xml:space="preserve">預設遠端存放庫</x:String>
<x:String x:Key="Text.Configure.IssueTracker" xml:space="preserve">Issue 追蹤</x:String> <x:String x:Key="Text.Configure.IssueTracker" xml:space="preserve">Issue 追蹤</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleGithub" xml:space="preserve">新增符合 GitHub Issue 規則</x:String> <x:String x:Key="Text.Configure.IssueTracker.AddSampleGithub" xml:space="preserve">新增符合 GitHub Issue 規則</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleJira" xml:space="preserve">新增符合 Jira 規則</x:String> <x:String x:Key="Text.Configure.IssueTracker.AddSampleJira" xml:space="preserve">新增符合 Jira 規則</x:String>
@ -227,7 +226,6 @@
<x:String x:Key="Text.Discard" xml:space="preserve">捨棄變更</x:String> <x:String x:Key="Text.Discard" xml:space="preserve">捨棄變更</x:String>
<x:String x:Key="Text.Discard.All" xml:space="preserve">所有本機未提交的變更。</x:String> <x:String x:Key="Text.Discard.All" xml:space="preserve">所有本機未提交的變更。</x:String>
<x:String x:Key="Text.Discard.Changes" xml:space="preserve">變更:</x:String> <x:String x:Key="Text.Discard.Changes" xml:space="preserve">變更:</x:String>
<x:String x:Key="Text.Discard.IncludeIgnored" xml:space="preserve">包括所有已忽略的檔案</x:String>
<x:String x:Key="Text.Discard.Total" xml:space="preserve">將捨棄總計 {0} 項已選取的變更</x:String> <x:String x:Key="Text.Discard.Total" xml:space="preserve">將捨棄總計 {0} 項已選取的變更</x:String>
<x:String x:Key="Text.Discard.Warning" xml:space="preserve">您無法復原此操作,請確認後再繼續!</x:String> <x:String x:Key="Text.Discard.Warning" xml:space="preserve">您無法復原此操作,請確認後再繼續!</x:String>
<x:String x:Key="Text.EditRepositoryNode.Bookmark" xml:space="preserve">書籤:</x:String> <x:String x:Key="Text.EditRepositoryNode.Bookmark" xml:space="preserve">書籤:</x:String>

View file

@ -7,6 +7,7 @@ namespace SourceGit.ViewModels
public string Branch public string Branch
{ {
get; get;
private set;
} }
public Models.DealWithLocalChanges PreAction public Models.DealWithLocalChanges PreAction
@ -48,7 +49,7 @@ namespace SourceGit.ViewModels
else if (PreAction == Models.DealWithLocalChanges.Discard) else if (PreAction == Models.DealWithLocalChanges.Discard)
{ {
SetProgressDescription("Discard local changes ..."); SetProgressDescription("Discard local changes ...");
Commands.Discard.All(_repo.FullPath, false); Commands.Discard.All(_repo.FullPath);
} }
} }

View file

@ -7,6 +7,7 @@ namespace SourceGit.ViewModels
public Models.Commit Commit public Models.Commit Commit
{ {
get; get;
private set;
} }
public bool AutoStash public bool AutoStash
@ -48,7 +49,7 @@ namespace SourceGit.ViewModels
else else
{ {
SetProgressDescription("Discard local changes ..."); SetProgressDescription("Discard local changes ...");
Commands.Discard.All(_repo.FullPath, false); Commands.Discard.All(_repo.FullPath);
} }
} }

View file

@ -17,6 +17,7 @@ namespace SourceGit.ViewModels
public object BasedOn public object BasedOn
{ {
get; get;
private set;
} }
public Models.DealWithLocalChanges PreAction public Models.DealWithLocalChanges PreAction
@ -104,7 +105,7 @@ namespace SourceGit.ViewModels
else if (PreAction == Models.DealWithLocalChanges.Discard) else if (PreAction == Models.DealWithLocalChanges.Discard)
{ {
SetProgressDescription("Discard local changes..."); SetProgressDescription("Discard local changes...");
Commands.Discard.All(_repo.FullPath, false); Commands.Discard.All(_repo.FullPath);
} }
} }

View file

@ -3,45 +3,19 @@ using System.Threading.Tasks;
namespace SourceGit.ViewModels namespace SourceGit.ViewModels
{ {
public class DiscardAllMode
{
public bool IncludeIgnored
{
get;
set;
} = false;
}
public class DiscardSingleFile
{
public string Path
{
get;
set;
} = string.Empty;
}
public class DiscardMultipleFiles
{
public int Count
{
get;
set;
} = 0;
}
public class Discard : Popup public class Discard : Popup
{ {
public object Mode public object Mode
{ {
get; get;
private set;
} }
public Discard(Repository repo) public Discard(Repository repo)
{ {
_repo = repo; _repo = repo;
Mode = new DiscardAllMode(); Mode = new Models.Null();
View = new Views.Discard { DataContext = this }; View = new Views.Discard { DataContext = this };
} }
@ -51,11 +25,11 @@ namespace SourceGit.ViewModels
_changes = changes; _changes = changes;
if (_changes == null) if (_changes == null)
Mode = new DiscardAllMode(); Mode = new Models.Null();
else if (_changes.Count == 1) else if (_changes.Count == 1)
Mode = new DiscardSingleFile() { Path = _changes[0].Path }; Mode = _changes[0].Path;
else else
Mode = new DiscardMultipleFiles() { Count = _changes.Count }; Mode = _changes.Count;
View = new Views.Discard() { DataContext = this }; View = new Views.Discard() { DataContext = this };
} }
@ -67,8 +41,8 @@ namespace SourceGit.ViewModels
return Task.Run(() => return Task.Run(() =>
{ {
if (Mode is DiscardAllMode all) if (_changes == null)
Commands.Discard.All(_repo.FullPath, all.IncludeIgnored); Commands.Discard.All(_repo.FullPath);
else else
Commands.Discard.Changes(_repo.FullPath, _changes); Commands.Discard.Changes(_repo.FullPath, _changes);

View file

@ -95,18 +95,7 @@ namespace SourceGit.ViewModels
} }
} }
if (autoSelectedRemote == null) _selectedRemote = autoSelectedRemote ?? repo.Remotes[0];
{
var remote = null as Models.Remote;
if (!string.IsNullOrEmpty(_repo.Settings.DefaultRemote))
remote = _repo.Remotes.Find(x => x.Name == _repo.Settings.DefaultRemote);
_selectedRemote = remote ?? _repo.Remotes[0];
}
else
{
_selectedRemote = autoSelectedRemote;
}
PostRemoteSelected(); PostRemoteSelected();
HasSpecifiedRemoteBranch = false; HasSpecifiedRemoteBranch = false;
} }
@ -139,11 +128,11 @@ namespace SourceGit.ViewModels
else if (PreAction == Models.DealWithLocalChanges.Discard) else if (PreAction == Models.DealWithLocalChanges.Discard)
{ {
SetProgressDescription("Discard local changes ..."); SetProgressDescription("Discard local changes ...");
Commands.Discard.All(_repo.FullPath, false); Commands.Discard.All(_repo.FullPath);
} }
} }
bool rs; var rs = false;
if (FetchAllBranches) if (FetchAllBranches)
{ {
SetProgressDescription($"Fetching remote: {_selectedRemote.Name}..."); SetProgressDescription($"Fetching remote: {_selectedRemote.Name}...");

View file

@ -137,15 +137,9 @@ namespace SourceGit.ViewModels
} }
} }
// Set default remote to the first if it has not been set. // Set default remote to the first if haven't been set.
if (_selectedRemote == null) if (_selectedRemote == null)
{ _selectedRemote = repo.Remotes[0];
var remote = null as Models.Remote;
if (!string.IsNullOrEmpty(_repo.Settings.DefaultRemote))
remote = repo.Remotes.Find(x => x.Name == _repo.Settings.DefaultRemote);
_selectedRemote = remote ?? repo.Remotes[0];
}
// Auto select preferred remote branch. // Auto select preferred remote branch.
AutoSelectBranchByRemote(); AutoSelectBranchByRemote();

View file

@ -1271,6 +1271,7 @@ namespace SourceGit.ViewModels
var discard = new MenuItem(); var discard = new MenuItem();
discard.Header = App.Text("BranchCM.DiscardAll"); discard.Header = App.Text("BranchCM.DiscardAll");
discard.Icon = App.CreateMenuIcon("Icons.Undo"); discard.Icon = App.CreateMenuIcon("Icons.Undo");
discard.IsEnabled = _localChangesCount > 0;
discard.Click += (_, e) => discard.Click += (_, e) =>
{ {
if (PopupHost.CanCreatePopup()) if (PopupHost.CanCreatePopup())

View file

@ -18,24 +18,6 @@ namespace SourceGit.ViewModels
set; set;
} }
public List<string> Remotes
{
get;
}
public string DefaultRemote
{
get => _repo.Settings.DefaultRemote;
set
{
if (_repo.Settings.DefaultRemote != value)
{
_repo.Settings.DefaultRemote = value;
OnPropertyChanged();
}
}
}
public bool GPGCommitSigningEnabled public bool GPGCommitSigningEnabled
{ {
get; get;
@ -106,10 +88,6 @@ namespace SourceGit.ViewModels
{ {
_repo = repo; _repo = repo;
Remotes = new List<string>();
foreach (var remote in _repo.Remotes)
Remotes.Add(remote.Name);
_cached = new Commands.Config(repo.FullPath).ListAll(); _cached = new Commands.Config(repo.FullPath).ListAll();
if (_cached.TryGetValue("user.name", out var name)) if (_cached.TryGetValue("user.name", out var name))
UserName = name; UserName = name;

View file

@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:m="using:SourceGit.Models"
xmlns:vm="using:SourceGit.ViewModels" xmlns:vm="using:SourceGit.ViewModels"
xmlns:c="using:SourceGit.Converters" xmlns:c="using:SourceGit.Converters"
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
@ -11,69 +12,35 @@
<TextBlock FontSize="18" <TextBlock FontSize="18"
Classes="bold" Classes="bold"
Text="{DynamicResource Text.Discard}"/> Text="{DynamicResource Text.Discard}"/>
<ContentControl Margin="0,16,0,8" Content="{Binding Mode}"> <Grid Margin="0,16,0,8" RowDefinitions="32,32" ColumnDefinitions="120,*">
<ContentControl.DataTemplates> <TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,8,0" HorizontalAlignment="Right" Text="{DynamicResource Text.Discard.Changes}"/>
<DataTemplate DataType="vm:DiscardAllMode"> <ContentControl Grid.Row="0" Grid.Column="1" Content="{Binding Mode}">
<Grid RowDefinitions="Auto,Auto,36" ColumnDefinitions="120,*"> <ContentControl.DataTemplates>
<TextBlock Grid.Row="0" Grid.Column="0" <DataTemplate DataType="m:Null">
Margin="0,0,8,0" <StackPanel Orientation="Horizontal">
HorizontalAlignment="Right" <Path Width="12" Height="12" Margin="0,2,0,0" Data="{StaticResource Icons.Folder.Open}"/>
Text="{DynamicResource Text.Discard.Changes}"/> <TextBlock Text="{DynamicResource Text.Discard.All}" Margin="4,0,0,0"/>
<TextBlock Grid.Row="0" Grid.Column="1"
Text="{DynamicResource Text.Discard.All}"/>
<CheckBox Grid.Row="1" Grid.Column="1"
Content="{DynamicResource Text.Discard.IncludeIgnored}"
IsChecked="{Binding IncludeIgnored, Mode=TwoWay}"/>
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
<Path Width="14" Height="14"
Data="{StaticResource Icons.Error}"
Fill="DarkOrange"/>
<TextBlock Margin="4,0,0,0"
Text="{DynamicResource Text.Discard.Warning}"
Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel> </StackPanel>
</Grid> </DataTemplate>
</DataTemplate>
<DataTemplate DataType="x:String">
<DataTemplate DataType="vm:DiscardSingleFile"> <StackPanel Orientation="Horizontal">
<Grid RowDefinitions="32,32" ColumnDefinitions="120,*">
<TextBlock Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
HorizontalAlignment="Right"
Text="{DynamicResource Text.Discard.Changes}"/>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
<Path Width="12" Height="12" Data="{StaticResource Icons.File}"/> <Path Width="12" Height="12" Data="{StaticResource Icons.File}"/>
<TextBlock Text="{Binding Path}" Margin="4,0,0,0"/> <TextBlock Text="{Binding}" Margin="4,0,0,0"/>
</StackPanel> </StackPanel>
</DataTemplate>
<TextBlock Grid.Row="1" Grid.Column="1"
VerticalAlignment="Center" <DataTemplate DataType="x:Int32">
Text="{DynamicResource Text.Discard.Warning}" <StackPanel Orientation="Horizontal">
Foreground="{DynamicResource Brush.FG2}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="vm:DiscardMultipleFiles">
<Grid RowDefinitions="32,32" ColumnDefinitions="120,*">
<TextBlock Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
HorizontalAlignment="Right"
Text="{DynamicResource Text.Discard.Changes}"/>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
<Path Width="12" Height="12" Data="{StaticResource Icons.File}"/> <Path Width="12" Height="12" Data="{StaticResource Icons.File}"/>
<TextBlock Text="{Binding Count, Converter={x:Static c:StringConverters.FormatByResourceKey}, ConverterParameter='Discard.Total'}" Margin="4,0,0,0"/> <TextBlock Text="{Binding Converter={x:Static c:StringConverters.FormatByResourceKey}, ConverterParameter='Discard.Total'}" Margin="4,0,0,0"/>
</StackPanel> </StackPanel>
</DataTemplate>
<TextBlock Grid.Row="1" Grid.Column="1" </ContentControl.DataTemplates>
VerticalAlignment="Center" </ContentControl>
Text="{DynamicResource Text.Discard.Warning}"
Foreground="{DynamicResource Brush.FG2}"/> <TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Text="{DynamicResource Text.Discard.Warning}" Foreground="{DynamicResource Brush.FG2}"/>
</Grid> </Grid>
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View file

@ -51,7 +51,7 @@
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Configure.Git}"/> <TextBlock Classes="tab_header" Text="{DynamicResource Text.Configure.Git}"/>
</TabItem.Header> </TabItem.Header>
<Grid Margin="16,4,16,8" RowDefinitions="32,32,32,32,32,32,32,32" ColumnDefinitions="Auto,*"> <Grid Margin="16,4,16,8" RowDefinitions="32,32,32,32,32,32,32" ColumnDefinitions="Auto,*">
<TextBlock Grid.Row="0" Grid.Column="0" <TextBlock Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0" Margin="0,0,8,0"
@ -72,31 +72,12 @@
CornerRadius="3" CornerRadius="3"
Watermark="{DynamicResource Text.Configure.Email.Placeholder}" Watermark="{DynamicResource Text.Configure.Email.Placeholder}"
Text="{Binding UserEmail, Mode=TwoWay}"/> Text="{Binding UserEmail, Mode=TwoWay}"/>
<TextBlock Grid.Row="2" Grid.Column="0" <TextBlock Grid.Row="2" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0"
Text="{DynamicResource Text.Configure.Git.DefaultRemote}"/>
<ComboBox Grid.Row="2" Grid.Column="1"
Height="28" Padding="8,0"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
ItemsSource="{Binding Remotes}"
SelectedItem="{Binding DefaultRemote, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
<TextBlock Text="{Binding}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="3" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{DynamicResource Text.Configure.Proxy}"/> Text="{DynamicResource Text.Configure.Proxy}"/>
<TextBox Grid.Row="3" Grid.Column="1" <TextBox Grid.Row="2" Grid.Column="1"
Height="28" Height="28"
CornerRadius="3" CornerRadius="3"
Watermark="{DynamicResource Text.Configure.Proxy.Placeholder}" Watermark="{DynamicResource Text.Configure.Proxy.Placeholder}"
@ -108,25 +89,25 @@
</TextBox.InnerRightContent> </TextBox.InnerRightContent>
</TextBox> </TextBox>
<TextBlock Grid.Row="4" Grid.Column="0" <TextBlock Grid.Row="3" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{DynamicResource Text.Preference.GPG.UserKey}"/> Text="{DynamicResource Text.Preference.GPG.UserKey}"/>
<TextBox Grid.Row="4" Grid.Column="1" <TextBox Grid.Row="3" Grid.Column="1"
Height="28" Height="28"
CornerRadius="3" CornerRadius="3"
Watermark="{DynamicResource Text.Preference.GPG.UserKey.Placeholder}" Watermark="{DynamicResource Text.Preference.GPG.UserKey.Placeholder}"
Text="{Binding GPGUserSigningKey, Mode=TwoWay}"/> Text="{Binding GPGUserSigningKey, Mode=TwoWay}"/>
<CheckBox Grid.Row="5" Grid.Column="1" <CheckBox Grid.Row="4" Grid.Column="1"
Content="{DynamicResource Text.Preference.GPG.CommitEnabled}" Content="{DynamicResource Text.Preference.GPG.CommitEnabled}"
IsChecked="{Binding GPGCommitSigningEnabled, Mode=TwoWay}"/> IsChecked="{Binding GPGCommitSigningEnabled, Mode=TwoWay}"/>
<CheckBox Grid.Row="6" Grid.Column="1" <CheckBox Grid.Row="5" Grid.Column="1"
Content="{DynamicResource Text.Preference.GPG.TagEnabled}" Content="{DynamicResource Text.Preference.GPG.TagEnabled}"
IsChecked="{Binding GPGTagSigningEnabled, Mode=TwoWay}"/> IsChecked="{Binding GPGTagSigningEnabled, Mode=TwoWay}"/>
<StackPanel Grid.Row="7" Grid.Column="1" Orientation="Horizontal"> <StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal">
<CheckBox x:Name="AutoFetchCheckBox" <CheckBox x:Name="AutoFetchCheckBox"
Content="{DynamicResource Text.Configure.Git.AutoFetch}" Content="{DynamicResource Text.Configure.Git.AutoFetch}"
IsChecked="{Binding EnableAutoFetch, Mode=TwoWay}"/> IsChecked="{Binding EnableAutoFetch, Mode=TwoWay}"/>