Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit d5d2798

Browse files
committed
Report update submodule progress on status bar
1 parent 2820be9 commit d5d2798

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/GitHub.App/ViewModels/GitHubPane/PullRequestDetailViewModel.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,11 @@ async Task DoSyncSubmodules(object unused)
684684
usageTracker.IncrementCounter(x => x.NumberOfSyncSubmodules).Forget();
685685

686686
var writer = new StringWriter(CultureInfo.CurrentCulture);
687-
var complete = await pullRequestsService.SyncSubmodules(LocalRepository, writer.WriteLine);
687+
var complete = await pullRequestsService.SyncSubmodules(LocalRepository, line =>
688+
{
689+
writer.WriteLine(line);
690+
SetStatus(line);
691+
});
688692
if (!complete)
689693
{
690694
throw new ApplicationException(writer.ToString());
@@ -693,6 +697,27 @@ async Task DoSyncSubmodules(object unused)
693697
finally
694698
{
695699
IsBusy = false;
700+
SetStatus();
701+
}
702+
}
703+
704+
// HACK: This should probably be a `Status` property on `IPanePageViewModel`.
705+
void SetStatus(string line = null)
706+
{
707+
try
708+
{
709+
if (line != null)
710+
{
711+
VisualStudio.Services.Dte.StatusBar.Text = line;
712+
}
713+
else
714+
{
715+
VisualStudio.Services.Dte.StatusBar.Clear();
716+
}
717+
}
718+
catch (Exception e)
719+
{
720+
log.Error(e, "Error writing to StatusBar");
696721
}
697722
}
698723

0 commit comments

Comments
 (0)