File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed
Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,17 @@ private void OnProgress(ProgressEventArgs progressEventArgs)
7373 }
7474 }
7575
76+ public void Clear ( )
77+ {
78+ if ( ! Dispatcher . CheckAccess ( ) )
79+ {
80+ Dispatcher . Invoke ( ( ) => Clear ( ) ) ;
81+ return ;
82+ }
83+
84+ logBox . Clear ( ) ;
85+ }
86+
7687 public LogBox ( )
7788 {
7889 InitializeComponent ( ) ;
Original file line number Diff line number Diff line change 3737 </TabItem >
3838 </TabControl >
3939
40- <controls : LogBox />
40+ <controls : LogBox x : Name = " logBox " />
4141 </UniformGrid >
4242</Window >
Original file line number Diff line number Diff line change 22using PotatoNV_next . Utils ;
33using System ;
44using System . Collections . Generic ;
5+ using System . Globalization ;
56using System . Linq ;
67using System . Text ;
78using System . Threading . Tasks ;
@@ -19,15 +20,33 @@ namespace PotatoNV_next
1920{
2021 public partial class MainWindow : Window
2122 {
23+ Core core = new Core ( ) ;
2224
2325 public MainWindow ( )
2426 {
2527 Icon = MediaConverter . ImageSourceFromBitmap ( Properties . Resources . Fire . ToBitmap ( ) ) ;
2628 InitializeComponent ( ) ;
2729
28- var core = new Core ( ) ;
29- nvFrom . OnFormSubmit += core . StartProcess ;
30+ nvFrom . OnFormSubmit += NvFrom_OnFormSubmit ;
3031 core . RunWorkerCompleted += Core_RunWorkerCompleted ;
32+
33+ SetupLog ( ) ;
34+ }
35+
36+ private void NvFrom_OnFormSubmit ( Controls . NVForm . FormEventArgs formEventArgs )
37+ {
38+ SetupLog ( ) ;
39+ core . StartProcess ( formEventArgs ) ;
40+ }
41+
42+ public void SetupLog ( )
43+ {
44+ logBox . Clear ( ) ;
45+ Log . Info ( $ "PotatoNV v{ Controls . AboutTab . GetVersion ( ) } ") ;
46+ Log . Info ( "User manual: https://kutt.it/pnv-"
47+ + ( CultureInfo . InstalledUICulture . TwoLetterISOLanguageName == "ru"
48+ ? "ru"
49+ : "en" ) ) ;
3150 }
3251
3352 private void Core_RunWorkerCompleted ( )
You can’t perform that action at this time.
0 commit comments