- Unify audio/subtitle selection: single-select, auto-default, cross-file propagation by exact name - Show file size in queue, group divider and reordered columns in track table, drop accent highlight on row selection - Add cumulative progress bar (files finished, MB copied) to the stripping window - Add Windows toast notifications on stripping completion/cancel/error - Restart the app after settings are changed; Cancel no longer clears the queue, only closes the window - Add ConfigureAwait(false) throughout MkvService so concurrent strips don't starve the UI thread - Hardcode scan/strip concurrency (10/5) instead of exposing it in Settings
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Futonizer.Services;
|
|
|
|
/// <summary>
|
|
/// Fires native Windows notifications (via a transient tray icon's balloon
|
|
/// tip) to let the user know processing has finished, even if the app
|
|
/// window isn't focused.
|
|
/// </summary>
|
|
public static class NotificationService
|
|
{
|
|
public static void ShowToast(string title, string message)
|
|
{
|
|
try
|
|
{
|
|
Icon icon;
|
|
try
|
|
{
|
|
icon = System.Drawing.Icon.ExtractAssociatedIcon(Environment.ProcessPath!) ?? SystemIcons.Application;
|
|
}
|
|
catch
|
|
{
|
|
icon = SystemIcons.Application;
|
|
}
|
|
|
|
var notifyIcon = new NotifyIcon
|
|
{
|
|
Icon = icon,
|
|
Visible = true,
|
|
BalloonTipTitle = title,
|
|
BalloonTipText = message,
|
|
BalloonTipIcon = ToolTipIcon.Info,
|
|
};
|
|
|
|
notifyIcon.BalloonTipClosed += (_, _) => notifyIcon.Dispose();
|
|
notifyIcon.BalloonTipClicked += (_, _) => notifyIcon.Dispose();
|
|
notifyIcon.ShowBalloonTip(5000);
|
|
|
|
// Fallback in case neither event fires (e.g. notifications disabled).
|
|
_ = Task.Delay(10000).ContinueWith(_ => notifyIcon.Dispose());
|
|
}
|
|
catch
|
|
{
|
|
// Notifications are best-effort; never let a failure here affect the app.
|
|
}
|
|
}
|
|
}
|