Disable radios if not connected to MPD
This commit is contained in:
parent
3f74b1a4e7
commit
124b263499
@ -58,6 +58,8 @@ namespace unison
|
||||
ConnectionFailIcon.Visibility = Visibility.Visible;
|
||||
}
|
||||
_settingsWin.UpdateConnectionStatus();
|
||||
if (_radiosWin.IsConnected())
|
||||
Radio.IsEnabled = true;
|
||||
Connection.Text = $"{Properties.Settings.Default.mpd_host}:{Properties.Settings.Default.mpd_port}";
|
||||
}
|
||||
|
||||
@ -188,11 +190,6 @@ namespace unison
|
||||
SnapcastText.Text = unison.Resources.Resources.StartSnapcast;
|
||||
}
|
||||
|
||||
public void OnRadioBrowserConnected()
|
||||
{
|
||||
Radio.IsEnabled = true;
|
||||
}
|
||||
|
||||
public void UpdateButton(ref Border border, bool b)
|
||||
{
|
||||
border.Style = b ? (Style)Resources["SelectedButton"] : (Style)Resources["UnselectedButton"];
|
||||
|
@ -54,6 +54,9 @@ namespace unison
|
||||
{
|
||||
private RadioBrowserClient _radioBrowser;
|
||||
private MPDHandler _mpd;
|
||||
private bool _connected = true;
|
||||
|
||||
public bool IsConnected() => _connected;
|
||||
|
||||
public Radios()
|
||||
{
|
||||
@ -69,11 +72,8 @@ namespace unison
|
||||
Debug.WriteLine("Exception while connecting to RadioBrowser: " + e.Message);
|
||||
return;
|
||||
}
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
MainWindow MainWin = (MainWindow)Application.Current.MainWindow;
|
||||
MainWin.OnRadioBrowserConnected();
|
||||
});
|
||||
|
||||
_connected = true;
|
||||
}
|
||||
|
||||
public async void Initialize()
|
||||
|
Loading…
Reference in New Issue
Block a user