mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
feature: add hotkey 'F5' to reload/refresh whole repository
This commit is contained in:
parent
28554d1b04
commit
9b5e8429b9
5 changed files with 31 additions and 12 deletions
|
@ -211,6 +211,7 @@
|
||||||
<x:String x:Key="Text.Hotkeys.Global.GotoNextTab" xml:space="preserve">Go to next page</x:String>
|
<x:String x:Key="Text.Hotkeys.Global.GotoNextTab" xml:space="preserve">Go to next page</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Global.NewTab" xml:space="preserve">Create new page</x:String>
|
<x:String x:Key="Text.Hotkeys.Global.NewTab" xml:space="preserve">Create new page</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo" xml:space="preserve">REPOSITORY</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo" xml:space="preserve">REPOSITORY</x:String>
|
||||||
|
<x:String x:Key="Text.Hotkeys.Repo.Refresh" xml:space="preserve">Force to reload this repository</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.StageOrUnstageSelected" xml:space="preserve">Stage/Unstage selected changes</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.StageOrUnstageSelected" xml:space="preserve">Stage/Unstage selected changes</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.ToggleSearch" xml:space="preserve">Toggle commit search</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.ToggleSearch" xml:space="preserve">Toggle commit search</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.ViewChanges" xml:space="preserve">Switch to 'Changes'</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.ViewChanges" xml:space="preserve">Switch to 'Changes'</x:String>
|
||||||
|
|
|
@ -211,6 +211,7 @@
|
||||||
<x:String x:Key="Text.Hotkeys.Global.GotoNextTab" xml:space="preserve">切换到下一个页面</x:String>
|
<x:String x:Key="Text.Hotkeys.Global.GotoNextTab" xml:space="preserve">切换到下一个页面</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Global.NewTab" xml:space="preserve">新建页面</x:String>
|
<x:String x:Key="Text.Hotkeys.Global.NewTab" xml:space="preserve">新建页面</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo" xml:space="preserve">仓库页面快捷键</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo" xml:space="preserve">仓库页面快捷键</x:String>
|
||||||
|
<x:String x:Key="Text.Hotkeys.Repo.Refresh" xml:space="preserve">重新加载仓库状态</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.StageOrUnstageSelected" xml:space="preserve">将选中的变更暂存或从暂存列表中移除</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.StageOrUnstageSelected" xml:space="preserve">将选中的变更暂存或从暂存列表中移除</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.ToggleSearch" xml:space="preserve">打开/关闭历史搜索</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.ToggleSearch" xml:space="preserve">打开/关闭历史搜索</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.ViewChanges" xml:space="preserve">显示本地更改</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.ViewChanges" xml:space="preserve">显示本地更改</x:String>
|
||||||
|
|
|
@ -233,17 +233,7 @@ namespace SourceGit.ViewModels
|
||||||
_inProgressContext = null;
|
_inProgressContext = null;
|
||||||
_hasUnsolvedConflicts = false;
|
_hasUnsolvedConflicts = false;
|
||||||
|
|
||||||
Task.Run(() =>
|
RefreshAll();
|
||||||
{
|
|
||||||
RefreshBranches();
|
|
||||||
RefreshTags();
|
|
||||||
RefreshCommits();
|
|
||||||
});
|
|
||||||
|
|
||||||
Task.Run(RefreshSubmodules);
|
|
||||||
Task.Run(RefreshWorkingCopyChanges);
|
|
||||||
Task.Run(RefreshStashes);
|
|
||||||
Task.Run(RefreshGitFlow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
|
@ -277,6 +267,21 @@ namespace SourceGit.ViewModels
|
||||||
_searchedCommits.Clear();
|
_searchedCommits.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RefreshAll()
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
RefreshBranches();
|
||||||
|
RefreshTags();
|
||||||
|
RefreshCommits();
|
||||||
|
});
|
||||||
|
|
||||||
|
Task.Run(RefreshSubmodules);
|
||||||
|
Task.Run(RefreshWorkingCopyChanges);
|
||||||
|
Task.Run(RefreshStashes);
|
||||||
|
Task.Run(RefreshGitFlow);
|
||||||
|
}
|
||||||
|
|
||||||
public void OpenInFileManager()
|
public void OpenInFileManager()
|
||||||
{
|
{
|
||||||
Native.OS.OpenInFileManager(_fullpath);
|
Native.OS.OpenInFileManager(_fullpath);
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:FontSizeModifyConverters.Increase}}"
|
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:FontSizeModifyConverters.Increase}}"
|
||||||
Margin="0,8"/>
|
Margin="0,8"/>
|
||||||
|
|
||||||
<Grid RowDefinitions="20,20,20,20,20" ColumnDefinitions="80,*">
|
<Grid RowDefinitions="20,20,20,20,20,20" ColumnDefinitions="80,*">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Classes="monospace bold" Text="Ctrl+F"/>
|
<TextBlock Grid.Row="0" Grid.Column="0" Classes="monospace bold" Text="Ctrl+F"/>
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.ToggleSearch}" />
|
<TextBlock Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.ToggleSearch}" />
|
||||||
|
|
||||||
|
@ -102,6 +102,9 @@
|
||||||
|
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" Classes="monospace bold" Text="SPACE"/>
|
<TextBlock Grid.Row="4" Grid.Column="0" Classes="monospace bold" Text="SPACE"/>
|
||||||
<TextBlock Grid.Row="4" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.StageOrUnstageSelected}" />
|
<TextBlock Grid.Row="4" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.StageOrUnstageSelected}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="5" Grid.Column="0" Classes="monospace bold" Text="F5"/>
|
||||||
|
<TextBlock Grid.Row="5" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.Refresh}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<TextBlock Text="{DynamicResource Text.Hotkeys.TextEditor}"
|
<TextBlock Text="{DynamicResource Text.Hotkeys.TextEditor}"
|
||||||
|
|
|
@ -146,6 +146,15 @@ namespace SourceGit.Views
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (e.Key == Key.F5)
|
||||||
|
{
|
||||||
|
if (vm.ActivePage.Data is ViewModels.Repository repo)
|
||||||
|
{
|
||||||
|
repo.RefreshAll();
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
base.OnKeyDown(e);
|
base.OnKeyDown(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue