@@ -38,8 +38,6 @@ public partial class MainWindow : Window
3838 public static readonly string ConfigFolder = Path . Join ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "MoSpeedUI.config" ) ;
3939 public static readonly string ConfigFile = Path . Join ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "MoSpeedUI.config" , "config.xml" ) ;
4040 public static readonly CompileConfig CompileConfig = new ( ) ;
41- public static Configuration AppConfiguration = new ( ) ;
42-
4341 public MainWindow ( )
4442 {
4543 InitializeComponent ( ) ;
@@ -141,7 +139,7 @@ public MainWindow()
141139
142140 private void ApplyConfig ( )
143141 {
144- if ( AppConfiguration . LogoDecoration )
142+ if ( Shared . AppConfiguration . LogoDecoration )
145143 {
146144 DateTime dt = DateTime . Today ;
147145 if ( dt . Month == 6 )
@@ -159,6 +157,11 @@ private void ApplyConfig()
159157 MoSpeedLogo . Source =
160158 new Bitmap ( AssetLoader . Open ( new Uri ( "avares://MoSpeedUI/Assets/Images/mospeed_halloween.png" ) ) ) ;
161159 }
160+ else
161+ {
162+ MoSpeedLogo . Source =
163+ new Bitmap ( AssetLoader . Open ( new Uri ( "avares://MoSpeedUI/Assets/Images/mospeed.png" ) ) ) ;
164+ }
162165 }
163166 }
164167 private void ReadConfig ( )
@@ -169,12 +172,12 @@ private void ReadConfig()
169172 bool redoConfig = false ;
170173 XmlSerializer ser = new XmlSerializer ( typeof ( Configuration ) ) ;
171174 StreamReader r = new StreamReader ( ConfigFile ) ;
172- AppConfiguration = ( Configuration ) ser . Deserialize ( r ) ! ;
175+ Shared . AppConfiguration = ( Configuration ) ser . Deserialize ( r ) ! ;
173176 r . Close ( ) ;
174- foreach ( PropertyDescriptor descriptor in TypeDescriptor . GetProperties ( AppConfiguration ) )
177+ foreach ( PropertyDescriptor descriptor in TypeDescriptor . GetProperties ( Shared . AppConfiguration ) )
175178 {
176179 string name = descriptor . Name ;
177- object ? value = descriptor . GetValue ( AppConfiguration ) ;
180+ object ? value = descriptor . GetValue ( Shared . AppConfiguration ) ;
178181 Console . WriteLine ( "{0}={1}" , name , value ) ;
179182 if ( Equals ( value , descriptor . GetValue ( propConfig ) ) )
180183 {
@@ -184,7 +187,7 @@ private void ReadConfig()
184187 }
185188 if ( redoConfig )
186189 {
187- SetupWindow . RegenerateConfig ( AppConfiguration ) ;
190+ SetupWindow . RegenerateConfig ( Shared . AppConfiguration ) ;
188191 }
189192 }
190193 catch ( Exception e )
@@ -346,7 +349,7 @@ private async void CompileBtn_OnClick(object? sender, RoutedEventArgs e)
346349
347350 /*private async Task<bool> CheckForJava()
348351 {
349- if (AppConfiguration.SkipJavaCheck)
352+ if (Shared. AppConfiguration.SkipJavaCheck)
350353 {
351354 return true;
352355 }
@@ -404,8 +407,8 @@ private async void CompileBtn_OnClick(object? sender, RoutedEventArgs e)
404407 }
405408 if (res == Lang.Resources.Ignore)
406409 {
407- AppConfiguration.SkipJavaCheck = true;
408- SetupWindow.RegenerateConfig(AppConfiguration);
410+ Shared. AppConfiguration.SkipJavaCheck = true;
411+ SetupWindow.RegenerateConfig(Shared. AppConfiguration);
409412 return true;
410413 }
411414 return true;
@@ -425,8 +428,8 @@ private async void CompileBtn_OnClick(object? sender, RoutedEventArgs e)
425428 var res = await box.ShowAsPopupAsync(this);
426429 if (res == Lang.Resources.Ignore)
427430 {
428- AppConfiguration.SkipJavaCheck = true;
429- SetupWindow.RegenerateConfig(AppConfiguration);
431+ Shared. AppConfiguration.SkipJavaCheck = true;
432+ SetupWindow.RegenerateConfig(Shared. AppConfiguration);
430433 return true;
431434 }
432435 return false;
@@ -559,5 +562,7 @@ private void AboutLink_OnPointerPressed(object? sender, PointerPressedEventArgs
559562
560563 private void SettingsLink_OnPointerPressed ( object ? sender , PointerPressedEventArgs e )
561564 {
565+ new SettingsDialog ( ) . ShowDialog ( this ) ;
566+ ApplyConfig ( ) ;
562567 }
563568}
0 commit comments