GREEN button text overlaid in EPG Search after Add Timer

Issue #381 resolved
prl created an issue

Reproduction steps

In Graphical EPG, navigate to a program that repeats within the week.

Press YELLOW EPG Search.

Navigate to any entry in the search results and press GREEN Add Timer.

In the Timer Edit screen press OK to accept the timer.

On return to the EPG Search screen, the GREEN button hint has Change timer/Add timer overwritten in the button text.

Comments (8)

  1. prl reporter

    Components.Button has a dummy implementation of code allows it to be a Source in a <widget source= .../> screen widget without crashing, and Components.Label shares this characteristic with it.

    Having a <widget source= ... render="Label" ... /> screen widget for a Components.Button attaches a Components.Renderer.Label renderer to the widget, but the dummy implementation of the "Source" code Components.Button in means that changes to the text in the Components.Button aren't pushed downstream to the renderer.

    Since there is also a <widget name= ... /> screen widget for the Components.Button, there are two objects displaying in the same spot, the Components.Button and the Components.Renderer.Label. However, when Button.setText() is called, there's no corresponding "push" of the new value to the renderer, so its display isn't changed.

    If the Button is given an initial text value, though, when the Components.Renderer.Label connects to the Components.Button, it reads the text value of the Button and displays it (independently of the display in the Components.Button).

    However, if Components.Button.setText() is called with a new value, this value is displayed in the Components.Button, but it is not propagated to the Components.Renderer.Label, resulting in over-writing.

    So:

            # in __init__()
            self["key_green"] = Button("Initial value")
            ...
            # after the skin has been applied (e.g. during user interaction)
            self["key_green"].setText("Some other value")
    

    creates overwriting

    But:

            # in __init__()
            self["key_green"] = Button()
            ...
            # after the skin has been applied, but before the screen is displayed
            self["key_green"] = Button("Initial value")
            ...
            # while the user is interacting with the screen
            self["key_green"].setText("Some other value")
    

    works as it should

    All the above applies equally if Components.Label is used rather than Components.Button.

  2. Peter Urbanec

    Fix bug #381: GREEN button text overlaid in EPG Search after Add Timer

    Add Components.Label.DummySource that allows a text widget to appear in a <widget source= ... /> element in a screen skin but not display on the screen.

    Use Components.Label.DummySource Components.Button.Button and Components.Label.Label so that when they are used in <widget source= ... /> widgets, the apparent intention of the code to make the widget inactive and not display, is completed, so that neither text arguments to the constructor nor text= widget attributes will be displayed on the screen.

    This prevents text overwriting when the same Component instance appears in both a <widget source= ... /> and a <widget name= /> skin widget.

    Also change GUIComponent.applySkin() to Label.applySkin() in MultiColorLabel.applySkin(), which it should have been anyway, but which is now required by the changes to Label.

    → <<cset c7d57e758d7e>>

  3. Peter Urbanec

    Fix bug #381: GREEN button text overlaid in EPG Search after Add Timer - refix

    The original fix for this bug set the Label/Button text to "" too early, so that any references to widget.getText() in the widget's Screen.init() returned "".

    This caused problems in other parts of the UI, including crashing when number buttons were used to change channel in live TV.

    This fix sets the widget text field at the normal time, but saves it and sets the text to "" when a downstream Converter/Renderer connects, so that the downstream receives "" when it reads widget.text in the connection process.

    The text is restored to its correct value in widget.applySkin(), as in the original fix.

    This should prevent any user code "seeing" the changed text value as "".

    → <<cset 49735abc70bb>>

  4. Log in to comment