Unione dell'ondata 5 (desktop M6, rifiniture M8): avvisi collegati una sola volta nella composizione condivisa per le due vesti
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mzbb6zeFTjT6Rp8b92AVkA
This commit is contained in:
62 files changed
+4168
-327
No files matched your search
@@ -1,8 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Febe.App;
|
||||
using Febe.Core.Alerts;
|
||||
using Febe.Desktop.Core;
|
||||
using Febe.Web.Native;
|
||||
using Microsoft.Win32;
|
||||
@@ -12,7 +10,8 @@ namespace Febe.Desktop;
|
||||
/// <summary>
|
||||
/// The native functions of Windows offered to the interface (spec §12): folder picker (<see cref="OpenFolderDialog"/>),
|
||||
/// «Mostra nella cartella» (<c>explorer.exe /select,"…"</c>), addresses in the default browser (shell execute), Windows
|
||||
/// notifications (balloon tips of the notification-area icon) and start with the computer
|
||||
/// notifications (balloon tips of the notification-area icon: the alerts of spec §13.3 arrive here through
|
||||
/// <see cref="NativeShellAlertChannel"/>, and «Invia una prova») and start with the computer
|
||||
/// (<c>HKCU\…\Run</c>, value <c>Febe</c>). Paths and addresses never come from the page: the web layer resolves them.
|
||||
/// </summary>
|
||||
internal sealed class WindowsShell(Dispatcher ui, Func<Window?> owner, Func<TrayIcon?> tray) : INativeShell
|
||||
@@ -107,19 +106,6 @@ internal sealed class WindowsShell(Dispatcher ui, Func<Window?> owner, Func<Tray
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Windows notifications for the alerts of spec §13.3 (Impostazioni ▸ Notifiche ▸ «Notifiche di Windows»).</summary>
|
||||
internal sealed class WindowsNotificationChannel(Dispatcher ui, Func<TrayIcon?> tray) : IAlertChannel
|
||||
{
|
||||
public bool IsEnabled(AlertSettings settings) => settings?.WindowsNotifications == true;
|
||||
|
||||
public Task SendAsync(FebeAlert alert, AlertSettings settings, CancellationToken ct)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(alert);
|
||||
var warning = alert.Kind is AlertKind.Verification or AlertKind.Disconnection or AlertKind.Throttle or AlertKind.DiskLow;
|
||||
return ui.InvokeAsync(() => tray()?.Notify(alert.Title, alert.Message, warning)).Task;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Data folder in use after a move, and a move asked for the next start (<see cref="DataFolderMove"/>), under
|
||||
/// <c>HKCU\Software\Febe</c>: values «CartellaDati» and «NuovaCartellaDati». The uninstaller reads the first to say
|
||||
|
||||
Reference in new issue
Block a user