mirror of
https://github.com/mashed-potatoes/PotatoNV.git
synced 2024-11-10 01:02:20 +01:00
Clean logbox on start
This commit is contained in:
parent
bdc4efe03a
commit
5aaa1fa6a4
3 changed files with 33 additions and 3 deletions
|
@ -73,6 +73,17 @@ namespace PotatoNV_next.Controls
|
|||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
if (!Dispatcher.CheckAccess())
|
||||
{
|
||||
Dispatcher.Invoke(() => Clear());
|
||||
return;
|
||||
}
|
||||
|
||||
logBox.Clear();
|
||||
}
|
||||
|
||||
public LogBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
|
|
@ -37,6 +37,6 @@
|
|||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<controls:LogBox />
|
||||
<controls:LogBox x:Name="logBox" />
|
||||
</UniformGrid>
|
||||
</Window>
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue