Files
ThreadPilot/Views/PowerPlanView.xaml
T
PrimeBuild-pc 1ab85b21bd Release 1.1.1: installer, elevation & onboarding
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.
2026-04-14 03:22:06 +02:00

126 lines
6.0 KiB
XML

<UserControl x:Class="ThreadPilot.Views.PowerPlanView"
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:helpers="clr-namespace:ThreadPilot.Helpers"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d"
d:DesignHeight="650" d:DesignWidth="1200">
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,16">
<TextBlock Text="Power Plans" FontSize="24" FontWeight="SemiBold" Margin="0,0,0,4"/>
<TextBlock Text="Manage system power plans and import custom profiles" FontSize="14" Opacity="0.7"/>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<!-- System Power Plans -->
<GroupBox Grid.Column="0"
Header="Available Power Plans"
Margin="0,0,5,0">
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0"
Command="{Binding LoadPowerPlansCommand}"
Content="Refresh Plans"
HorizontalAlignment="Right"
Padding="10,5"
Margin="0,0,0,12"
ToolTip="Refresh the list of available power plans"/>
<ui:ListView Grid.Row="1"
ItemsSource="{Binding PowerPlans}"
SelectedItem="{Binding SelectedPowerPlan}"
Background="{DynamicResource ControlFillColorSecondaryBrush}"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
<ui:ListView.ItemTemplate>
<DataTemplate>
<StackPanel Margin="5">
<TextBlock Text="{Binding Name}"
FontWeight="{Binding IsActive, Converter={StaticResource BoolToFontWeightConverter}}"/>
<TextBlock Text="{Binding Guid}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
FontSize="11"/>
</StackPanel>
</DataTemplate>
</ui:ListView.ItemTemplate>
</ui:ListView>
</Grid>
</GroupBox>
<!-- Custom Power Plans -->
<GroupBox Grid.Column="1"
Header="Custom Power Plans"
Margin="5,0,0,0">
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="Available custom power plans:"
Margin="0,0,0,10"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/>
<ui:ListView Grid.Row="1"
ItemsSource="{Binding CustomPowerPlans}"
SelectedItem="{Binding SelectedCustomPlan}"
Background="{DynamicResource ControlFillColorSecondaryBrush}"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
<ui:ListView.ItemTemplate>
<DataTemplate>
<StackPanel Margin="5">
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding FilePath}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
FontSize="11"/>
</StackPanel>
</DataTemplate>
</ui:ListView.ItemTemplate>
</ui:ListView>
</Grid>
</GroupBox>
</Grid>
<!-- Action Buttons -->
<StackPanel Grid.Row="2"
Orientation="Horizontal"
Margin="0,12,0,0">
<Button Command="{Binding SetActivePlanCommand}"
Content="Set Active"
Padding="20,5"
Margin="0,0,10,0"
ToolTip="Activate the selected power plan"/>
<Button Command="{Binding ImportCustomPlanCommand}"
Content="Apply Selected Custom"
Padding="20,5"
Margin="0,0,10,0"
ToolTip="Import the selected custom power plan into the system"/>
<Button Command="{Binding AddCustomPlanFileCommand}"
Content="Add .pow File"
Padding="20,5"
ToolTip="Add a new custom power plan file to the custom library"/>
</StackPanel>
</Grid>
</UserControl>