From 29968557d492b92c284448ce759db9586ceb1cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bl=C3=B6macher?= Date: Sun, 28 Jul 2024 01:02:53 +0200 Subject: [PATCH] Fixed songs getting posted when the settings window is opened --- Songify Slim/Views/SettingsWindow.xaml.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Songify Slim/Views/SettingsWindow.xaml.cs b/Songify Slim/Views/SettingsWindow.xaml.cs index 8dd48d55..6fcb1ef1 100644 --- a/Songify Slim/Views/SettingsWindow.xaml.cs +++ b/Songify Slim/Views/SettingsWindow.xaml.cs @@ -698,15 +698,13 @@ private void NudMaxReq_ValueChanged(object sender, RoutedPropertyChangedEventArg } } - private void SettingsWindow_Loaded(object sender, RoutedEventArgs e) + private async void SettingsWindow_Loaded(object sender, RoutedEventArgs e) { // assign mw to mainwindow for calling methods and setting texts etc foreach (Window window in Application.Current.Windows) if (window.GetType() == typeof(MainWindow)) _mW = window; - - // add colors to the combobox foreach (string s in ThemeManager.Current.ColorSchemes) { @@ -734,7 +732,7 @@ private void SettingsWindow_Loaded(object sender, RoutedEventArgs e) Settings.Color = (string)s.Content; } } - SetControls(); + await SetControls(); } private void tb_ClientID_TextChanged(object sender, TextChangedEventArgs e) @@ -808,13 +806,21 @@ private void TxtbxCustompausetext_TextChanged(object sender, TextChangedEventArg private void TxtbxOutputformat_TextChanged(object sender, TextChangedEventArgs e) { + if (!IsLoaded) + return; // write custom output format to settings + if(TxtbxOutputformat.Text == Settings.OutputString) + return; Settings.OutputString = TxtbxOutputformat.Text; GlobalObjects.ForceUpdate = true; } private void TxtbxOutputformat2_TextChanged(object sender, TextChangedEventArgs e) { + if (!IsLoaded) + return; + if (TxtbxOutputformat2.Text == Settings.OutputString2) + return; Settings.OutputString2 = ((TextBox)sender).Text; }