Disable Snapcast and Radios if disconnected
This commit is contained in:
parent
124b263499
commit
53d7668fd6
@ -46,9 +46,12 @@ namespace unison
|
|||||||
{
|
{
|
||||||
if (_mpd.IsConnected())
|
if (_mpd.IsConnected())
|
||||||
{
|
{
|
||||||
Snapcast.IsEnabled = true;
|
|
||||||
ConnectionOkIcon.Visibility = Visibility.Visible;
|
ConnectionOkIcon.Visibility = Visibility.Visible;
|
||||||
ConnectionFailIcon.Visibility = Visibility.Collapsed;
|
ConnectionFailIcon.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
Snapcast.IsEnabled = true;
|
||||||
|
if (_radiosWin.IsConnected())
|
||||||
|
Radio.IsEnabled = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -56,10 +59,11 @@ namespace unison
|
|||||||
DefaultState(true);
|
DefaultState(true);
|
||||||
ConnectionOkIcon.Visibility = Visibility.Collapsed;
|
ConnectionOkIcon.Visibility = Visibility.Collapsed;
|
||||||
ConnectionFailIcon.Visibility = Visibility.Visible;
|
ConnectionFailIcon.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
Snapcast.IsEnabled = false;
|
||||||
|
Radio.IsEnabled = false;
|
||||||
}
|
}
|
||||||
_settingsWin.UpdateConnectionStatus();
|
_settingsWin.UpdateConnectionStatus();
|
||||||
if (_radiosWin.IsConnected())
|
|
||||||
Radio.IsEnabled = true;
|
|
||||||
Connection.Text = $"{Properties.Settings.Default.mpd_host}:{Properties.Settings.Default.mpd_port}";
|
Connection.Text = $"{Properties.Settings.Default.mpd_host}:{Properties.Settings.Default.mpd_port}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user