From 79552c20971d4a18f0420a6d5cf535f6f55790b5 Mon Sep 17 00:00:00 2001 From: Andrey Smirnoff <37037851+mashed-potatoes@users.noreply.github.com> Date: Sun, 25 Apr 2021 22:28:39 +0500 Subject: [PATCH] v2.2.0 --- PotatoNV-next/Controls/AboutTab.xaml.cs | 19 ++++---- PotatoNV-next/Controls/LogBox.xaml | 11 ++--- PotatoNV-next/Controls/LogBox.xaml.cs | 4 ++ PotatoNV-next/Controls/NVForm.xaml | 9 ++-- PotatoNV-next/Controls/NVForm.xaml.cs | 13 ++---- PotatoNV-next/Core.cs | 57 ++++++++++++------------ PotatoNV-next/MainWindow.xaml | 47 +++++++++++-------- PotatoNV-next/MainWindow.xaml.cs | 7 ++- PotatoNV-next/PotatoNV-next.csproj | 1 + PotatoNV-next/Properties/AssemblyInfo.cs | 4 +- PotatoNV-next/Utils/Common.cs | 30 +++++++++++++ 11 files changed, 119 insertions(+), 83 deletions(-) create mode 100644 PotatoNV-next/Utils/Common.cs diff --git a/PotatoNV-next/Controls/AboutTab.xaml.cs b/PotatoNV-next/Controls/AboutTab.xaml.cs index 989d65e..8d808f1 100644 --- a/PotatoNV-next/Controls/AboutTab.xaml.cs +++ b/PotatoNV-next/Controls/AboutTab.xaml.cs @@ -11,17 +11,16 @@ namespace PotatoNV_next.Controls public AboutTab() { InitializeComponent(); - version.Text = string.Format(version.Text, GetVersion(3)); - fireLogo.Source = MediaConverter.ImageSourceFromBitmap(Properties.Resources.Fire.ToBitmap()); - } + var versionTag = $"v{Common.GetAssemblyVersion(typeof(MainWindow).Assembly)}\n[" + + string.Join(", ", new (string AssemblyName, string Tag)[] { + ("Potato.Fastboot", "FB"), + ("Potato.ImageFlasher", "IF"), + ("LibUsbDotNet.LibUsbDotNet", "LD"), + ("libusb-1.0", "LU"), + }.Select(x => $"{x.Tag} v{Common.GetAssemblyVersion($"{x.AssemblyName}.dll") ?? "??"}").ToArray()) + "]"; - public static string GetVersion(int depth = 3) - { - return string.Join(".", - typeof(MainWindow).Assembly.GetName().Version - .ToString() - .Split('.') - .Take(depth)); + version.Text = versionTag; + fireLogo.Source = MediaConverter.ImageSourceFromBitmap(Properties.Resources.Fire.ToBitmap()); } private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) diff --git a/PotatoNV-next/Controls/LogBox.xaml b/PotatoNV-next/Controls/LogBox.xaml index 0d96a1b..92ed7ab 100644 --- a/PotatoNV-next/Controls/LogBox.xaml +++ b/PotatoNV-next/Controls/LogBox.xaml @@ -1,10 +1,6 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> @@ -13,9 +9,10 @@ + IsReadOnly="True" + ScrollViewer.VerticalScrollBarVisibility="Visible" /> diff --git a/PotatoNV-next/Controls/LogBox.xaml.cs b/PotatoNV-next/Controls/LogBox.xaml.cs index efb6f47..c60250a 100644 --- a/PotatoNV-next/Controls/LogBox.xaml.cs +++ b/PotatoNV-next/Controls/LogBox.xaml.cs @@ -37,7 +37,11 @@ namespace PotatoNV_next.Controls Dispatcher.Invoke(() => logBox.AppendText(e.Message)); return; } + logBox.AppendText(e.Message); + logBox.Focus(); + logBox.CaretIndex = logBox.Text.Length; + logBox.ScrollToEnd(); } private void OnProgress(Log.ProgressEventArgs progressEventArgs) diff --git a/PotatoNV-next/Controls/NVForm.xaml b/PotatoNV-next/Controls/NVForm.xaml index 2c65940..d33700e 100644 --- a/PotatoNV-next/Controls/NVForm.xaml +++ b/PotatoNV-next/Controls/NVForm.xaml @@ -4,7 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800" IsEnabledChanged="NVForm_IsEnabledChanged"> + IsEnabledChanged="NVForm_IsEnabledChanged"> - - - + +