Remove untimely buttons

Test patch to change button handling in the WebIf programme details pop-up:

    Remove “Record Programme” button if programme has started.
    Rename “Set Reminder” button to “Watch Now” if programme is showing.
    Remove all the above if the programme has finished.

MymsMan commented 2 weeks ago

Remove “Record Programme” button if programme has started.

Not a good idea - since you can actually record a programme after it has started which can be usefull

    If you only realise it is on at last moment
    If the humax has just restarted after crashing
    ...

Possibly change label to “Record active programme”

A useful change in this area would be to show “Cancel recording” “Skip” “Switch to alternate” buttons from the ‘Visual Schedule” popups if a programme has been scheduled for recording

df commented 2 weeks ago

Yes, “Record Programme” would be a better way to recover than “Watch Now” followed by Record (or IR Record) if the box is being managed out of eyeshot.

It doesn't seem to be easy to “change” the button name in jQ UI, but I am not an expert. Seems like you can either set up all possible buttons for the dialogue (an Object structure like { button1_label: action1(), button2_label: action2(), ...}) and then delete the dynamically unwanted ones, or add the dynamically wanted buttons to a base structure each time.

Seems like there's an opportunity to unify the epgpopup code for Visual Schedule and EPG? Otherwise perhaps could fake into the VS pop-up from the EPG one for scheduled recordings?
This commit is contained in:
df 2020-06-07 12:26:29 +00:00
parent cc3a79ca4a
commit 2fb25a22c4
1 changed files with 22 additions and 11 deletions

View File

@ -22,13 +22,6 @@ function doschedule(type)
var $buttons1 = {
"Close" : function() {$(this).dialog('close');}
};
var $buttons2 = $.extend(
{"Record Programme": function() { doschedule(1) }},
{"Set Reminder": function() { doschedule(3) }},
$buttons1);
var $buttons3 = $.extend(
{"Record Series": function() { doschedule(2) }},
$buttons2);
var $dialog = $('#epgpopup_dialogue').dialog({
title: "Programme Details",
@ -46,17 +39,35 @@ function epgpopup(e, o)
e.preventDefault();
var sch = o.attr('sch');
var rec = o.attr('rec');
$dialog.dialog("option", "buttons", $buttons1);
var state = o.attr('st');
var $buttons2 = $.extend(
{"Record Series": function() { doschedule(2) }},
{"Record Programme": function() { doschedule(1) }},
{"Set Reminder": function() { doschedule(3) }},
{"Watch Now": function() { doschedule(3) }},
$buttons1);
if (sch != 0)
$buttons = $buttons1;
else if (rec == 2)
$buttons = $buttons3;
else if (rec == 1)
else if (rec == 2 || rec == 1)
{
$buttons = $buttons2;
if (rec == 1) delete $buttons["Watch Now"];
}
else
$buttons = $buttons1;
if (state >= 1) {
delete $buttons["Record Programme"];
delete $buttons["Set Reminder"];
}
if (state == 0 || state == 2)
delete $buttons["Watch Now"];
}
$dialog.dialog("option", "buttons", $buttons);
var url = '/cgi-bin/epg/info.jim?service=' +
o.attr('xs') + '&event=' +
o.attr('xe') + '&bare=1';