Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved error messages and logs

  • Loading branch information...
commit e9082dd8e20dc0649a148f8cd5896fcfb42ee12a 1 parent 5f4c221
michael--t authored
View
32 mediaportal/Configuration/Sections/Radio.cs
@@ -21,6 +21,7 @@
#region Using
using System;
+using System.Collections.Generic;
using System.Windows.Forms;
using MediaPortal.Profile;
using MediaPortal.UserInterface.Controls;
@@ -256,14 +257,33 @@ private void comboBoxGroups_DropDown(object sender, EventArgs e)
// Fill comboBox with radio channel names
comboBoxGroups.Items.Clear();
comboBoxGroups.Items.Add("(none)");
-
int selectedIdx = 0;
- TvServerRemote.HostName = TVRadio.Hostname;
- foreach (string groupName in TvServerRemote.GetRadioChannelGroupNames())
+
+ if (string.IsNullOrEmpty(TVRadio.Hostname))
+ {
+ MessageBox.Show("Unable to get radio channel groups from the TV Server." +
+ Environment.NewLine + "No valid hostname specified in the \"TV/Radio\" section.",
+ "Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ }
+ else
{
- int idx = comboBoxGroups.Items.Add(groupName);
- if (groupName == _rootGroup)
- selectedIdx = idx;
+ TvServerRemote.HostName = TVRadio.Hostname;
+ List<string> groupNames = TvServerRemote.GetRadioChannelGroupNames();
+ if (groupNames.Count == 0)
+ {
+ MessageBox.Show(string.Format("Unable to get radio channel groups from the TV Server on host \"{0}\".", TVRadio.Hostname) +
+ Environment.NewLine + "Version incompatibility of MP Client and TV Server?",
+ "Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ }
+ else
+ {
+ foreach (string groupName in groupNames)
+ {
+ int idx = comboBoxGroups.Items.Add(groupName);
+ if (groupName == _rootGroup)
+ selectedIdx = idx;
+ }
+ }
}
comboBoxGroups.SelectedIndex = selectedIdx;
View
12 mediaportal/Configuration/Sections/TVRadio.cs
@@ -390,7 +390,7 @@ private bool VerifyHostname(string hostname, bool verbose)
Log.Debug("VerifyHostname: unable to connect to TV server on host \"{0}\"", hostname);
if (verbose)
MessageBox.Show(string.Format("Unable to connect to TV server on host \"{0}\"", hostname),
- "TV Client Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ "TV/Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
@@ -405,7 +405,7 @@ private bool VerifyHostname(string hostname, bool verbose)
Log.Debug("VerifyHostname: unable to get data from TV server on host \"{0}\"", hostname);
if (verbose)
MessageBox.Show(string.Format("Unable to get data from TV server on host \"{0}\"", hostname),
- "TV Client Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ "TV/Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
@@ -477,7 +477,7 @@ private bool UpdateGentleConfig(string hostname, bool unchanged)
{
Log.Error("UpdateGentleConfig: unable to open gentle.config" + Environment.NewLine + "{0}", ex.Message);
MessageBox.Show(string.Format("Unable to open gentle.config" + Environment.NewLine + "{0}", ex.Message),
- "TV Client Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ "TV/Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
@@ -502,7 +502,7 @@ private bool UpdateGentleConfig(string hostname, bool unchanged)
{
Log.Error("UpdateGentleConfig: unable to get database connection string from TV server \"{0}\"", hostname);
MessageBox.Show(string.Format("Unable to get database connection string from TV server \"{0}\"", hostname),
- "TV Client Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ "TV/Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
@@ -517,7 +517,7 @@ private bool UpdateGentleConfig(string hostname, bool unchanged)
{
Log.Error("UpdateGentleConfig: unable to modify gentle.config" + Environment.NewLine + "{0}", ex.Message);
MessageBox.Show(string.Format("Unable to modify gentle.config" + Environment.NewLine + "{0}", ex.Message),
- "TV Client Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ "TV/Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
@@ -705,7 +705,7 @@ private void mpButtonTestConnection_Click(object sender, EventArgs e)
// Show success message
MessageBox.Show("Connection to the TV server successful",
- "TV Client Settings", MessageBoxButtons.OK, MessageBoxIcon.None);
+ "TV/Radio Settings", MessageBoxButtons.OK, MessageBoxIcon.None);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.