Skip to content

Commit

Permalink
WaitForExitOtherProcessesメソッドでOutProcessDialog.Showを使うようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd committed Feb 10, 2024
1 parent 939b5e9 commit 404ef37
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/Beutl/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Avalonia.ReactiveUI;

using Beutl.Configuration;
using Beutl.Helpers;
using Beutl.Rendering;
using Beutl.Services;

Expand Down Expand Up @@ -47,29 +48,22 @@ private static void WaitForExitOtherProcesses()
Process[] processes = Process.GetProcessesByName("Beutl.PackageTools");
if (processes.Length > 0)
{
var startInfo = new ProcessStartInfo(Path.Combine(AppContext.BaseDirectory, "Beutl.WaitingDialog"))
using (OutProcessDialog.Show(
Message.OpeningBeutl,
Message.Changes_to_the_package_are_in_progress,
Message.To_open_Beutl_close_Beutl_PackageTools,
icon: "Info",
progress: true))
{
ArgumentList =
{
"--title", Message.OpeningBeutl,
"--subtitle", Message.Changes_to_the_package_are_in_progress,
"--content", Message.To_open_Beutl_close_Beutl_PackageTools,
"--icon", "Info",
"--progress"
}
};

var process = Process.Start(startInfo);

foreach (Process item in processes)
{
if (!item.HasExited)
foreach (Process item in processes)
{
item.WaitForExit();
if (!item.HasExited)
{
item.WaitForExit();
}
}
}

process?.Kill();
}
}

Expand Down

0 comments on commit 404ef37

Please sign in to comment.