Screens should not be hard coded to use the skin for other screen elements

Issue #280 invalid
IanSav created an issue

In many places in the Enigma2 Python code a screen element has code that forces the use of the screen XML code for another screen element. For example the SLEEP (PowerTimer) screen is hard coded to use the TIMER screen: self.skinName = "TimerEditList" Screen.setTitle(self, _("PowerTimer List")) Rather than hard coding the choice of screens and screen titles this should be referred to the skin such that a panel can be used to replicate one screen into another screen: <screen name="TimerEditList" title="Timer List" ...> ... Visual design for the TimerEditList screen... </screen>

<screen name="PowerTimerEdit" title="PowerTimer List" ...> <panel name="TimerEditList" ... /> </screen> This is short, simple and does not add too much complication to the skin. More importantly it does not deny a skin author an opportunity to make independent changes to either screen's skin. They can be kept in sync or separated as desired without needing to edit Python code.

If there was to be any code to rewrite the skin definition it could be to supply a title if one is missing from the skin. This could pseudo coded something like: if Screen.Title is undefined or blank: print "Screen-name: Using default screen title "Default Screen Title". Screen.setTitle = (self, _("Default Screen Title")) It could also be possible to do the skinName substitution if the desired skin module is not found.

Reproduction steps

This is not a bug description that requires reproduction. It is more to report poor coding choices in the Python code behind many screens.

Comments (2)

  1. IanSav reporter
    • removed issue_update

    The issue was updated with the following change(s):

    • This issue's description has been changed
  2. Log in to comment