@@ -121,6 +121,8 @@ public MainWindow()
121121 CultureInfo . DefaultThreadCurrentUICulture = CultureInfo . InvariantCulture ;
122122 Language = System . Windows . Markup . XmlLanguage . GetLanguage ( CultureInfo . InvariantCulture . Name ) ;
123123
124+ CheckUserConfigFile ( ) ;
125+
124126 MinerProcessor = new API . MinerProcessor ( this ) ;
125127 MinerProcessor . OnResponse += MinerProcessor_OnResponse ;
126128 MinerProcessor . OnRequestSettings += MinerProcessor_OnRequestSettings ;
@@ -508,9 +510,9 @@ private void _minerInstance_OnLogUpdated(string updatedLog, string newLog, int r
508510
509511 var newParagraph = new Paragraph ( ) ;
510512 newParagraph . Inlines . Add ( newLog ) ;
511- newParagraph . Foreground = newLog . StartsWith ( "[ERROR]" )
513+ newParagraph . Foreground = ( newLog . IndexOf ( "[ERROR]" ) > - 1 )
512514 ? Brushes . Red
513- : newLog . StartsWith ( "[WARN]" )
515+ : ( newLog . IndexOf ( "[WARN]" ) > - 1 )
514516 ? Brushes . Yellow
515517 : ( Brush ) FindResource ( SystemColors . ControlTextBrushKey ) ;
516518
@@ -948,6 +950,27 @@ private async Task StopMiner()
948950
949951 #region Settings
950952
953+ private void CheckUserConfigFile ( )
954+ {
955+ var configFile = Helper . FileSystem . LocalAppDirectory .
956+ Parent .
957+ GetFiles ( "user.config" , SearchOption . AllDirectories ) .
958+ FirstOrDefault ( ) ;
959+
960+ if ( configFile != null && new Version ( configFile . Directory . Name ) < Helper . Processor . GetUIVersion )
961+ {
962+ try
963+ {
964+ var currentPath = new DirectoryInfo ( System . IO . Path . Combine ( configFile . Directory . Parent . FullName ,
965+ Helper . Processor . GetUIVersion . ToString ( ) ) ) ;
966+ configFile . Directory . MoveTo ( currentPath . FullName ) ;
967+
968+ Properties . Settings . Default . Reload ( ) ;
969+ }
970+ catch { }
971+ }
972+ }
973+
951974 private async Task SaveSettings ( )
952975 {
953976 if ( _isSettingsChanged )
0 commit comments