v1.16 — Remove PowerShell edition, restore flat project structure
PowerShell version removed — will use OV code signing certificate instead. Files moved back from src/ to project root. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
80
Pages/EditionPage.xaml.cs
Normal file
80
Pages/EditionPage.xaml.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using InstaSoftOfficeTool.Models;
|
||||
|
||||
namespace InstaSoftOfficeTool.Pages
|
||||
{
|
||||
public partial class EditionPage : Page, IWizardPage
|
||||
{
|
||||
private readonly MainWindow _main;
|
||||
private readonly InstallConfig _config;
|
||||
private readonly OfficeEdition[] _editions;
|
||||
|
||||
public EditionPage(MainWindow main, InstallConfig config)
|
||||
{
|
||||
InitializeComponent();
|
||||
_main = main;
|
||||
_config = config;
|
||||
_editions = OfficeEdition.GetEditions(_config.Version);
|
||||
|
||||
SubtitleText.Text = _config.GetVersionDisplayName() + " — melyik kiadast szeretne?";
|
||||
|
||||
BuildEditionCards();
|
||||
}
|
||||
|
||||
private void BuildEditionCards()
|
||||
{
|
||||
EditionPanel.Children.Clear();
|
||||
|
||||
for (int i = 0; i < _editions.Length; i++)
|
||||
{
|
||||
var edition = _editions[i];
|
||||
var rb = new RadioButton
|
||||
{
|
||||
GroupName = "Edition",
|
||||
IsChecked = i == 0 || (_config.Edition != null && _config.Edition.ProductId == edition.ProductId),
|
||||
Style = (Style)FindResource("CardRadioButton"),
|
||||
Margin = new Thickness(0, 0, 0, 10),
|
||||
Tag = i
|
||||
};
|
||||
|
||||
var sp = new StackPanel { Margin = new Thickness(8, 2, 8, 2) };
|
||||
|
||||
var titleBlock = new TextBlock
|
||||
{
|
||||
Text = edition.DisplayName,
|
||||
FontSize = 18,
|
||||
FontWeight = FontWeights.SemiBold
|
||||
};
|
||||
sp.Children.Add(titleBlock);
|
||||
|
||||
var descBlock = new TextBlock
|
||||
{
|
||||
Text = edition.Description,
|
||||
FontSize = 12,
|
||||
Foreground = (System.Windows.Media.Brush)FindResource("TextSecondaryBrush"),
|
||||
TextWrapping = TextWrapping.Wrap,
|
||||
Margin = new Thickness(0, 2, 0, 0)
|
||||
};
|
||||
sp.Children.Add(descBlock);
|
||||
|
||||
rb.Content = sp;
|
||||
EditionPanel.Children.Add(rb);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
foreach (var child in EditionPanel.Children)
|
||||
{
|
||||
if (child is RadioButton rb && rb.IsChecked == true)
|
||||
{
|
||||
int idx = (int)rb.Tag;
|
||||
_config.Edition = _editions[idx];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user