Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £129! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £179! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

Skinning concept

Ok, msgids with non-English texts, those are genres transmitted by certain broadcasters. e.g. Italian broadcasters may show ""Altri Programmi" instead of "Other programmes". We are not in control of the language the broadcaster sends those in, so if we want them displayed in the correct language we must translate them from the source. https://github.com/OpenViX/enigma2/blob/Developer/lib/python/Components/Converter/genre.py#L906

Regarding the time formatting, that is code written by IanSav before he switched to OpenATV. I have no idea why he thought all those different formats were necessary.
 
i have another question regarding hierarchical skin design:

Code:
<screen name="JobCockpit" position="fill" flags="wfNoBorder" backgroundColor="transparent">
    <panel name="Screen_3" />
    <panel position="center,center" size="1416,700">
        <widget position="20,0" render="Listbox" scrollbarMode="showOnDemand" size="e-40,640" source="list" itemCornerRadius="6">
            <convert type="TemplatedMultiContent">
                {
                    "template": [
                        MultiContentEntryText(pos=(10,0),size=(1000,40),flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER,font=0, text=0),
                        MultiContentEntryText(pos=(10,40),size=(200,40),flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER,font=0, text=1),
                        MultiContentEntryProgress(pos=(250,50),size=(1000,20),percent=-2, borderWidth=1),
                        MultiContentEntryText(pos=(1266,40),size=(100,40),flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER,font=0, text=3),
                    ],
                    "fonts": [gFont("Regular",28)],
                    "itemHeight": 80
                }
            </convert>
        </widget>
    </panel>
</screen>
this skin definition basically works.
however, i was wondering if the design is correct. especially this line:
Code:
 <panel position="center,center" size="1416,700">
my intent is to define a content panel within the Screen_3 panel.
so i thought, i could define the content panel relative to the Screen_3 base panel. maybe like this:
Code:
 <panel position="10, 100" size="e-20,e-200">
so that i can start positioning the elements with origin 0,0 and use e as the width, height of the content panel.
but this doesnt work. it positions the content panel outside of the base panel.
how would i do it correctly?
thanks.
 
You can make panels with 0,0 positioning and place them inside a parent panel and control positioning from there. But you can't control size from the parent panel... the items will spill outside the sizing of the parent panel. Look at the infobar of the emergency skin. The colour buttons are panels with 0,0 positioning and position controlled from the parent panel.
 
Code:
<!-- Red button png -->
    <screen name="__ButtonGraphicRed__"><!-- position="165*f,e-34*f" -->
        <widget objectTypes="key_red,StaticText,Boolean" source="key_red" render="Pixmap" pixmap="buttons/red.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1">
            <convert type="ConditionalShowHide"/>
        </widget>
        <ePixmap objectTypes="key_red,Button,Label" pixmap="buttons/red.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1"/>
    </screen>
    
    <!-- Green button png -->
    <screen name="__ButtonGraphicGreen__"><!-- position="445*f,e-34*f" -->
        <widget objectTypes="key_green,StaticText,Boolean" source="key_green" render="Pixmap" pixmap="buttons/green.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1">
            <convert type="ConditionalShowHide"/>
        </widget>
        <ePixmap objectTypes="key_green,Button,Label" pixmap="buttons/green.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1"/>
    </screen>

    <!--Yellow button png -->
    <screen name="__ButtonGraphicYellow__"><!-- position="725*f,e-34*f" -->
        <widget objectTypes="key_yellow,StaticText,Boolean" source="key_yellow" render="Pixmap" pixmap="buttons/yellow.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1">
            <convert type="ConditionalShowHide"/>
        </widget>
        <ePixmap objectTypes="key_yellow,Button,Label" pixmap="buttons/yellow.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1"/>
    </screen>

    <!-- Blue button png -->
    <screen name="__ButtonGraphicBlue__"><!-- position="1005*f,e-34*f" -->
        <widget objectTypes="key_blue,StaticText,Boolean" source="key_blue" render="Pixmap" pixmap="buttons/blue.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1">
            <convert type="ConditionalShowHide"/>
        </widget>
        <ePixmap objectTypes="key_blue,Button,Label" pixmap="buttons/blue.png"
            position="0,0" size="25*f,25*f" alphatest="blend" transparent="1" scale="1"/>
    </screen>

    <!-- Red button text -->
    <screen name="__ButtonTextRed__"><!-- position="200*f,e-34*f" -->
        <widget objectTypes="key_red,Label,Button" name="key_red"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
        <widget objectTypes="key_red,StaticText" source="key_red" render="Label"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
    </screen>

    <!-- Green button text -->
    <screen name="__ButtonTextGreen__"><!-- position="480*f,e-34*f" -->
        <widget objectTypes="key_green,Label,Button" name="key_green"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
        <widget objectTypes="key_green,StaticText" source="key_green" render="Label"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
    </screen>

    <!-- Yellow button text -->
    <screen name="__ButtonTextYellow__"><!-- position="760*f,e-34*f" -->
        <widget objectTypes="key_yellow,Label,Button" name="key_yellow"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
        <widget objectTypes="key_yellow,StaticText" source="key_yellow" render="Label"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
    </screen>

    <!-- Blue button text -->
    <screen name="__ButtonTextBlue__"><!-- position="1040*f,e-34*f" -->
        <widget objectTypes="key_blue,Label,Button" name="key_blue"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
        <widget objectTypes="key_blue,StaticText" source="key_blue" render="Label"
            position="0,0" size="240*f,25*f" zPosition="1" transparent="1"
            font="Regular;20*f" halign="left" valign="center"/>
    </screen>

    <!-- Individual Button Templates -->
    <screen name="__ButtonRed__">
        <panel position="0,0" size="25*f,25*f">
            <panel name="__ButtonGraphicRed__"/>
        </panel>
        <panel position="35*f,0" size="240*f,25*f">
            <panel name="__ButtonTextRed__"/>
        </panel>
    </screen>

    <screen name="__ButtonGreen__">
        <panel position="0,0" size="25*f,25*f">
            <panel name="__ButtonGraphicGreen__"/>
        </panel>   
        <panel position="35*f,0" size="240*f,25*f">
            <panel name="__ButtonTextGreen__"/>
        </panel>
    </screen>

    <screen name="__ButtonYellow__">
        <panel position="0,0" size="25*f,25*f">
            <panel name="__ButtonGraphicYellow__"/>
        </panel>
        <panel position="35*f,0" size="240*f,25*f">
            <panel name="__ButtonTextYellow__"/>
        </panel>
    </screen>

    <screen name="__ButtonBlue__">
        <panel position="0,0" size="25*f,25*f">
            <panel name="__ButtonGraphicBlue__"/>
        </panel>
        <panel position="35*f,0" size="240*f,25*f">
            <panel name="__ButtonTextBlue__"/>
        </panel>
    </screen>

    <!-- Button Template -->
    <screen name="__ButtonTemplate__">
        <panel position="165*f,e-34*f" size="275*f,25*f">
            <panel name="__ButtonRed__"/>
        </panel>
        <panel position="445*f,e-34*f" size="275*f,25*f">
            <panel name="__ButtonGreen__"/>
        </panel>
        <panel position="725*f,e-34*f" size="275*f,25*f">
            <panel name="__ButtonYellow__"/>
        </panel>
        <panel position="1005*f,e-34*f" size="275*f,25*f">
            <panel name="__ButtonBlue__"/>
        </panel>
        <panel name="__KeyMenuAutoTemplate__"/>
        <panel name="__KeyInfoAutoTemplate__"/>
        <panel name="__KeyHelpAutoTemplate__"/>
        <panel name="__KeyTextAutoTemplate__"/>
        <panel name="__VKeyIconPanel__"/>
    </screen>
 
@DimitarCC
i was wondering why the date format was not shown correctly in the darkos skin although the translation was in de.po.
i found that the skin is using a hardcoded format:

Code:
    <widget backgroundColor="background" font="Bold; 30" foregroundColor="white" halign="center" position="1590,990" render="Label" size="320,35" source="global.CurrentTime" transparent="1" valign="top" zPosition="20">
        <convert type="ClockToText">Format: %d %B</convert>
could this be made "translatable"?
 
maybe the ClockToText Converter can be changed to translate the Format parameter... i'll have a look.
 
Code:
        args = [arg.lstrip() for arg in type.split(parse)]
        for arg in args:
            if arg[0:6] == "Format":
                self.formats.append(eval("lambda t: strftime(\"%s\", localtime(t))" % arg[7:]))
                continue
an easy fix would be: _(arg[7:])
 
Code:
        args = [arg.lstrip() for arg in type.split(parse)]
        for arg in args:
            if arg[0:6] == "Format":
                self.formats.append(eval("lambda t: strftime(\"%s\", localtime(t))" % arg[7:]))
                continue
an easy fix would be: _(arg[7:])
i tested it and had to modify the fix to: _(arg[7:].strip())
 
This can't work. In order for the translation to work the stings must be harvestable. e.g. an identical string must exist already in enigma. If not the string will be lost from de.po on build.
 
yes, the string needs to be added where the other format strings are defined.
 
yes, the string needs to be added where the other format strings are defined.
Well how would we do that? How are we supposed to know what format strings a third party skin might contain?
 
yes, third party is difficult. the po file already defines so many formats. we could change the skin to use one that is defined.
infobar skin e.g. uses a different format that is defined and now with my change displays correctly.
 
so in UsageConfig you could add something that doesn't even become a variable e.g.

Code:
[_("%d %B"), _("etc"), _("etc")]  # Time formats used by some third party skins
 
so in UsageConfig you could add something that doesn't even become a variable e.g.

Code:
[_("%d %B"), _("etc"), _("etc")]  # Time formats used by some third party skins
that would work. it would create a msgid in the po files.
however, we would still need the change in ClocktToText.. or did i misunderstand "that doesn't even become a variable"?

oh, i think now i understand... you mean we dont need a var = [....].
but only [...]. that would be collected by the garbage collector... but doesnt matter, because we just need it for po parsing. :-)
 
Last edited:
Yes, exactly. There is no label so discarded and no RAM usage.
 
i looked at the usageconfig.py in more detail. wow, this date/time format stuff is really overwhelming... so far, i havent come across the selection in settings, but i probably should look for it and select one.
p.s. from a concept point of view imho the clocktotext converter should not offer to specify explicit datetime formats. that breaks the idea of having a central config point that defines the format.
 
Last edited:
this date/time format stuff is really overwhelming... so far, i havent come across the selection in settings,
Like I said further back somewhere, the date/time format stuff was an invention of IanSav. It is extremely complicated and I have no idea why he thought it was necessary, and it was not merged by me. The settings don't show anywhere in the menu unless the current skin contains the parameter. Most don't.
Code:
<parameter name="AllowUserDatesAndTimes" value="1,1"/>

from a concept point of view imho the clocktotext converter should not offer to specify explicit datetime formats. that breaks the idea of having a central config point that defines the format.,
Lots of stuff in enigma not thought out properly. There have been so many contributors and developers over the years, most not having a clue about good coding.

Currently there are not many developers are left so usually we try to spend our time on things that will make a real difference for the users rather than code vanity. But with new code we do try to centralise settings and variables in UsageConfig and SystemInfo.
 

OpenViX Feeds Status

Back
Top