Files
ThreadPilot/Views/SettingsView.xaml
T
Prime Build 9a4baba19a feat: release 1.7.7 stable without experimental Game Boost
* feat: back up persistent rules and resolve rule precedence deterministically

- Configuration export now includes persistent process rules (schema 3.0),
  stays compatible with 2.0 bundles, validates before writing, previews
  what an import replaces and rolls back on failure.
- Matching rules apply broad-to-specific (name, wildcard path, exact path,
  then most recently edited), shared by the engine and the process summary,
  which now lists the apply order and flags conflicting values.
- Localized the new strings in all seven languages.

* feat: clearer process and rule editors

- Process details: CPU, memory and I/O priority pickers with an explicit
  Apply, undo of the last manual priority change (guarded against reused
  PIDs), adaptive side/bottom details panel.
- Manual process control stays available while automation is paused, with
  a persistent notice instead of an overlay.
- Saved-rule editor stages all edits (including the core mask) and saves
  them together, showing pending changes.
- Localized the new strings in all seven languages.

* fix: one save path for a saved rule's cores

The rules editor's core mask went through a new update path that reported
success without saving when no affinity payload was built, and kept a
legacy mask next to a CPU selection. Merge it with the old single-purpose
method (now unused), keep its checks, and localize the undo message.

* feat: per-process efficiency mode (EcoQoS) for live processes and rules

Closes #66.

- Native: SetProcessInformation/GetProcessInformation with
  ProcessPowerThrottling (EXECUTION_SPEED), three states: Windows decides,
  On (EcoQoS), Off (never throttle / HighQoS).
- Process tab: context menu entries, a picker with Apply in the details
  panel, current state in the summary, undo of the last change, included
  when saving current settings as a rule (only if explicitly set).
- Rules: EfficiencyMode + ApplyEfficiencyModeOnStart, applied by the rules
  engine, editable in the saved-rule editor, validated on import and part
  of conflict detection.
- The summary flags when the global Power Throttling tweak voids it. CPU
  priority is left alone, unlike Task Manager's efficiency mode.
- Localized in all seven languages.

* chore: keep CRLF line endings in SelectedProcessSummaryViewModel

* feat: clearer navigation, process page and rules editor

- Navigation pane open with short labels instead of seven bare icons.
- Processes: one toolbar row (search with placeholder, Filters and
  Columns menus, sort, refresh); details split into Process, Priority,
  CPU cores and Rule cards; pickers start from the process's current
  values and stay empty when a value cannot be read; help paragraphs
  moved into tooltips; core picker always visible.
- Rules: process rules first, clearer tab names, localized choices in the
  saved-rule editor instead of internal enum names.
- Shorter page titles and subtitles in all seven languages; removed the
  strings this made unused.

No data format changes.

* feat: settings and tweaks as Windows 11 rows, localized rule list

- Settings: one column of rows (what it is on the left, its switch on the
  right), most used sections first, Save as the primary action.
- Tweaks: one tweak per row with its status dot and switch.
- Rule list: 'Applies' and 'Mode' columns use the same localized labels as
  the editor and refresh on language change.
- Removed 76 strings no code referenced, from all seven languages.

* fix: issues found testing the beta in a clean Windows 11 VM

- Process counter could show more visible processes than the total
  ('157 / 151'): the batch total was a snapshot from the first load.
- Narrow windows (or 150% scaling): toolbar buttons move under the search
  box instead of squeezing it to a few letters.
- Rules list keeps the 'Applies' column readable when narrow.
- Settings status message gets its own line instead of being cut.

Tested in a Hyper-V Windows 11 VM: clean install, upgrade, uninstall,
light and dark theme, 100% and 150% scaling.

* feat: remember layout choices; Windows 11 toggles in Tweaks

- The navigation pane, window size/position/maximized state, and the
  process list filters, sort and columns now survive a restart. They live
  in ui-state.json, apart from settings.json, so they never mark the
  Settings page as unsaved or travel in exported configurations. A corrupt
  file falls back to defaults; tests write to a temp file.
- Fixes the pane re-opening on every start (it was hard-coded open).
- Tweaks use a native-looking Windows 11 switch (40x20 track, sliding
  thumb) with On/Off written beside it.
- New test: every on/off setting survives save and reload.

* docs: handoff for the 1.7.7 PR stack and beta test

* fix: P/E cores from the highest EfficiencyClass, AMD CCDs from real L3 groups

The legacy topology treated the lowest EfficiencyClass as the performance
core, swapping P- and E-cores on hybrid Intel CPUs. AMD CCDs were guessed
as 8 cores each, which split 6+6 parts (7900X3D, 9900X3D) into 8+4; they now
come from the L3 groups Windows reports, with the guess kept only as a
fallback. The topology snapshot also keeps each L3 group's size.

* feat: Game Boost, CPU Sets for the game and selected background apps

While a detected game runs, Game Boost sets process default CPU Sets from
the CPU topology: on AMD X3D with one larger L3 the game goes to the V-Cache
CCD, on Intel hybrid CPUs to the P-cores, and selected background apps
(browsers, sync clients, updaters, launchers) to the other cores. On dual-CCD
parts with equal L3 only the background moves, unless Isolation mode also
keeps the game on CCD0. Single-L3 and unreadable topologies are left to
Windows. Above Normal priority for the game is optional; never High.

Each change is written to a journal before it is made and undone when the
game exits, Game Boost is turned off or ThreadPilot closes, and on the next
start after a crash. Only values still exactly as Game Boost set them are
restored, never one a user rule or a manual change has taken over since.
Persistent rules and Game Boost share one apply gate, and a rule always
wins over Game Boost for the setting it covers.

The switch, mode and lists are on the Tweaks page, off by default, and take
effect without a restart.

* fix: Game Boost background entries with a full path never matched

The background list compared full-path entries against an empty path, so
only bare process names worked. Found by a new integration test that runs
the real services on two copies of PING.EXE: CPU Sets and priority are set
and read back through Windows, removed when Game Boost is turned off, and
undone from the journal after a simulated crash. The topology is simulated
from this machine's CPU Set IDs, so the test also runs on CPUs where Game
Boost would not act; it skips itself below 8 cores.

* feat: report Game Boost sessions and restore results in Activity

* test: diagnose EcoQoS read failures on Windows Server

* chore: prepare 1.7.7-beta.2 and keep prereleases out of stable channels

* test: use native full-query access mask in EcoQoS diagnostic

* docs: update beta handoff and prerelease publication policy

* ci: run native EcoQoS tests on a Windows 11-era kernel

Windows Server 2022 build 20348 rejects GetProcessInformation(ProcessPowerThrottling) with ERROR_INVALID_PARAMETER (87), with both limited and full query handles. Windows 11 local tests pass. Use Server 2025 for CI/release tests and smoke testing; keep the real round-trip assertions, remove temporary probes.

* test: lock beta publication and native runner contracts

* chore: separate stable 1.7.7 from experimental Game Boost

Stable retains the validated EcoQoS/rules/UI stack. Preserve the complete local Game Boost implementation at ef2ec24 for the separate 1.7.8-beta.1 prerelease; no experimental Game Boost/topology changes ship in stable. Keep channel-aware publication and Windows 11-era native CI tests.
2026-10-16 12:03:54 +02:00

549 lines
40 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"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<UserControl.Resources>
<Style x:Key="SectionHeaderStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource SectionTitleFontSize}"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="0,20,0,8"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
</Style>
<Style x:Key="DescriptionStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource CaptionFontSize}"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="Margin" Value="0,2,0,0"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<!-- One setting = one row: what it is on the left, its control on the right (Windows 11 Settings). -->
<Style x:Key="SettingRowStyle" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource CardSurfaceBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderSubtleBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Padding" Value="16,12"/>
<Setter Property="Margin" Value="0,0,0,4"/>
</Style>
<Style x:Key="SubSettingRowStyle" TargetType="Border" BasedOn="{StaticResource SettingRowStyle}">
<Setter Property="Margin" Value="32,0,0,4"/>
</Style>
<Style x:Key="SettingTitleStyle" TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</UserControl.Resources>
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,4">
<TextBlock Text="{DynamicResource SettingsView_Title}" Style="{StaticResource PageTitleTextStyle}" Margin="0,0,0,4"/>
<TextBlock Text="{DynamicResource SettingsView_Subtitle}"
Style="{StaticResource PageSubtitleTextStyle}"/>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel MaxWidth="980" HorizontalAlignment="Stretch" Margin="0,0,12,12">
<!-- General -->
<TextBlock Text="{DynamicResource SettingsView_BasicPreferences}" Style="{StaticResource SectionHeaderStyle}" Margin="0,8,0,8"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.AutostartWithWindows}"
AutomationProperties.Name="{DynamicResource SettingsView_StartWithWindows}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_StartWithWindows}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_AutostartDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ComboBox DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center" MinWidth="200"
SelectedValue="{Binding Settings.Language}" SelectedValuePath="Tag"
AutomationProperties.Name="{DynamicResource SettingsView_Language}">
<ComboBoxItem Content="{DynamicResource SettingsView_LanguageEnUs}" Tag="en-US"/>
<ComboBoxItem Content="{DynamicResource SettingsView_LanguageZhCn}" Tag="zh-CN"/>
<ComboBoxItem Content="{DynamicResource SettingsView_LanguageItIt}" Tag="it-IT"/>
<ComboBoxItem Content="{DynamicResource SettingsView_LanguageFrFr}" Tag="fr-FR"/>
<ComboBoxItem Content="{DynamicResource SettingsView_LanguageDeDe}" Tag="de-DE"/>
<ComboBoxItem Content="{DynamicResource SettingsView_LanguageEsEs}" Tag="es-ES"/>
<ComboBoxItem Content="{DynamicResource SettingsView_LanguageRuRu}" Tag="ru-RU"/>
</ComboBox>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_Language}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_LanguageDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.UseDarkTheme}"
AutomationProperties.Name="{DynamicResource SettingsView_UseDarkTheme}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_UseDarkTheme}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_ThemeDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.ClearMasksOnClose}"
AutomationProperties.Name="{DynamicResource SettingsView_ResetProcessChangesOnExit}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_ResetProcessChangesOnExit}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_ResetProcessChangesOnExitDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableSelfLowImpactMode}"
AutomationProperties.Name="{DynamicResource SettingsView_LowImpactMode}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_LowImpactMode}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_LowImpactDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<!-- Rules & automation -->
<TextBlock Text="{DynamicResource SettingsView_RulesAutomation}" Style="{StaticResource SectionHeaderStyle}"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.ApplyPersistentRulesOnProcessStart}"
AutomationProperties.Name="{DynamicResource SettingsView_RuleAutoApply}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_ApplyOnStart}" TextWrapping="Wrap"/>
<TextBlock Text="{DynamicResource SettingsView_ApplyOnStartDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableWmiMonitoring}"
AutomationProperties.Name="{DynamicResource SettingsView_EnableWmi}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_EnableWmi}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_WmiDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableFallbackPolling}"
AutomationProperties.Name="{DynamicResource SettingsView_EnableFallback}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_EnableFallback}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_FallbackDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="16,0,0,0" VerticalAlignment="Center">
<Slider Width="200" VerticalAlignment="Center"
Value="{Binding Settings.PollingIntervalMs}"
Minimum="1000" Maximum="30000" TickFrequency="1000" IsSnapToTickEnabled="True"
AutomationProperties.Name="{DynamicResource SettingsView_PollingInterval}"/>
<TextBlock Text="{Binding Settings.PollingIntervalMs}" MinWidth="52" TextAlignment="Right" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock Text="{DynamicResource SettingsView_PollingInterval}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}" IsEnabled="{Binding Settings.EnableFallbackPolling}">
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="16,0,0,0" VerticalAlignment="Center">
<Slider Width="200" VerticalAlignment="Center"
Value="{Binding Settings.FallbackPollingIntervalMs}"
Minimum="5000" Maximum="60000" TickFrequency="5000" IsSnapToTickEnabled="True"
AutomationProperties.Name="{DynamicResource SettingsView_FallbackPollingInterval}"/>
<TextBlock Text="{Binding Settings.FallbackPollingIntervalMs}" MinWidth="52" TextAlignment="Right" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock Text="{DynamicResource SettingsView_FallbackPollingInterval}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<!-- CPU assignment -->
<TextBlock Text="{DynamicResource SettingsView_CpuAssignment}" Style="{StaticResource SectionHeaderStyle}"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ComboBox DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center" MinWidth="200"
SelectedValue="{Binding Settings.DefaultCpuAssignmentMode}"
SelectedValuePath="Tag"
ToolTip="{DynamicResource SettingsView_CpuAssignmentTooltip}"
AutomationProperties.Name="{DynamicResource SettingsView_DefaultCpuAssignment}"
AutomationProperties.HelpText="{DynamicResource SettingsView_CpuAssignmentTooltip}">
<ComboBoxItem Content="{DynamicResource CpuAssignmentMode_AffinityMask}" Tag="{x:Static models:CpuAssignmentMode.AffinityMask}" ToolTip="{DynamicResource CpuAssignmentMode_AffinityMaskTooltip}"/>
<ComboBoxItem Content="{DynamicResource CpuAssignmentMode_IdealProcessor}" Tag="{x:Static models:CpuAssignmentMode.IdealProcessor}" ToolTip="{DynamicResource CpuAssignmentMode_IdealProcessorTooltip}"/>
<ComboBoxItem Content="{DynamicResource CpuAssignmentMode_CpuSets}" Tag="{x:Static models:CpuAssignmentMode.CpuSets}" ToolTip="{DynamicResource CpuAssignmentMode_CpuSetsTooltip}"/>
<ComboBoxItem Content="{DynamicResource CpuAssignmentMode_Automatic}" Tag="{x:Static models:CpuAssignmentMode.Automatic}" ToolTip="{DynamicResource CpuAssignmentMode_AutomaticTooltip}"/>
</ComboBox>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_DefaultCpuAssignment}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_CpuAssignmentDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<StackPanel>
<TextBlock Text="{Binding ReservedCpuSetsStatus}" TextWrapping="Wrap"/>
<TextBlock Text="{DynamicResource SettingsView_ReservedCpuSetsWarning}"
Style="{StaticResource DescriptionStyle}"
ToolTip="{DynamicResource SettingsView_ReservedCpuSetsTooltip}"
AutomationProperties.HelpText="{DynamicResource SettingsView_ReservedCpuSetsTooltip}"/>
</StackPanel>
</Border>
<!-- System tray -->
<TextBlock Text="{DynamicResource SettingsView_SystemTray}" Style="{StaticResource SectionHeaderStyle}"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.ShowTrayIcon}"
AutomationProperties.Name="{DynamicResource SettingsView_ShowTrayIcon}"/>
<TextBlock Text="{DynamicResource SettingsView_ShowTrayIcon}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}" IsEnabled="{Binding Settings.ShowTrayIcon}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.MinimizeToTray}"
AutomationProperties.Name="{DynamicResource SettingsView_MinimizeToTray}"/>
<TextBlock Text="{DynamicResource SettingsView_MinimizeToTray}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}" IsEnabled="{Binding Settings.ShowTrayIcon}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.CloseToTray}"
AutomationProperties.Name="{DynamicResource SettingsView_CloseToTray}"/>
<TextBlock Text="{DynamicResource SettingsView_CloseToTray}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}" IsEnabled="{Binding Settings.ShowTrayIcon}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableQuickApplyFromTray}"
AutomationProperties.Name="{DynamicResource SettingsView_QuickApply}"/>
<TextBlock Text="{DynamicResource SettingsView_QuickApply}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}" IsEnabled="{Binding Settings.ShowTrayIcon}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableMonitoringControlFromTray}"
AutomationProperties.Name="{DynamicResource SettingsView_MonitoringControl}"/>
<TextBlock Text="{DynamicResource SettingsView_MonitoringControl}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}" IsEnabled="{Binding Settings.ShowTrayIcon}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.ShowDetailedTooltips}"
AutomationProperties.Name="{DynamicResource SettingsView_DetailedTooltips}"/>
<TextBlock Text="{DynamicResource SettingsView_DetailedTooltips}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.StartMinimized}"
AutomationProperties.Name="{DynamicResource SettingsView_StartMinimized}"/>
<TextBlock Text="{DynamicResource SettingsView_StartMinimized}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<!-- Notifications -->
<TextBlock Text="{DynamicResource SettingsView_Notifications}" Style="{StaticResource SectionHeaderStyle}"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableNotifications}"
AutomationProperties.Name="{DynamicResource SettingsView_EnableNotifications}"/>
<TextBlock Text="{DynamicResource SettingsView_EnableNotifications}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<StackPanel IsEnabled="{Binding Settings.EnableNotifications}">
<Border Style="{StaticResource SubSettingRowStyle}">
<DockPanel>
<ComboBox DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center" MinWidth="200"
SelectedValue="{Binding Settings.NotificationLevel}"
SelectedValuePath="Tag"
AutomationProperties.Name="{DynamicResource SettingsView_NotificationLevel}">
<ComboBoxItem Content="{DynamicResource SettingsView_NotificationLevelAll}" Tag="{x:Static models:NotificationLevelProfile.All}"/>
<ComboBoxItem Content="{DynamicResource SettingsView_NotificationLevelWarningsErrors}" Tag="{x:Static models:NotificationLevelProfile.WarningsAndErrorsOnly}"/>
<ComboBoxItem Content="{DynamicResource SettingsView_NotificationLevelSilent}" Tag="{x:Static models:NotificationLevelProfile.Silent}"/>
</ComboBox>
<TextBlock Text="{DynamicResource SettingsView_NotificationLevel}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableToastNotifications}"
AutomationProperties.Name="{DynamicResource SettingsView_EnableToast}"/>
<TextBlock Text="{DynamicResource SettingsView_EnableToast}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableBalloonNotifications}"
AutomationProperties.Name="{DynamicResource SettingsView_EnableBalloon}"/>
<TextBlock Text="{DynamicResource SettingsView_EnableBalloon}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}">
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_NotificationTypes}" Margin="0,0,0,6"/>
<WrapPanel>
<CheckBox Content="{DynamicResource SettingsView_NotifyPowerPlan}" IsChecked="{Binding Settings.EnablePowerPlanChangeNotifications}" Margin="0,0,24,4"/>
<CheckBox Content="{DynamicResource SettingsView_NotifyProcess}" IsChecked="{Binding Settings.EnableProcessMonitoringNotifications}" Margin="0,0,24,4"/>
<CheckBox Content="{DynamicResource SettingsView_NotifyError}" IsChecked="{Binding Settings.EnableErrorNotifications}" Margin="0,0,24,4"/>
<CheckBox Content="{DynamicResource SettingsView_NotifySuccess}" IsChecked="{Binding Settings.EnableSuccessNotifications}" Margin="0,0,24,4"/>
</WrapPanel>
</StackPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}">
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="16,0,0,0" VerticalAlignment="Center">
<Slider Width="200" VerticalAlignment="Center"
Value="{Binding Settings.NotificationDisplayDurationMs}"
Minimum="1000" Maximum="30000" TickFrequency="1000" IsSnapToTickEnabled="True"
AutomationProperties.Name="{DynamicResource SettingsView_Duration}"/>
<TextBlock Text="{Binding Settings.NotificationDisplayDurationMs}" MinWidth="52" TextAlignment="Right" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock Text="{DynamicResource SettingsView_Duration}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}">
<DockPanel>
<Button DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
Content="{DynamicResource SettingsView_TestNotification}"
Command="{Binding TestNotificationCommand}"/>
<TextBlock/>
</DockPanel>
</Border>
</StackPanel>
<!-- Advanced -->
<TextBlock Text="{DynamicResource SettingsView_Advanced}" Style="{StaticResource SectionHeaderStyle}"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableNotificationHistory}"
AutomationProperties.Name="{DynamicResource SettingsView_NotificationHistory}"/>
<TextBlock Text="{DynamicResource SettingsView_NotificationHistory}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SubSettingRowStyle}" IsEnabled="{Binding Settings.EnableNotificationHistory}">
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="16,0,0,0" VerticalAlignment="Center">
<Slider Width="200" VerticalAlignment="Center"
Value="{Binding Settings.MaxNotificationHistoryItems}"
Minimum="10" Maximum="1000" TickFrequency="10" IsSnapToTickEnabled="True"
AutomationProperties.Name="{DynamicResource SettingsView_MaxHistory}"/>
<TextBlock Text="{Binding Settings.MaxNotificationHistoryItems}" MinWidth="52" TextAlignment="Right" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock Text="{DynamicResource SettingsView_MaxHistory}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.AutoHideNotifications}"
AutomationProperties.Name="{DynamicResource SettingsView_AutoHide}"/>
<TextBlock Text="{DynamicResource SettingsView_AutoHide}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableNotificationSound}"
AutomationProperties.Name="{DynamicResource SettingsView_NotificationSound}"/>
<TextBlock Text="{DynamicResource SettingsView_NotificationSound}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableDebugLogging}"
AutomationProperties.Name="{DynamicResource SettingsView_DebugLogging}"/>
<TextBlock Text="{DynamicResource SettingsView_DebugLogging}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnablePerformanceCounters}"
AutomationProperties.Name="{DynamicResource SettingsView_PerformanceCounters}"/>
<TextBlock Text="{DynamicResource SettingsView_PerformanceCounters}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<!-- Updates and about -->
<TextBlock Text="{DynamicResource SettingsView_About}" Style="{StaticResource SectionHeaderStyle}"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="16,0,0,0" VerticalAlignment="Center">
<Button Content="{DynamicResource SettingsView_CheckUpdates}" Command="{Binding CheckUpdatesCommand}"/>
<ui:Button Appearance="Primary" Margin="8,0,0,0"
Content="{DynamicResource SettingsView_DownloadInstallUpdate}"
Command="{Binding DownloadAndInstallUpdateCommand}"
IsEnabled="{Binding CanDownloadAndInstallUpdate}"/>
</StackPanel>
<StackPanel>
<TextBlock Style="{StaticResource SettingTitleStyle}">
<Run Text="{DynamicResource SettingsView_ThreadPilot}" FontWeight="SemiBold"/>
<Run Text="{Binding ApplicationVersion, Mode=OneWay}"/>
</TextBlock>
<TextBlock Style="{StaticResource DescriptionStyle}">
<Run Text="{DynamicResource SettingsView_LatestVersion}"/>
<Run Text="{Binding LatestUpdateVersion, Mode=OneWay}"/>
<Run Text="·"/>
<Run Text="{DynamicResource SettingsView_LastUpdateCheck}"/>
<Run Text="{Binding LastUpdateCheckText, Mode=OneWay}"/>
</TextBlock>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.EnableAutomaticUpdateChecks}"
AutomationProperties.Name="{DynamicResource SettingsView_EnableAutomaticUpdateChecks}"/>
<StackPanel>
<TextBlock Text="{DynamicResource SettingsView_EnableAutomaticUpdateChecks}" Style="{StaticResource SettingTitleStyle}"/>
<TextBlock Text="{DynamicResource SettingsView_UpdatesDescription}" Style="{StaticResource DescriptionStyle}"/>
</StackPanel>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<ui:ToggleSwitch DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding Settings.IncludePrereleaseUpdates}"
AutomationProperties.Name="{DynamicResource SettingsView_IncludePrereleaseUpdates}"/>
<TextBlock Text="{DynamicResource SettingsView_IncludePrereleaseUpdates}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<!-- Help -->
<TextBlock Text="{DynamicResource SettingsView_SomethingWrong}" Style="{StaticResource SectionHeaderStyle}"/>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<Button DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center" Command="{Binding OpenDiscordCommand}">
<StackPanel Orientation="Horizontal">
<Viewbox Width="17" Height="17" Margin="0,0,7,0">
<Path Fill="{DynamicResource TextFillColorPrimaryBrush}"
Data="M20.317,4.37 C18.78,3.66 17.13,3.15 15.432,2.855 C15.26,2.83 15.18,2.91 15.08,3.09 C14.87,3.47 14.64,3.96 14.47,4.34 C12.63,4.06 10.79,4.06 8.99,4.34 C8.82,3.95 8.58,3.47 8.37,3.09 C8.27,2.91 8.19,2.83 8.02,2.855 C6.32,3.15 4.67,3.66 3.13,4.37 C0.53,8.02 -0.32,13.58 0.1,18.06 C1.94,19.54 4.04,20.54 6.12,21.14 C6.61,20.47 7.05,19.76 7.42,19.02 C6.76,18.77 6.14,18.47 5.54,18.13 C5.79,17.94 6.04,17.75 6.28,17.55 C10.14,19.34 14.39,19.34 18.25,17.55 C18.49,17.75 18.74,17.94 18.99,18.13 C18.39,18.47 17.77,18.77 17.11,19.02 C17.48,19.76 17.92,20.47 18.41,21.14 C20.49,20.54 22.59,19.54 24.43,18.06 C24.93,12.88 23.59,8.39 20.32,4.37 Z M8.02,15.33 C6.84,15.33 5.86,14.25 5.86,12.91 C5.86,11.58 6.82,10.49 8.02,10.49 C9.23,10.49 10.19,11.59 10.18,12.91 C10.18,14.25 9.22,15.33 8.02,15.33 Z M15.99,15.33 C14.81,15.33 13.84,14.25 13.84,12.91 C13.84,11.58 14.79,10.49 15.99,10.49 C17.2,10.49 18.17,11.59 18.15,12.91 C18.15,14.25 17.21,15.33 15.99,15.33 Z"/>
</Viewbox>
<TextBlock Text="{DynamicResource SettingsView_OpenDiscord}" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<TextBlock Text="{DynamicResource SettingsView_DiscordDescription}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<Border Style="{StaticResource SettingRowStyle}">
<DockPanel>
<Button DockPanel.Dock="Right" Margin="16,0,0,0" VerticalAlignment="Center" Command="{Binding ReportIssueCommand}">
<StackPanel Orientation="Horizontal">
<ui:SymbolIcon Symbol="Bug24" Margin="0,0,7,0"/>
<TextBlock Text="{DynamicResource SettingsView_ReportIssue}" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<TextBlock Text="{DynamicResource SettingsView_IssuesDescription}" Style="{StaticResource SettingTitleStyle}"/>
</DockPanel>
</Border>
<TextBlock Margin="0,12,0,0" Style="{StaticResource DescriptionStyle}">
<Run Text="{DynamicResource SettingsView_Copyright}"/>
<Run Text="·"/>
<Run Text="{DynamicResource SettingsView_License}"/>
</TextBlock>
</StackPanel>
</ScrollViewer>
<!-- Footer: status on its own line so it is never cut, actions below on the right -->
<Grid Grid.Row="2" Margin="0,12,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0"
Margin="0,0,0,8"
Padding="10,7"
VerticalAlignment="Center"
CornerRadius="{DynamicResource StandardCardCornerRadius}"
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}" TextWrapping="Wrap">
<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>
<WrapPanel Grid.Row="1" HorizontalAlignment="Right">
<Button Content="{DynamicResource SettingsView_ResetDefaults}"
Command="{Binding ResetToDefaultsCommand}"
Margin="0,0,8,0"/>
<Button Content="{DynamicResource SettingsView_ExportConfig}"
Command="{Binding ExportSettingsCommand}"
Margin="0,0,8,0"/>
<Button Content="{DynamicResource SettingsView_ImportConfig}"
Command="{Binding ImportSettingsCommand}"
Margin="0,0,16,0"/>
<ui:Button Appearance="Primary"
Content="{DynamicResource SettingsView_SaveSettings}"
Command="{Binding SaveSettingsCommand}"
IsEnabled="{Binding CanSaveSettings}"/>
</WrapPanel>
</Grid>
</Grid>
</UserControl>