2018-10-03, 20:54
I have a small PR I'd like to put in regarding the context menus in the PVR Timers and Timer Rules areas, I thought I'd ask the community if this would be a good way to go or not. The small problem is that the context menu in Timers can be inconsistent with that in Timer Rules. Right-clicking on a Timer with a parent Timer Rule will always show "Edit Timer Rule", even if the Timer Rule is read-only (and also "Delete Timer Rule", for what it's worth). When the Timer Rule is right-clicked via Timer Rules, the "Edit" option will not be available if it is read-only.
The simplest solution for consistency would be to filter out "Edit Timer Rule" if the parent is read-only and match what Timer Rules does, but "Edit Timer Rule" against a read-only parent accesses a highly convenient read-only display of the rule. I personally like this very much.
So what I'm thinking of submitting is a set of small changes to adapt "Edit Timer Rule" (Timers) and "Edit" (Timer Rules) to instead be "View" if the timer rule is read-only, so there will always be either "Edit" or "View" in the context menus. At the same time also remove the "Delete Timer Rule" from the context menu in Timers if the parent happens to not be deletable. I think there some additional consequences regarding delete to consider with the Timers menus, there is that pop-up that asks to delete just the timer or the timer rule, I honestly haven't looked at that yet. I've barely looked at what I am proposing for what it's worth -- for all I know there already is a "View" in there
Anyway, if you folks think this is worth adjusting or not and if the plan sounds reasonable I would appreciate the feedback.
The simplest solution for consistency would be to filter out "Edit Timer Rule" if the parent is read-only and match what Timer Rules does, but "Edit Timer Rule" against a read-only parent accesses a highly convenient read-only display of the rule. I personally like this very much.
So what I'm thinking of submitting is a set of small changes to adapt "Edit Timer Rule" (Timers) and "Edit" (Timer Rules) to instead be "View" if the timer rule is read-only, so there will always be either "Edit" or "View" in the context menus. At the same time also remove the "Delete Timer Rule" from the context menu in Timers if the parent happens to not be deletable. I think there some additional consequences regarding delete to consider with the Timers menus, there is that pop-up that asks to delete just the timer or the timer rule, I honestly haven't looked at that yet. I've barely looked at what I am proposing for what it's worth -- for all I know there already is a "View" in there
Anyway, if you folks think this is worth adjusting or not and if the plan sounds reasonable I would appreciate the feedback.