mirror of
https://github.com/mashed-potatoes/PotatoNV.git
synced 2024-11-13 02:14:13 +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()
|
public LogBox()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
|
@ -37,6 +37,6 @@
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|
||||||
<controls:LogBox />
|
<controls:LogBox x:Name="logBox" />
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using PotatoNV_next.Utils;
|
using PotatoNV_next.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -19,15 +20,33 @@ namespace PotatoNV_next
|
||||||
{
|
{
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
|
Core core = new Core();
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
Icon = MediaConverter.ImageSourceFromBitmap(Properties.Resources.Fire.ToBitmap());
|
Icon = MediaConverter.ImageSourceFromBitmap(Properties.Resources.Fire.ToBitmap());
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
var core = new Core();
|
nvFrom.OnFormSubmit += NvFrom_OnFormSubmit;
|
||||||
nvFrom.OnFormSubmit += core.StartProcess;
|
|
||||||
core.RunWorkerCompleted += Core_RunWorkerCompleted;
|
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()
|
private void Core_RunWorkerCompleted()
|
||||||
|
|
Loading…
Reference in a new issue