Skip to content

Commit

Permalink
HTML Setup: Add a custom channel edit screen.
Browse files Browse the repository at this point in the history
Breaks the channel attributes into three categories:

1) Basic Settings: Those channel attributes which can be freely and without fatal consequence changed.  Channel Number, Callsign, XMLTV ID, Icon File, Visibility, Use EIT, etc.

2) Advanced Settings: Those channel attributes which, when changed incorrectly, could break the channel.  Advises the user to leave alone, hidden in an accordion.

3) Expert Information: Information which either must not be changed otherwise the channel cannot be updated (sourceid, chanid) or which we have no easy way of modifying without a whole slough of other information (modulation, frequency, SI Standard).

Still does not save, but we're basically one update function away from being able to do that.
  • Loading branch information
Robert McNamara committed Apr 12, 2011
1 parent 2b3de68 commit d583497
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 11 deletions.
4 changes: 4 additions & 0 deletions mythtv/html/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,7 @@
display: none;
}

.expert {
display: none;
}

84 changes: 84 additions & 0 deletions mythtv/html/setup/channeleditor-channeldetail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<div id='channelsettings'>
<h3><a href="#">Basic Settings</a></h3>
<div id='channeldetail-basicsettings'>
<p>
<table width="100%" cellpadding="0" cellspacing="10" border="0">
<tr>
<td>Channel Number:</td><td><input id='channelDetailSettingChanNum' /></td>
</tr>
<tr>
<td>Channel Name:</td><td><input id='channelDetailSettingChannelName' /></td>
</tr>
<tr>
<td>Callsign:</td><td><input id='channelDetailSettingCallSign' /></td>
</tr>
<tr>
<td>XMLTV ID:</td><td><input id='channelDetailSettingXMLTVID' /></td>
</tr>
<tr>
<td>Icon File:</td><td><input id='channelDetailSettingIconURL' /></td>
</tr>
<tr>
<td width="100%"><input id='channelDetailSettingVisible' type='checkbox'/> Make this channel visible</td>
</tr>
<tr>
<td width="100%"><input id='channelDetailSettingUseEIT' type='checkbox'/> Use Over-the-air guide data for this channel</td>
</tr>
</table>
</p>
</div>

<h3><a href="#">Advanced Settings</a></h3>
<div id='channeldetail-advancedsettings'>
<p>
<b>Do not edit these settings! You will almost certainly break your channel!</b>
<table width="100%" cellpadding="0" cellspacing="10" border="0">
<tr>
<td>Frequency ID:</td><td><input id='channelDetailSettingFrequencyId' /></td>
</tr>
<tr>
<td>Multiplex ID:</td><td><input id='channelDetailSettingMplexId' /></td>
</tr>
<tr>
<td>Service ID:</td><td><input id='channelDetailSettingServiceId' /></td>
</tr>
<tr>
<td>Format:</td><td><input id='channelDetailSettingFormat' /></td>
</tr>
<tr>
<td>Default Authority:</td><td><input id='channelDettailSettingDefaultAuthority' /></td>
</tr>
<tr>
<td>ATSC Major Channel:</td><td><input id='channelDetailSettingATSCMajorChannel' /></td>
</tr>
<tr>
<td>ATSC Minor Channel:</td><td><input id='channelDetailSettingATSCMinorChannel' /></td>
</tr>
</table>
</p>
</div>

<h3><a href="#">Expert Information</a></h3>
<div id='channeldetail-expertsettings'>
<p>
<table width="100%" cellpadding="0" cellspacing="10" border="0">
<tr>
<td width="50%">Channel ID:</td><td><div style="text-align:right" id='channelDetailSettingChanId'></div></td>
</tr>
<tr>
<td width="50%">Source ID:</td><td><div style="text-align:right" id='channelDetailSettingSourceId'></div></td>
</tr>
<tr>
<td width="50%">Channel Modulation:</td><td><div style="text-align:right" id='channelDetailSettingModulation'></div></td>
</tr>
<tr>
<td width="50%">Channel Frequency:</td><td><div style="text-align:right" id='channelDetailSettingFrequency'></div></td>
</tr>
<tr>
<td width="50%">SI Standard:</td><td><div style="text-align:right" id='channelDetailSettingSIStandard'></div></td>
</tr>
</table>
</p>
</div>

</div>
4 changes: 2 additions & 2 deletions mythtv/html/setup/channeleditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<table id="channels"></table>
<div id='pager'>
</div>
<div id='source' style="text-align:left">
<div id='source' style="float: left; text-align:left;">
<div id='sourceSelect'></div>
</div>
<div id='navigation' style="text-align:right">
<div id='navigation' style="float: right; text-align:right;">
<input type='button' onClick='javascript:editSelectedChannel()' value='Edit Channel' />
<input type='button' onClick='javascript:promptToDeleteChannel()' value='Delete Channel' />
</div>
59 changes: 50 additions & 9 deletions mythtv/html/setup/js/channeleditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function initChannelEditor() {
{name:'IconURL', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'IconURL'},
{name:'MplexId', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'MplexId'},
{name:'TransportId', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'TransportId'},
{name:'ServiceId', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'ServiceID'},
{name:'ServiceId', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'ServiceId'},
{name:'NetworkId', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'NetworkId'},
{name:'ATSCMajorChan', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'ATSCMajorChan'},
{name:'ATSCMinorChan', editable: true, width:0, align:"right", sortable:false, hidden:true, jsonmap: 'ATSCMinorChan'},
Expand Down Expand Up @@ -88,19 +88,60 @@ function initSourceList() {
}

function editSelectedChannel() {
var rowNum = $('#channels').getGridParam('selrow');
if (rowNum != null) {
$("#channels").jqGrid('editGridRow',rowNum,
{ modal: true,
width: 400,
height: 300
});
loadEditWindow("/setup/channeleditor-channeldetail.html");
var row = $('#channels').getGridParam('selrow');
var rowdata = $("#channels").jqGrid('getRowData', row);

/* Basic */

$("#channelDetailSettingChanNum").val(rowdata.ChanNum);
$("#channelDetailSettingChannelName").val(rowdata.ChannelName);
$("#channelDetailSettingCallSign").val(rowdata.CallSign);
$("#channelDetailSettingXMLTVID").val(rowdata.XMLTVID);
$("#channelDetailSettingIconURL").val(rowdata.IconURL);
if (rowdata.Visible == "Yes") {
$("#channelDetailSettingVisible").attr('checked', true);
}
if (rowdata.UseEIT == "Yes")
$("#channelDetailSettingUseEIT").attr('checked', true);

/* Advanced */

$("#channelDetailSettingFrequencyId").val(rowdata.FrequencyId);
$("#channelDetailSettingMplexId").val(rowdata.MplexId);
$("#channelDetailSettingServiceId").val(rowdata.ServiceId);
$("#channelDetailSettingFormat").val(rowdata.Format);
$("#channelDetailSettingDefaultAuthority").val(rowdata.DefaultAuth);
$("#channelDetailSettingATSCMajorChannel").val(rowdata.ATSCMajorChan);
$("#channelDetailSettingATSCMinorChannel").val(rowdata.ATSCMinorChan);

/* Expert */

$("#channelDetailSettingChanId").html("<b>" + rowdata.ChanId + "</b>");
$("#channelDetailSettingSourceId").html("<b>" + rowdata.SourceId + "</b>");
$("#channelDetailSettingModulation").html("<b>" + rowdata.Modulation + "</b>")
$("#channelDetailSettingFrequency").html("<b>" + rowdata.Frequency + "</b>")
$("#channelDetailSettingSIStandard").html("<b>" + rowdata.SIStandard + "</b>")

$("#edit").dialog({
modal: true,
width: 800,
height: 620,
'title': 'Edit Channel',
closeOnEscape: false,
buttons: {
'Save': function() {},
'Cancel': function() { $(this).dialog('close'); }
}});

$("#channelsettings").accordion();

$("#edit").dialog("open");
}

function promptToDeleteChannel() {
var message = "Are you sure you want to delete these channels? This cannot be undone.";
var rowNum = $('#channels').getGridParam('selarrrow');
var rowNum = $('#channels').getGridParam('selrow');
if (rowNum != null) {
if (rowNum.length == 1) {
message = "Are you sure you want to delete this channel? This cannot be undone.";
Expand Down

0 comments on commit d583497

Please sign in to comment.