Files
ChanSort/ChanSort.Loader.TllFile/TvSettingsForm.cs
hbeham d6570d18f3 - renamed loaders
- added experimental support for Panasonic
- fixed Encrypted-flag detection for Samsung Analog and DVB-C/T channels
- text editors now only open after holding the mouse button for 0.5sec
- new menu item/button for deleting channels from the right list
2013-04-21 22:04:06 +02:00

85 lines
2.6 KiB
C#

using System;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
namespace ChanSort.Loader.LG
{
public partial class TvSettingsForm : XtraForm
{
private readonly TllFileSerializer tvSerializer;
public TvSettingsForm(TllFileSerializer tvSerializer)
{
this.tvSerializer = tvSerializer;
InitializeComponent();
}
private void TvSettingsForm_Load(object sender, EventArgs e)
{
var items = tvSerializer.SupportedTvCountryCodes;
foreach(var item in items)
this.comboBoxEdit1.Properties.Items.Add(item);
this.comboBoxEdit1.Text = this.tvSerializer.TvCountryCode;
var mapping = this.tvSerializer.GetFirmwareMapping();
if (mapping != null)
{
this.grpInformation.Visible = false;
this.Height -= this.grpInformation.Height;
}
if (mapping == null || !mapping.SupportsAutoChannelUpdate)
{
this.grpSetup.Visible = false;
this.Height -= this.grpSetup.Height;
}
else
{
this.cbAutoChannelUpdate.Checked = mapping.SettingsAutomaticChannelUpdate;
}
if (mapping == null || !mapping.SupportsHbbTv)
this.cbHbbTv.Enabled = false;
else
this.cbHbbTv.Checked = mapping.HbbTvEnabled;
if (mapping == null || !mapping.SupportsHotelMenu)
{
this.grpHotelMode.Visible = false;
this.Height -= this.grpHotelMode.Height;
}
else
{
this.cbHotelMode.Checked = mapping.HotelModeEnabled;
this.cbDtvUpdate.Checked = mapping.HotelModeDtvUpdate;
}
}
private void btnOk_Click(object sender, EventArgs e)
{
this.tvSerializer.TvCountryCode = this.comboBoxEdit1.Text;
var mapping = this.tvSerializer.GetFirmwareMapping();
if (mapping != null)
{
mapping.SettingsAutomaticChannelUpdate = this.cbAutoChannelUpdate.Checked;
mapping.HbbTvEnabled = this.cbHbbTv.Checked;
mapping.HotelModeEnabled = this.cbHotelMode.Checked;
mapping.HotelModeDtvUpdate = this.cbDtvUpdate.Checked;
}
}
private void cbCustomCountry_CheckedChanged(object sender, EventArgs e)
{
this.comboBoxEdit1.Properties.TextEditStyle = this.cbCustomCountry.Checked
? TextEditStyles.Standard
: TextEditStyles.DisableTextEditor;
}
private void lblHotelMenuAutoDetect_Click(object sender, EventArgs e)
{
this.lblHotelMenuAutoDetect.Text = this.tvSerializer.GetHotelMenuOffset().ToString();
}
}
}