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
@@ -92,7 +92,7 @@ internal sealed class DesktopApplication : Application
|
||||
}
|
||||
|
||||
var native = new WindowsShell(Dispatcher, () => _main, () => _tray);
|
||||
var shell = new DesktopShell(Dispatcher, _iconImage, native, new WindowsNotificationChannel(Dispatcher, () => _tray));
|
||||
var shell = new DesktopShell(Dispatcher, _iconImage, native);
|
||||
_platform = new DesktopPlatform(_options, shell, _locations, _dataFolderFixed);
|
||||
_app = await FebeApp.StartAsync(_options.AppOptions(_dataFolder, _folders), _platform, new FebeAppHooks(), _lifetime.Token).ConfigureAwait(true);
|
||||
if (moved?.Message is { } outcome)
|
||||
|
||||
@@ -12,13 +12,11 @@ using Microsoft.Win32;
|
||||
|
||||
namespace Febe.Desktop;
|
||||
|
||||
/// <summary>The Windows-only part the desktop platform needs (WebView2, Edge's window, native shell, notifications).</summary>
|
||||
internal sealed class DesktopShell(Dispatcher ui, ImageSource? icon, INativeShell native, IAlertChannel notifications) : IDesktopShell
|
||||
/// <summary>The Windows-only part the desktop platform needs (WebView2, Edge's window, native shell with notifications).</summary>
|
||||
internal sealed class DesktopShell(Dispatcher ui, ImageSource? icon, INativeShell native) : IDesktopShell
|
||||
{
|
||||
public INativeShell Native { get; } = native;
|
||||
|
||||
public IAlertChannel? Notifications { get; } = notifications;
|
||||
|
||||
public string? WebView2Version()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -16,8 +16,8 @@ L'eseguibile per Windows (WPF, `net10.0-windows`; specifica §5, §12). Si compi
|
||||
| `Browser/BrowserWindow.cs` | La finestra «Browser di Febe»: pagina a misura fissa, barra con Indietro, Ricarica e indirizzo; chiudere = fuori vista |
|
||||
| `Browser/CoreWebView2DevTools.cs` | Le due chiamate di WebView2 per il CDP, sul thread dell'interfaccia (`IWebView2DevTools`) |
|
||||
| `Browser/CompositionHost.cs` | Secondo tentativo di S2 (`--browser composizione`): visual di DirectComposition, mouse e puntatore inoltrati |
|
||||
| `DesktopShell.cs` | `IDesktopShell`: sonda del runtime WebView2, Edge e la sua finestra (terzo tentativo di S2), notifiche |
|
||||
| `WindowsShell.cs` | `INativeShell` (cartelle, Esplora risorse, browser predefinito, notifiche, avvio con il computer), canale degli avvisi, posizione della cartella dei dati nel registro |
|
||||
| `DesktopShell.cs` | `IDesktopShell`: sonda del runtime WebView2, Edge e la sua finestra (terzo tentativo di S2), guscio nativo |
|
||||
| `WindowsShell.cs` | `INativeShell` (cartelle, Esplora risorse, browser predefinito, notifiche, avvio con il computer: le notifiche sono il canale «notifica di Windows» degli avvisi, che `FebeApp` collega con `NativeShellAlertChannel`), posizione della cartella dei dati nel registro |
|
||||
| `TrayIcon.cs` | Icona nell'area di notifica (Windows Forms `NotifyIcon`): Apri, Metti in pausa/Riprendi, Esci, notifiche |
|
||||
| `SingleInstanceGuard.cs` | Mutex con nome e pipe (solo l'utente corrente) per l'istanza unica |
|
||||
| `Native/Win32.cs` | Le poche chiamate Win32 e le interfacce di DirectComposition |
|
||||
|
||||
@@ -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