Compare commits

...

3 Commits

Author SHA1 Message Date
df 2fb25a22c4 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?
2020-06-07 12:26:29 +00:00
df cc3a79ca4a Add time state for epg popup 2020-06-05 20:41:02 +00:00
df 479510760c Add time state for epg popup
Add time state for epg popup: 0, 1, 2 -> pending, showing, finished
2020-06-05 20:31:40 +00:00
3 changed files with 34 additions and 13 deletions

View File

@ -104,8 +104,16 @@ proc slink {e} {
} else {
set ro 1
}
set perc [$e percent]
if {$perc >= 100} {
set state 2
} elseif {$perc > 0} {
set state 1
} else {
set state 0
}
set st [$e scheduled]
return "<a class=event href=# xs=$service xe=[$e get event_id] sch=$st rec=$ro>"
return "<a class=event href=# xs=$service xe=[$e get event_id] sch=$st rec=$ro st=$state>"
}
proc prog {e {cont 0} {hour 99}} {

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';

View File

@ -296,6 +296,8 @@ foreach e $records {
set showing 0
if {$perc > 0 && $perc < 100} { set showing 1 }
set state $($perc >= 100 ? 2: $showing)
set txt "[cgi_quote_html [$e get name]] <span>([\
clock format $es -format "%H:%M"] - [\
clock format $ee -format "%H:%M"])"
@ -321,7 +323,7 @@ foreach e $records {
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
<a class=event href=# xs=[$e get service_id]
xe=[$e get event_id] sch=[$e get sched_type]
rec=$recopts>"
rec=$recopts st=$state>"
puts $txt
puts "</a>"
puts "</div>"