From 0794d40054f3a3c573dc4e32a2ab9dadc14ff2a1 Mon Sep 17 00:00:00 2001 From: hariel1985 Date: Tue, 31 Mar 2026 05:57:34 +0200 Subject: [PATCH] Wizard improvements: version info, 64-bit label, paste fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Version cards show technical info (Version 16.0 · LTSC · OS support) - 64-bit option labeled as "(ajánlott)" - Full product key paste distributes across all 5 input fields Co-Authored-By: Claude Opus 4.6 (1M context) --- Pages/ConfigPage.xaml | 2 +- Pages/ProductKeyPage.xaml.cs | 29 +++++++++++++++++++++++++++-- Pages/VersionPage.xaml | 6 +++--- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Pages/ConfigPage.xaml b/Pages/ConfigPage.xaml index bcc2f5d..14e6fbc 100644 --- a/Pages/ConfigPage.xaml +++ b/Pages/ConfigPage.xaml @@ -11,7 +11,7 @@ - + diff --git a/Pages/ProductKeyPage.xaml.cs b/Pages/ProductKeyPage.xaml.cs index 4f9e985..079b6a8 100644 --- a/Pages/ProductKeyPage.xaml.cs +++ b/Pages/ProductKeyPage.xaml.cs @@ -34,9 +34,33 @@ namespace InstaSoftOfficeTool.Pages if (_suppressAutoTab) return; var tb = (TextBox)sender; + var raw = tb.Text; - var cleaned = Regex.Replace(tb.Text, "[^A-Za-z0-9]", ""); - if (cleaned != tb.Text) + // Detect full key paste (contains dash or longer than 5 chars with alphanumerics) + var allAlphaNum = Regex.Replace(raw, "[^A-Za-z0-9]", ""); + if (allAlphaNum.Length > 5 && tb == _keyBoxes[0]) + { + // Full key pasted — distribute across all boxes + _suppressAutoTab = true; + for (int i = 0; i < 5; i++) + { + int start = i * 5; + if (start < allAlphaNum.Length) + { + int len = System.Math.Min(5, allAlphaNum.Length - start); + _keyBoxes[i].Text = allAlphaNum.Substring(start, len).ToUpper(); + } + } + _suppressAutoTab = false; + _keyBoxes[4].Focus(); + _keyBoxes[4].CaretIndex = _keyBoxes[4].Text.Length; + ValidationMessage.Visibility = Visibility.Collapsed; + return; + } + + // Clean non-alphanumeric chars + var cleaned = Regex.Replace(raw, "[^A-Za-z0-9]", ""); + if (cleaned != raw) { _suppressAutoTab = true; tb.Text = cleaned; @@ -44,6 +68,7 @@ namespace InstaSoftOfficeTool.Pages _suppressAutoTab = false; } + // Auto-tab to next box when 5 chars entered if (tb.Text.Length == 5) { for (int i = 0; i < _keyBoxes.Length - 1; i++) diff --git a/Pages/VersionPage.xaml b/Pages/VersionPage.xaml index 04f5e85..0940fe3 100644 --- a/Pages/VersionPage.xaml +++ b/Pages/VersionPage.xaml @@ -20,7 +20,7 @@ GroupName="Version" IsChecked="True" Margin="0,0,0,10"> - @@ -29,7 +29,7 @@ GroupName="Version" Margin="0,0,0,10"> - @@ -38,7 +38,7 @@ GroupName="Version" Margin="0,0,0,10"> -