mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-29 16:14:59 +00:00
refactor: add a popup panel to show submodule updating status
This commit is contained in:
parent
069c78f213
commit
d0edc09b2e
8 changed files with 71 additions and 9 deletions
|
@ -306,16 +306,10 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private async void UpdateSubmodules(object sender, RoutedEventArgs e)
|
||||
private void UpdateSubmodules(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Repository repo)
|
||||
{
|
||||
repo.SetWatcherEnabled(false);
|
||||
iconSubmoduleUpdate.Classes.Add("rotating");
|
||||
await Task.Run(() => new Commands.Submodule(repo.FullPath).Update());
|
||||
iconSubmoduleUpdate.Classes.Remove("rotating");
|
||||
repo.SetWatcherEnabled(true);
|
||||
}
|
||||
repo.UpdateSubmodules();
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
|
17
src/Views/UpdateSubmodules.axaml
Normal file
17
src/Views/UpdateSubmodules.axaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.UpdateSubmodules"
|
||||
x:DataType="vm:UpdateSubmodules">
|
||||
<StackPanel Orientation="Vertical" Margin="8,0">
|
||||
<TextBlock FontSize="18"
|
||||
Classes="bold"
|
||||
Text="{DynamicResource Text.UpdateSubmodules}"/>
|
||||
<TextBlock Text="{DynamicResource Text.UpdateSubmodules.Tip}"
|
||||
Margin="0,16,0,0"
|
||||
HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
12
src/Views/UpdateSubmodules.axaml.cs
Normal file
12
src/Views/UpdateSubmodules.axaml.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using Avalonia.Controls;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class UpdateSubmodules : UserControl
|
||||
{
|
||||
public UpdateSubmodules()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue