mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
* fix.hy3试图修复中 * Resolve dev paths and fix splash UI thread Compute a solutionRoot and expand development search paths (LanMountainDesktop and dev-test) in DeploymentLocator, add logging when scanning/finding hosts, and return distinct full paths. Ensure backward-compatible path checks. Fix cross-thread UI calls: invoke splashWindow.DismissAsync on the UI thread in LauncherFlowCoordinator, and make SplashWindow.DismissAsync ensure it runs on the UI thread before closing (simplified Close call). These changes improve development host discovery and prevent UI-thread access issues during shutdown. * Add configurable data location (portable/system) Introduce support for choosing and resolving the application's data root (system user dir vs. portable app folder). Adds DataLocationConfig model, DataLocationResolver (load/save/resolve/migrate), a UI prompt (DataLocationPromptWindow) and an OOBE step (DataLocationOobeStep) to let users pick and optionally migrate existing data. Wire the chosen data root into the launcher flow and host launch plan (forwarded via --data-root and LMD_DATA_ROOT), and add AppDataPathProvider to let runtime services read the effective data root (initialized in Program.Main). Update various services (logging, settings, DB, plugin/market, startup registry, etc.) to use the new provider/resolver and register the config type in the JSON context. This enables portable installs, safe migration, and runtime overrides via CLI or environment variable. * Add dev/debug startup flow and launch profiles Handle design-time initialization and add a developer debug startup path: App now skips normal startup when in design mode and shows a DevDebugWindow when running in debug (unless a preview or apply-update command). CommandContext.IsDebugMode is extended to include DOTNET_ENVIRONMENT=Development via a new IsDevelopmentEnvironment helper. Program.Main and BuildAvaloniaApp are made public to aid tooling. Added multiple launchSettings profiles for debug and preview commands that set DOTNET_ENVIRONMENT=Development to simplify IDE debugging and UI previewing. * Simplify splash to fade; add themed about banners Simplify splash startup visuals by removing the multi-mode/slide behavior and always using a fade animation. Update App to create SplashWindow without a StartupVisualMode parameter and remove related fields, layout configuration, slide animation, and easing helpers from SplashWindow. Clean up unused using. Replace the single about_banner asset with theme-aware variants (about_banner_dark.png and about_banner_light.png), delete the old about_banner.png, and update AboutSettingsPage to use a DynamicResource ImageBrush (AboutBannerBrush) that selects the appropriate banner per theme. * Use AppJsonContext for startup state serialization Switch serialization to the source-generated System.Text.Json context: add JsonSerializable(typeof(StartupAttemptRecord)) to AppJsonContext and replace the previous JsonSerializerOptions-based Serialize/Deserialize calls with AppJsonContext.Default.StartupAttemptRecord. Also remove the now-unused SerializerOptions field. Additionally, update .gitignore to exclude /test-aot-publish. * Add OOBE redesign, theme & data location support Introduce a redesigned OOBE flow and data-location/theme support across the launcher. Adds a new ThemeService for applying light/dark and accent colors; integrates FluentIcons.Avalonia package for icons. Overhauls OobeWindow (UX animations, typing effect, multi-step theme and data-location pages, Monet options, and final welcome step) and its code-behind to handle step navigation, accent selection, and data-location resolution. Adds DataLocation UI and handlers (DataLocationPromptWindow changes, DataLocation resolver usage) and wires a DevDebug UI for toggling/opening the data-location page. UpdateEngineService now resolves the launcher root via DataLocationResolver. Misc: update various view models, localization entries and remove TrimmerRoots.xml. * Refactor data location paths and add background service Refactor DataLocationResolver to centralize data path resolution (ResolveLauncherDataPath, ResolveDesktopDataPath, ResolveConfigPath, ResolveLauncherLogsPath, ResolveLauncherStatePath) and replace usages of the previous ".launcher" layout with a "Launcher" folder. Update API: LoadConfig/SaveConfig reorganized and ApplyLocationChoice now accepts an optional custom path and migration flag; migration logic updated accordingly. Update dependent services and views (Logger, DeploymentLocator, UpdateEngineService, OobeStateService, StartupAttemptRegistry, LauncherDebugSettingsStore, OobeWindow) to use the new resolver APIs and paths. Add LauncherBackgroundService to load/validate/cache a custom splash background image and wire it into SplashWindow (AXAML/Axaml.cs) with UI placeholders and overlay. Misc: minor cleanup of Oobe/Splash XAML and related code adjustments and logging improvements.
209 lines
8.6 KiB
XML
209 lines
8.6 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="clr-namespace:LanMountainDesktop.Launcher.ViewModels"
|
|
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="600"
|
|
x:Class="LanMountainDesktop.Launcher.Views.DevDebugWindow"
|
|
x:DataType="vm:DevDebugWindowViewModel"
|
|
Title="开发调试窗口 - Launcher"
|
|
Width="500"
|
|
Height="600"
|
|
WindowStartupLocation="CenterScreen"
|
|
Icon="/Assets/logo.ico">
|
|
|
|
<Design.DataContext>
|
|
<vm:DevDebugWindowViewModel />
|
|
</Design.DataContext>
|
|
|
|
<Border Padding="20"
|
|
Background="{DynamicResource SystemControlBackgroundAltHighBrush}">
|
|
<Grid RowDefinitions="Auto,*,Auto,Auto">
|
|
|
|
<!-- 标题 -->
|
|
<StackPanel Grid.Row="0" Margin="0,0,0,20">
|
|
<TextBlock Text="🛠️ 开发调试窗口"
|
|
FontSize="24"
|
|
FontWeight="Bold"
|
|
Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
|
|
<TextBlock Text="用于开发和调试 Launcher 的各个页面"
|
|
FontSize="12"
|
|
Opacity="0.7"
|
|
Margin="0,5,0,0"
|
|
Foreground="{DynamicResource SystemControlForegroundBaseMediumBrush}" />
|
|
</StackPanel>
|
|
|
|
<!-- 页面列表 -->
|
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
|
<StackPanel Spacing="15">
|
|
|
|
<!-- 启动画面 -->
|
|
<Border Background="{DynamicResource SystemControlBackgroundAltMediumBrush}"
|
|
CornerRadius="8"
|
|
Padding="15">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<StackPanel Grid.Column="0">
|
|
<TextBlock Text="🚀 启动画面 (SplashWindow)"
|
|
FontWeight="SemiBold"
|
|
FontSize="14" />
|
|
<TextBlock Text="显示启动进度和状态"
|
|
FontSize="11"
|
|
Opacity="0.6"
|
|
Margin="0,3,0,0" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Spacing="8">
|
|
<ToggleSwitch Content="启用功能"
|
|
IsChecked="{Binding IsSplashEnabled}"
|
|
OnContent="功能"
|
|
OffContent="查看" />
|
|
<Button Content="打开"
|
|
Command="{Binding OpenSplashCommand}"
|
|
HorizontalAlignment="Right" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 错误页面 -->
|
|
<Border Background="{DynamicResource SystemControlBackgroundAltMediumBrush}"
|
|
CornerRadius="8"
|
|
Padding="15">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<StackPanel Grid.Column="0">
|
|
<TextBlock Text="❌ 错误页面 (ErrorWindow)"
|
|
FontWeight="SemiBold"
|
|
FontSize="14" />
|
|
<TextBlock Text="显示错误信息和重试选项"
|
|
FontSize="11"
|
|
Opacity="0.6"
|
|
Margin="0,3,0,0" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Spacing="8">
|
|
<ToggleSwitch Content="启用功能"
|
|
IsChecked="{Binding IsErrorEnabled}"
|
|
OnContent="功能"
|
|
OffContent="查看" />
|
|
<Button Content="打开"
|
|
Command="{Binding OpenErrorCommand}"
|
|
HorizontalAlignment="Right" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 更新页面 -->
|
|
<Border Background="{DynamicResource SystemControlBackgroundAltMediumBrush}"
|
|
CornerRadius="8"
|
|
Padding="15">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<StackPanel Grid.Column="0">
|
|
<TextBlock Text="⬆️ 更新页面 (UpdateWindow)"
|
|
FontWeight="SemiBold"
|
|
FontSize="14" />
|
|
<TextBlock Text="显示更新进度和状态"
|
|
FontSize="11"
|
|
Opacity="0.6"
|
|
Margin="0,3,0,0" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Spacing="8">
|
|
<ToggleSwitch Content="启用功能"
|
|
IsChecked="{Binding IsUpdateEnabled}"
|
|
OnContent="功能"
|
|
OffContent="查看" />
|
|
<Button Content="打开"
|
|
Command="{Binding OpenUpdateCommand}"
|
|
HorizontalAlignment="Right" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- OOBE页面 -->
|
|
<Border Background="{DynamicResource SystemControlBackgroundAltMediumBrush}"
|
|
CornerRadius="8"
|
|
Padding="15">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<StackPanel Grid.Column="0">
|
|
<TextBlock Text="👋 OOBE页面 (OobeWindow)"
|
|
FontWeight="SemiBold"
|
|
FontSize="14" />
|
|
<TextBlock Text="首次运行引导页面"
|
|
FontSize="11"
|
|
Opacity="0.6"
|
|
Margin="0,3,0,0" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Spacing="8">
|
|
<ToggleSwitch Content="启用功能"
|
|
IsChecked="{Binding IsOobeEnabled}"
|
|
OnContent="功能"
|
|
OffContent="查看" />
|
|
<Button Content="打开"
|
|
Command="{Binding OpenOobeCommand}"
|
|
HorizontalAlignment="Right" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 数据位置选择页面 -->
|
|
<Border Background="{DynamicResource SystemControlBackgroundAltMediumBrush}"
|
|
CornerRadius="8"
|
|
Padding="15">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<StackPanel Grid.Column="0">
|
|
<TextBlock Text="📁 数据位置选择 (DataLocationPromptWindow)"
|
|
FontWeight="SemiBold"
|
|
FontSize="14" />
|
|
<TextBlock Text="选择数据保存位置"
|
|
FontSize="11"
|
|
Opacity="0.6"
|
|
Margin="0,3,0,0" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Spacing="8">
|
|
<ToggleSwitch Content="启用功能"
|
|
IsChecked="{Binding IsDataLocationEnabled}"
|
|
OnContent="功能"
|
|
OffContent="查看" />
|
|
<Button Content="打开"
|
|
Command="{Binding OpenDataLocationCommand}"
|
|
HorizontalAlignment="Right" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
|
|
<!-- 批量操作 -->
|
|
<StackPanel Grid.Row="2"
|
|
Orientation="Horizontal"
|
|
HorizontalAlignment="Center"
|
|
Spacing="10"
|
|
Margin="0,15">
|
|
<Button Content="全部设为查看模式"
|
|
Command="{Binding SetAllViewOnlyCommand}"
|
|
Background="{DynamicResource SystemControlBackgroundAltMediumBrush}" />
|
|
<Button Content="全部设为功能模式"
|
|
Command="{Binding SetAllFunctionalCommand}"
|
|
Background="{DynamicResource SystemControlHighlightAccentBrush}"
|
|
Foreground="White" />
|
|
</StackPanel>
|
|
|
|
<!-- 底部状态栏 -->
|
|
<Border Grid.Row="3"
|
|
Background="{DynamicResource SystemControlBackgroundAltMediumBrush}"
|
|
CornerRadius="4"
|
|
Padding="10">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<TextBlock Grid.Column="0"
|
|
Text="{Binding StatusMessage}"
|
|
FontSize="11"
|
|
Opacity="0.8"
|
|
TextTrimming="CharacterEllipsis" />
|
|
<Button Grid.Column="1"
|
|
Content="关闭"
|
|
Command="{Binding CloseCommand}"
|
|
Padding="15,5" />
|
|
</Grid>
|
|
</Border>
|
|
|
|
</Grid>
|
|
</Border>
|
|
</Window>
|