diff --git a/PotatoNV-next/Controls/LogBox.xaml.cs b/PotatoNV-next/Controls/LogBox.xaml.cs index 9c0d305..ac22292 100644 --- a/PotatoNV-next/Controls/LogBox.xaml.cs +++ b/PotatoNV-next/Controls/LogBox.xaml.cs @@ -73,6 +73,17 @@ namespace PotatoNV_next.Controls } } + public void Clear() + { + if (!Dispatcher.CheckAccess()) + { + Dispatcher.Invoke(() => Clear()); + return; + } + + logBox.Clear(); + } + public LogBox() { InitializeComponent(); diff --git a/PotatoNV-next/MainWindow.xaml b/PotatoNV-next/MainWindow.xaml index 4d29487..3b6e4d5 100644 --- a/PotatoNV-next/MainWindow.xaml +++ b/PotatoNV-next/MainWindow.xaml @@ -37,6 +37,6 @@ - + diff --git a/PotatoNV-next/MainWindow.xaml.cs b/PotatoNV-next/MainWindow.xaml.cs index cfe7dad..0f776c5 100644 --- a/PotatoNV-next/MainWindow.xaml.cs +++ b/PotatoNV-next/MainWindow.xaml.cs @@ -2,6 +2,7 @@ using PotatoNV_next.Utils; using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -19,15 +20,33 @@ namespace PotatoNV_next { public partial class MainWindow : Window { + Core core = new Core(); public MainWindow() { Icon = MediaConverter.ImageSourceFromBitmap(Properties.Resources.Fire.ToBitmap()); InitializeComponent(); - var core = new Core(); - nvFrom.OnFormSubmit += core.StartProcess; + nvFrom.OnFormSubmit += NvFrom_OnFormSubmit; core.RunWorkerCompleted += Core_RunWorkerCompleted; + + SetupLog(); + } + + private void NvFrom_OnFormSubmit(Controls.NVForm.FormEventArgs formEventArgs) + { + SetupLog(); + core.StartProcess(formEventArgs); + } + + public void SetupLog() + { + logBox.Clear(); + Log.Info($"PotatoNV v{Controls.AboutTab.GetVersion()}"); + Log.Info("User manual: https://kutt.it/pnv-" + + (CultureInfo.InstalledUICulture.TwoLetterISOLanguageName == "ru" + ? "ru" + : "en")); } private void Core_RunWorkerCompleted()