mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-30 16:44:59 +00:00
refactor: move settings of repository, such as filters, commit message, from Preference
to each repository's gitdir.
* avoid invalid repository setting remains in preference.json * supports to restore tabs that not added to the Welcome page
This commit is contained in:
parent
56a42dd6e8
commit
7f389b2e6f
18 changed files with 187 additions and 209 deletions
|
@ -378,11 +378,9 @@ namespace SourceGit.Views
|
|||
|
||||
private void OnCommitSHAPointerPressed(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Blame blame)
|
||||
{
|
||||
var txt = sender as TextBlock;
|
||||
if (sender is TextBlock txt && DataContext is ViewModels.Blame blame)
|
||||
blame.NavigateToCommit(txt.Text);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -794,14 +794,14 @@
|
|||
<Border.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsZero}"/>
|
||||
<Binding Path="Filters.Count" Converter="{x:Static c:IntConverters.IsGreaterThanZero}"/>
|
||||
<Binding Path="Settings.Filters.Count" Converter="{x:Static c:IntConverters.IsGreaterThanZero}"/>
|
||||
</MultiBinding>
|
||||
</Border.IsVisible>
|
||||
|
||||
<Grid Height="28" ColumnDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Column="0" Margin="8,0,0,0" Classes="info_label" Text="{DynamicResource Text.Repository.FilterCommitPrefix}"/>
|
||||
|
||||
<ItemsControl Grid.Column="1" Margin="8,0,0,0" ItemsSource="{Binding Filters}">
|
||||
<ItemsControl Grid.Column="1" Margin="8,0,0,0" ItemsSource="{Binding Settings.Filters}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel Orientation="Horizontal" VerticalAlignment="Center"/>
|
||||
|
|
|
@ -253,11 +253,10 @@ namespace SourceGit.Views
|
|||
return;
|
||||
}
|
||||
|
||||
var gitDir = new Commands.QueryGitDir(root).Result();
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
var repo = ViewModels.Preference.AddRepository(root, gitDir);
|
||||
var node = ViewModels.Preference.FindOrAddNodeByRepositoryPath(repo.FullPath, parent, true);
|
||||
var normalizedPath = root.Replace("\\", "/");
|
||||
var node = ViewModels.Preference.FindOrAddNodeByRepositoryPath(normalizedPath, parent, true);
|
||||
launcher.OpenRepositoryInTab(node, page);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue