Skip to content

Commit

Permalink
Fixed songs getting posted when the settings window is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
Inzaniity committed Jul 27, 2024
1 parent 38f2375 commit 2996855
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Songify Slim/Views/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 2996855

Please sign in to comment.