1ab85b21bd
Bump release to v1.1.1 and add release/build packaging, installer and onboarding enhancements. Key changes: - Version bump across csproj, README and release assets to 1.1.1. - CI/workflow: copy bundled Powerplans into single-file output, install Inno Setup, build Inno Setup installer, include installer artifacts in GitHub release, and stage unified package zips with uninstall/license files. - Installer: update InstallScript (setup.iss) to point to staged artifacts, include Powerplans folder, and output installer to artifacts/release/installer. - App startup/elevation: requireAdministrator manifest and App.xaml.cs now requests elevation early, terminating non-elevated instance when elevation is requested/declined. - UX: add Performance first-run onboarding overlay (modal with blurred background), updated loading overlay visuals, and related MainWindow logic to show/hide intro and persist seen state. - Settings & config: implement export/import configuration bundle (JSON) with Save/Open dialogs, add ReplaceConfigurationAsync and CloneConfiguration in association service, and adjust settings view labels. - Power plan features: add PowerPlanService.AddCustomPowerPlanFileAsync and UI/command to add .pow files; adjust Import/Apply button labels. - Performance tweaks: reduce power plan change delay from 1000ms to 250ms in config, models and viewmodels. - Theme detection: improve ThemeService to resolve registry values and fallback to system theme helper. - Misc: various logging/status improvements, packaging script fixes (build-release/build-msix), and added package-release-zips script. These changes prepare the project for a formal 1.1.1 release with installer distribution, improved elevation handling and onboarding, plus enhanced import/export and custom power plan support.
404 lines
23 KiB
XML
404 lines
23 KiB
XML
<UserControl x:Class="ThreadPilot.Views.SettingsView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:ThreadPilot.Views"
|
|
xmlns:models="clr-namespace:ThreadPilot.Models"
|
|
xmlns:converters="clr-namespace:ThreadPilot.Converters"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="600" d:DesignWidth="800">
|
|
|
|
<UserControl.Resources>
|
|
<Style x:Key="SectionHeaderStyle" TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="16"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
<Setter Property="Margin" Value="0,15,0,8"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
</Style>
|
|
|
|
<Style x:Key="DescriptionStyle" TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="11"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
|
|
<Setter Property="Margin" Value="0,2,0,0"/>
|
|
<Setter Property="TextWrapping" Value="Wrap"/>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
|
|
<Grid Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Standardized Header -->
|
|
<GroupBox Grid.Row="0" Header="Application Settings" Margin="0,0,0,10">
|
|
<Grid Margin="5">
|
|
<TextBlock Text="Configure notifications, system tray, and application behavior"
|
|
FontSize="12" Foreground="{DynamicResource TextSecondaryBrush}" VerticalAlignment="Center"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<!-- Settings Content -->
|
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
|
<WrapPanel HorizontalAlignment="Center">
|
|
|
|
<!-- Notifications Section -->
|
|
<StackPanel Width="360" Margin="10">
|
|
<TextBlock Text="Notifications" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
|
<Border Background="{DynamicResource SurfaceAltBrush}" CornerRadius="5" Padding="15" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
|
<StackPanel>
|
|
<CheckBox Content="Enable notifications"
|
|
IsChecked="{Binding Settings.EnableNotifications}"
|
|
Margin="0,0,0,10"/>
|
|
|
|
<StackPanel Margin="20,0,0,10"
|
|
IsEnabled="{Binding Settings.EnableNotifications}">
|
|
<TextBlock Text="Notification Level" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
|
<ComboBox SelectedValue="{Binding Settings.NotificationLevel}"
|
|
SelectedValuePath="Tag">
|
|
<ComboBoxItem Content="All" Tag="{x:Static models:NotificationLevelProfile.All}"/>
|
|
<ComboBoxItem Content="Warnings/Errors only" Tag="{x:Static models:NotificationLevelProfile.WarningsAndErrorsOnly}"/>
|
|
<ComboBoxItem Content="Silent" Tag="{x:Static models:NotificationLevelProfile.Silent}"/>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
|
|
<CheckBox Content="Enable balloon notifications (system tray)"
|
|
IsChecked="{Binding Settings.EnableBalloonNotifications}"
|
|
IsEnabled="{Binding Settings.EnableNotifications}"
|
|
Margin="20,0,0,5"/>
|
|
|
|
<CheckBox Content="Enable toast notifications (Windows 10+)"
|
|
IsChecked="{Binding Settings.EnableToastNotifications}"
|
|
IsEnabled="{Binding Settings.EnableNotifications}"
|
|
Margin="20,0,0,10"/>
|
|
|
|
<Separator Margin="0,10"/>
|
|
|
|
<TextBlock Text="Notification Types" FontWeight="SemiBold" Margin="0,5"/>
|
|
|
|
<CheckBox Content="Power plan changes"
|
|
IsChecked="{Binding Settings.EnablePowerPlanChangeNotifications}"
|
|
IsEnabled="{Binding Settings.EnableNotifications}"
|
|
Margin="20,5,0,5"/>
|
|
|
|
<CheckBox Content="Process monitoring events"
|
|
IsChecked="{Binding Settings.EnableProcessMonitoringNotifications}"
|
|
IsEnabled="{Binding Settings.EnableNotifications}"
|
|
Margin="20,0,0,5"/>
|
|
|
|
<CheckBox Content="Error notifications"
|
|
IsChecked="{Binding Settings.EnableErrorNotifications}"
|
|
IsEnabled="{Binding Settings.EnableNotifications}"
|
|
Margin="20,0,0,5"/>
|
|
|
|
<CheckBox Content="Success notifications"
|
|
IsChecked="{Binding Settings.EnableSuccessNotifications}"
|
|
IsEnabled="{Binding Settings.EnableNotifications}"
|
|
Margin="20,0,0,10"/>
|
|
|
|
<Separator Margin="0,10"/>
|
|
|
|
<Grid Margin="0,5">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="Duration (ms):" VerticalAlignment="Center"/>
|
|
<Slider Grid.Column="1"
|
|
Value="{Binding Settings.NotificationDisplayDurationMs}"
|
|
Minimum="1000" Maximum="30000"
|
|
TickFrequency="1000"
|
|
IsSnapToTickEnabled="True"
|
|
Margin="10,0"/>
|
|
<TextBlock Grid.Column="2"
|
|
Text="{Binding Settings.NotificationDisplayDurationMs}"
|
|
VerticalAlignment="Center" MinWidth="40"/>
|
|
</Grid>
|
|
|
|
<Button Content="Test Notification"
|
|
Command="{Binding TestNotificationCommand}"
|
|
HorizontalAlignment="Left"
|
|
Margin="0,10,0,0"
|
|
Padding="15,5"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<!-- System Tray Section -->
|
|
<StackPanel Width="360" Margin="10">
|
|
<TextBlock Text="System Tray" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
|
<Border Background="{DynamicResource SurfaceAltBrush}" CornerRadius="5" Padding="15" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
|
<StackPanel>
|
|
<CheckBox Content="Show tray icon"
|
|
IsChecked="{Binding Settings.ShowTrayIcon}"
|
|
Margin="0,0,0,10"/>
|
|
|
|
<CheckBox Content="Minimize to tray"
|
|
IsChecked="{Binding Settings.MinimizeToTray}"
|
|
IsEnabled="{Binding Settings.ShowTrayIcon}"
|
|
Margin="20,0,0,5"/>
|
|
|
|
<CheckBox Content="Close to tray (instead of exit)"
|
|
IsChecked="{Binding Settings.CloseToTray}"
|
|
IsEnabled="{Binding Settings.ShowTrayIcon}"
|
|
Margin="20,0,0,5"/>
|
|
|
|
<CheckBox Content="Start minimized"
|
|
IsChecked="{Binding Settings.StartMinimized}"
|
|
Margin="20,0,0,10"/>
|
|
|
|
<Separator Margin="0,10"/>
|
|
|
|
<CheckBox Content="Enable quick apply from tray"
|
|
IsChecked="{Binding Settings.EnableQuickApplyFromTray}"
|
|
IsEnabled="{Binding Settings.ShowTrayIcon}"
|
|
Margin="0,5"/>
|
|
|
|
<CheckBox Content="Enable monitoring controls from tray"
|
|
IsChecked="{Binding Settings.EnableMonitoringControlFromTray}"
|
|
IsEnabled="{Binding Settings.ShowTrayIcon}"
|
|
Margin="0,0,0,5"/>
|
|
|
|
<CheckBox Content="Show detailed tooltips"
|
|
IsChecked="{Binding Settings.ShowDetailedTooltips}"
|
|
IsEnabled="{Binding Settings.ShowTrayIcon}"
|
|
Margin="0,0,0,10"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<!-- Basic Preferences Section -->
|
|
<StackPanel Width="360" Margin="10">
|
|
<TextBlock Text="Basic Preferences" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
|
<Border Background="{DynamicResource SurfaceAltBrush}" CornerRadius="5" Padding="15" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
|
<StackPanel>
|
|
<TextBlock Text="Autostart" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
|
<CheckBox Content="Start with Windows"
|
|
IsChecked="{Binding Settings.AutostartWithWindows}"
|
|
Margin="0,0,0,5"/>
|
|
<TextBlock Text="Automatically start ThreadPilot when Windows starts"
|
|
Style="{StaticResource DescriptionStyle}"
|
|
Margin="20,0,0,15"/>
|
|
|
|
<Separator Margin="0,0,0,15"/>
|
|
|
|
<TextBlock Text="Appearance" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
|
<CheckBox Content="Use dark theme"
|
|
IsChecked="{Binding Settings.UseDarkTheme}"
|
|
Margin="0,0,0,5"/>
|
|
<TextBlock Text="Applies a global Dark/Light theme across all tabs"
|
|
Style="{StaticResource DescriptionStyle}"
|
|
Margin="20,0,0,5"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<!-- Monitoring Section -->
|
|
<StackPanel Width="360" Margin="10">
|
|
<TextBlock Text="Monitoring Settings" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
|
<Border Background="{DynamicResource SurfaceAltBrush}" CornerRadius="5" Padding="15" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
|
<StackPanel>
|
|
<CheckBox Content="Enable WMI monitoring"
|
|
IsChecked="{Binding Settings.EnableWmiMonitoring}"
|
|
Margin="0,0,0,5"/>
|
|
<TextBlock Text="Use Windows Management Instrumentation for real-time process monitoring"
|
|
Style="{StaticResource DescriptionStyle}"
|
|
Margin="20,0,0,15"/>
|
|
|
|
<CheckBox Content="Enable fallback polling"
|
|
IsChecked="{Binding Settings.EnableFallbackPolling}"
|
|
Margin="0,0,0,5"/>
|
|
<TextBlock Text="Use polling as backup when WMI monitoring fails"
|
|
Style="{StaticResource DescriptionStyle}"
|
|
Margin="20,0,0,15"/>
|
|
|
|
<Separator Margin="0,0,0,15"/>
|
|
|
|
<Grid Margin="0,0,0,10">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="Polling interval (ms):" VerticalAlignment="Center"/>
|
|
<Slider Grid.Column="1"
|
|
Value="{Binding Settings.PollingIntervalMs}"
|
|
Minimum="1000" Maximum="30000"
|
|
TickFrequency="1000"
|
|
IsSnapToTickEnabled="True"
|
|
Margin="10,0"/>
|
|
<TextBlock Grid.Column="2"
|
|
Text="{Binding Settings.PollingIntervalMs}"
|
|
VerticalAlignment="Center" MinWidth="40"/>
|
|
</Grid>
|
|
|
|
<Grid Margin="0,5,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="Fallback polling (ms):" VerticalAlignment="Center"/>
|
|
<Slider Grid.Column="1"
|
|
Value="{Binding Settings.FallbackPollingIntervalMs}"
|
|
Minimum="5000" Maximum="60000"
|
|
TickFrequency="5000"
|
|
IsSnapToTickEnabled="True"
|
|
Margin="10,0"/>
|
|
<TextBlock Grid.Column="2"
|
|
Text="{Binding Settings.FallbackPollingIntervalMs}"
|
|
VerticalAlignment="Center" MinWidth="40"/>
|
|
</Grid>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<!-- Advanced Section -->
|
|
<StackPanel Width="360" Margin="10">
|
|
<TextBlock Text="Advanced" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
|
<Border Background="{DynamicResource SurfaceAltBrush}" CornerRadius="5" Padding="15" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
|
<StackPanel>
|
|
<CheckBox Content="Enable notification history"
|
|
IsChecked="{Binding Settings.EnableNotificationHistory}"
|
|
Margin="0,0,0,10"/>
|
|
|
|
<Grid Margin="0,5" IsEnabled="{Binding Settings.EnableNotificationHistory}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="Max history items:" VerticalAlignment="Center"/>
|
|
<Slider Grid.Column="1"
|
|
Value="{Binding Settings.MaxNotificationHistoryItems}"
|
|
Minimum="10" Maximum="1000"
|
|
TickFrequency="10"
|
|
IsSnapToTickEnabled="True"
|
|
Margin="10,0"/>
|
|
<TextBlock Grid.Column="2"
|
|
Text="{Binding Settings.MaxNotificationHistoryItems}"
|
|
VerticalAlignment="Center" MinWidth="40"/>
|
|
</Grid>
|
|
|
|
<CheckBox Content="Auto-hide notifications"
|
|
IsChecked="{Binding Settings.AutoHideNotifications}"
|
|
Margin="0,10,0,5"/>
|
|
|
|
<CheckBox Content="Enable notification sound"
|
|
IsChecked="{Binding Settings.EnableNotificationSound}"
|
|
Margin="0,0,0,5"/>
|
|
|
|
<CheckBox Content="Enable debug logging"
|
|
IsChecked="{Binding Settings.EnableDebugLogging}"
|
|
Margin="0,0,0,5"/>
|
|
|
|
<CheckBox Content="Enable performance counters"
|
|
IsChecked="{Binding Settings.EnablePerformanceCounters}"
|
|
Margin="0,0,0,10"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<!-- About Section -->
|
|
<StackPanel Width="360" Margin="10">
|
|
<TextBlock Text="About" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
|
<Border Background="{DynamicResource SurfaceAltBrush}" CornerRadius="5" Padding="15" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
|
<StackPanel>
|
|
<TextBlock Text="ThreadPilot" FontWeight="SemiBold" FontSize="14"/>
|
|
<TextBlock Text="Version:" FontWeight="SemiBold" Margin="0,8,0,0"/>
|
|
<TextBlock Text="{Binding ApplicationVersion}" Margin="0,0,0,10"/>
|
|
|
|
<TextBlock Text="Copyright © 2026 PrimeBuild" Margin="0,0,0,4"/>
|
|
<TextBlock Text="License: AGPLv3" Style="{StaticResource DescriptionStyle}"/>
|
|
|
|
<Separator Margin="0,12,0,12"/>
|
|
|
|
<Button Content="Check for updates"
|
|
Command="{Binding CheckUpdatesCommand}"
|
|
Padding="15,6"
|
|
HorizontalAlignment="Left"/>
|
|
<TextBlock Text="Checks on demand using the official GitHub Releases."
|
|
Style="{StaticResource DescriptionStyle}"
|
|
Margin="0,6,0,0"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
</WrapPanel>
|
|
</ScrollViewer>
|
|
|
|
<!-- Footer with buttons and status -->
|
|
<Grid Grid.Row="2" Margin="0,20,0,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Status -->
|
|
<Border Grid.Row="0"
|
|
Margin="0,0,0,10"
|
|
Padding="10,7"
|
|
CornerRadius="6"
|
|
BorderThickness="1"
|
|
Opacity="{Binding StatusOpacity}"
|
|
Visibility="{Binding StatusMessage, Converter={x:Static converters:StringToVisibilityConverter.Instance}}">
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Setter Property="Background" Value="{DynamicResource SuccessBackgroundBrush}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource SuccessBorderBrush}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding HasError}" Value="True">
|
|
<Setter Property="Background" Value="{DynamicResource ErrorBackgroundBrush}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ErrorBorderBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<TextBlock Text="{Binding StatusMessage}">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Foreground" Value="{DynamicResource SuccessTextBrush}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding HasError}" Value="True">
|
|
<Setter Property="Foreground" Value="{DynamicResource ErrorTextBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Border>
|
|
|
|
<!-- Buttons -->
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
<Button Content="Reset to Defaults"
|
|
Command="{Binding ResetToDefaultsCommand}"
|
|
Margin="0,0,10,0"
|
|
Padding="15,8"/>
|
|
|
|
<Button Content="Export Configuration"
|
|
Command="{Binding ExportSettingsCommand}"
|
|
Margin="0,0,10,0"
|
|
Padding="15,8"/>
|
|
|
|
<Button Content="Import Configuration"
|
|
Command="{Binding ImportSettingsCommand}"
|
|
Margin="0,0,20,0"
|
|
Padding="15,8"/>
|
|
|
|
<Button Content="Save Settings"
|
|
Command="{Binding SaveSettingsCommand}"
|
|
IsEnabled="{Binding CanSaveSettings}"
|
|
Padding="20,8"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|