Make DreamOS more compatible for 3rd party plugins

  • Hi


    Lots of reading but German is not my language so read alot with Google Translate :)


    I am and old DMM user who have been gone for many years to the other side ;)

    but back again and now try and rapp my head around the new DreamOS OE 2.6

    Its alot diffrent since the outdated OE 2.0 and really nice also.


    But when it comes to skinning you really have made this complicated for small plugins.

    Like when i want to add a simple eListbox widget, i cant set my font???


    AttributeError: 'eListbox' object has no attribute 'setFont'


    Plugin usally only need a small simple skin but with this OS all gets really complicated

    Would it not be nice if you added this small but very important possibillity to the enigma2.py??


    Best Regards Seagen

  • Es ist im DreamOS sogar leichter ,einfach mal die aktuellen Plugins oder auch mal in die skin.py schauen.;)

    Zauberwort lautet TemplatedListFonts


    Und im Plugin code gibt man sowas dann so zb. an



    from skin import TemplatedListFonts


    def __init__(self, list):

    ........

    ........

    tlf = TemplatedListFonts()

    self.l.setFont(0, gFont(tlf.face(tlf.SMALL), tlf.size(tlf.SMALL)))


    Es gibt insgesammt im DreamOS 5 TemplatedListFonts die man vergeben kann und diese werden dann automatisch aus den Skins gelesen und somit sind sie auch skinbar .

    In den beiden Systemdefault Skins die als Fallback fungieren sind die listfont enthalten sowie in den aktuellen DreamOS Skins.



    Hier ein Beispiel wie das in einem Skin hinterlegt wird


    <listfont font="Regular" size="28" type="Bigger" />

    <listfont font="Regular" size="26" type="Big" />

    <listfont font="Regular" size="26" type="Medium" />

    <listfont font="Regular" size="24" type="Small" />

    <listfont font="Regular" size="22" type="Smaller" />


    PS. und da ich so eine Fehlermeldung wie von dir beschrieben oft von Plugin Skins kenne die von anderen Systemen kommen und die da mal einfach in die config nen Font einbauen ,das muss man genau so wenig im Dream OS machen (das hat da nix zu suchen) ,der Font für configs wird im DreamOS auch per Skin angegeben .


    zb. so im Skinkopf des Skins und da muss man nicht in jeder config zig mal den Font im Skin mit angeben wie bei den Mitbewerbern die das halt anderest geregelt haben.


    <listboxcontent>

    <offset name="left" value="5" />

    <offset name="right" value="5" />

    <font font="Regular;28" name="string" />

    <value name="string_item_height" value="45" />

    <font font="Regular;28" name="config_description" />

    <font font="Regular;28" name="config_value" />

    <value name="config_item_height" value="45" />

    <config onPixmap="skin_default/switch_on.svg" offPixmap="skin_default/switch_off.svg" size="57,30"/>

    </listboxcontent>



  • Took some time to translate ;)


    But what i understand if a simple skin for a small plugin i can jsu skipp the setFont or in the skin code

    i dont need font="Regular;28" as example since plugin can use the default skin settings?

  • I have plenty Plugins that work nicely in Open* Images and also within DreamOS, you simply have to use only the Common subset of E2 Funktionality. If this is too much limitation for you, feel free to fix it AS this is all Open source. There is not any Need to ask DP to do that:)

  • Well i dont really get you answer gutemine???


    Yes there is no problem to get about any plugin to run in DreamOS but i am very new to skinning for DreamOS.

    And if i want to use lets say my custom font in the plugin skin how is that possible if i cant set my fonts in my skin files?

    They are sett in the python code with no errors or problem and debug shows they get loaded


    And for all custom widgets i can of causle also set my fonts. But when calling a regular <widget name="config" then it all goes south.


    A friend of mine is a really good coder and skinner and he has built a very good plugin where we have manage to get this working

    with applet code.


    from enigma import eListboxPythonConfigContent, gFont

    self["config"].l.setDescriptionFont(gFont("customfont", 33))

    self["config"].l.setValueFont(gFont("customfont", 30))

    self["config"].l.setItemHeight(56)

    </applet>


    But now everything gets really strange ;)


    After leaving the plugins setting screen that have this code all settings screens in DreamOS has this font until i reboot Enigma2

    If this is not a bug in DreamOS what is then?


    And to DreamOS developers would it be to much to ask to add setFont in to the enigma2?? would make life easier for everone :)

    And give us better tools to build vivid nice plugins for this platform

  • I trying to figure that out bit its in German and my German is as good as google translate ;) :)


    To me his solution looks like a full skin solution while i just look for a simple embedded plugin skin solution


    And all works just as i want except that i cant use any custom font in the plugin skin when using standard widgets like eListbox


    All my plugin needs is a screen title, some labels and an config listbox that act as my settings page

    I want to use my font not the default font thats it and for me who are new to DreamOS this gets very complicated for something that should just look like this



    <screen name="Settings" position="0,0" size="1920,1080" backgroundColor="#232323" flags="wfNoBorder">

    widget name="config" position="519,309" size="1372,672" foregroundColor="#ffffff" backgroundColor="#232323"

    foregroundColorSelected="#ffffff" backgroundColorSelected="#0e6382" itemHeight="56" font="customfontname;32" scrollbarMode="showOnDemand" transparent="1" zPosition="2" />

    </screen>



    But please just forget it if am so stupid and you all have forgot that you all started from scratch...


    Or maybe some one can take it in English??

  • Okey that makes some sence ;) But as i wrote a couple of post up


    You can set custom fonts but then you have to use applet code like this


    <widget name="config" position="519,309" size="1372,672" foregroundColor="#ffffff" backgroundColor="#232323" foregroundColorSelected="#ffffff" backgroundColorSelected="#0e6382" itemHeight="56" scrollbarMode="showOnDemand" transparent="1" zPosition="2" />

    <applet type="onLayoutFinish">

    from enigma import eListboxPythonConfigContent, gFont

    self["config"].l.setDescriptionFont(gFont("customfont", 33))

    self["config"].l.setValueFont(gFont("customfont", 30))

    self["config"].l.setItemHeight(56)

    </applet>


    And this gives the plugin custom font. Why would i want that you ask

    Well Plugin has its own design and look and the font is a important part of that so therefore would i like to use my custom font :)


    And now you thinking this 55 year old Swede must be totaly stupid since he has a solution for his problem ;) :) :) :)

    And i do but with this code all settings screens get my custom code??? Every Default-FHD settings screen gets the font

    and thats my point it must be a bugg somewhere in the DreamOS core code when some simple applet code

    hi-jacks the whole DreamOS skin and not just the plugins skin :)


    And therefor was my first question would it not be nice if the DreamOS developers did add setFont to eListbox so we can set font the good old way ;)

  • No that's not a bug the code you are misusing in the applet code is used to set the global font definition for all configs and is only called by skin.py

    As said before there is no way to change the font.

    Oh and you were talking about small and simple plugin. A small and simple plugin doesn't deliver it's own fonts ;)

    And the Devs won't change the behaviour I'm pretty sure.

  • This is very interesting and thanks for taking time with an old dog like me ;)


    My plugin is simple ;) But any way look is allways important but if its not possible to have custom fonts without "misuse of some applet code ;)"

    Then i am of the oposite opionion. It wold be in the devs interest to put a stop to this.


    I see two simple ways.


    1. do what i asked for first just add setFont in to the enigma


    2. Give any applet code the ability to be unloaded on exit so the whole global configs get hi-jacked


    Or accully a third solution.. Maybe there is a way to use applet code so it only affects the ongoing instance?


    I have try this but does not even work


    self["config"].instance.setDescriptionFont(gFont("customfont", 33))

    self["config"].instance.setValueFont(gFont("customfont", 30))

    self["config"].instance.setItemHeight(56)

  • And I really do appreciate all answers i get but the mode from all except Zombi is so hostile


    I now that the solution i come up with is not correct and does not suit my purpuse since it hi-jack all config listboxes and give them wrong font.

    I also get that DreamOS dont give the freedom to assign any custom fonts to a plugin in its present state.



    But if you gutemine have an example where you can show me how to assign a custom font and itemHight to an config listbox that dont effect all config listboxes i really would appreciate that :)


    And again why would a plugin want or need their own custom fonts and itemHights.

    Well in my opinion many plugins today are so stand alone and would even be confusing if they all look like skin default ;)

    And its also a way of branding your plugins so people easy can recognize them no matter of what image or skin they use.


    I have been looking in to Mediaportal plugin and found some hints on how to get around this problem for me.

    And i think i might found a solution but my God its a lot of work and a lot of coding just to get a simple font="Customfont; 32" to work for 1 config listbox :)



    I dont now what the bottom of your post is gutemine if its just a footer note or directed to me???

    But i can tell you that this plugin we working on got the attention of DreamMultimedia and they accully

    sponsored me with an Dreambox One UltraHD so I could develope and convert this plugin for OE2.5/2.6 ;)

  • seagen

    Ich kann dir leider nur in deutsch schreiben ,aber so richtig verstehe ich einfach dein Anliegen nicht ,warum und für was soll der Customfont gut sein?

    Jeder Skin hat doch seine eigene Schriftart ,also passend zu dem Skin den man nutzt bzw. der Skinner gern möchte ,somit ist doch garnicht das ganze immer gleich und was soll da das Plugin für einen Customfont leifern?

    Wenn du ein Plugin schreibst musst du doch garkein extra Font angeben ,der Font wird bestimmt von dem Skin den man nutzt und gut ,das ist in dem einem Skin so in einem anderen halt ein anderer oder auch mal gleiche wie im default.

    Was genau bezwechst du mit einem Customfont ? bzw. was genau soll dieser überhaupt bringen?

  • No problem we have Google translate even if not perfect i get your opinions :)


    And for full image skins i must say that DreamOS is cutting edge. The new way of setting up the skin like you explained in an earlier post is just amazing.

    And i look at plugins like apps for Android. When you create a plugin you should also have the freedom to design the look of the plugin

    not be limeted to allways have to use the same look as skin default.


    All custom skins are not as well done as yours so therfor a plugin might look really bad and also be hard to understand.

    The GUI of a plugin is very important to how a user will understand the functions and also of cause the use of the plugin.


    And it should be no secret that i am used to skin for OE 2.0 so all this is new for me, The python coding for OE 2.5/2.6 is pretty stright forward

    and are easy to adapt to. Its the skinning, some parts of the skinning is incredible nice and easy to work with but they all favor full image skinning


    I can set any custom font i want for a label but not for a eListbox.

    So my first opininon was how hard can it be to just add that to the eListbox and at the same time keep the eListbox alternatives.

    Then we get the freedom to do both :)


    Image skinners can take advantage of the <listboxcontent> but at the same time if needed add an custom font to one or more eListboxes to make skinning more diverce and vivid :)


    Thanks so much Zombi for your reply :thumbup::):)

  • Ihr könnt doch aber zu eurem Plugin einen schönen default Skin mit liefern (also von dem ihr als Pluginersteller sagt ,so möchte ich das Plugin default haben).

    Dann habt ihr auch das Plugin in allen Skins die es nicht geskinnt haben euer aussehen und wenn es ein Skinner in seinem Skin anderst skinnen möchte kann er es ja tun.

    Und nochmal ,ein Skinner kann zb. auch bei den listfonts im skin das anderst angeben und man hat dann in den Listen unterschiedliche Fonts.


    <listfont font="Regular" size="28" type="Bigger" />

    <listfont font="Bold" size="26" type="Big" />

    <listfont font="xyz" size="26" type="Medium" />

    <listfont font="Regular" size="24" type="Small" />

    <listfont font="Regular" size="22" type="Smaller" />



    <font font="abc;28" name="config_description" />

    <font font="Regular;28" name="config_value" />

    <value name="config_item_height" value="45" />



    Wird aber kaum einer machen weil es soll ja auch immer schön zum Skin passen und daher ist es ja auch skinbar ;)


    Wenn du in deinem Plugin halt für etwas einen eigenen Font haben möchtest dann kannst es im Plugin ja mitgeben ,wie gesagt ich verstehe das ganze mit dem Customfont nicht wirklich .

    Ich möchte zb. in meinem Skin nicht in der einen config einen anderen Font als in den anderen configs oder in der einen Liste das so in einer anderen anderst.

    Ich hab keine Ahnung was für ein Plugin ihr da macht oder was ihr da optisch anzeigen wollt ,aber nochmal erstellt doch einen für euch passenden default Skin im Plugin und gut ist und die Mittel dazu sind alle da .

  • Das ist ihm halt zu umständlich, wobei ich da ja wieder auf seine Aussage komme "simples Plugin" (warum er es da braucht weiß ich nicht).


    Für größere Plugins mit Umgang eines MediaPortal macht es auch Sinn das komplett zu verbiegen. Aber auch dort muss ich beim Verlassen wieder alles in den Ursprungszustand bringen. Weil die Definitionen der skin.xml nunmal global sind.

    Wobei die Einschränkung wirklich nur für die config gilt seine Behauptung das beträfe die eListbox allgemein ist falsch weil dort kann man im Python ja beliebige Fonts nachladen und auch für die eListbox verwenden, kurz es gibt auch ein setFont.


    Und DP hatte sich schon zum damaligen Zeitpunkt gegen das ausgesprochen was er jetzt wieder haben möchte.

  • Und da bin ich zu 100% bei Dream ,wie ich schon schrieb ich verstehe das mit dem Customfont nicht wirklich weil das ist normal unnötig und sollte ne config zb. nicht auch passend zum Skin sein und nicht von einem Plugin dann einfach mal einen anderen Font bekommen?


    seagen  

    Hier mal nur als Beispiel im default Skin sieht eine config zb. so aus vom Plugin Skin (Bild1)

    in einem anderen Skin (Bild2 aber ganz anderst ,auch mit anderem Font ,alles ohne einen Customfont und ohne extra Fontangabe in der config Zeile .

    Oder aber Bild 3 da ist das Plugin nicht geskinnt ,kommt also der Plugindefault Skin und passt sich dann der Skinfarbe sowie den passenden Skinfont an ,auch ohne Customfont

  • Now it become a lot of Google translate ;) And i get the point its your view that all should look like the skin i use and for built in system plugins thats very important

    But for any free third-party plugin like MediPortal and simular plugins not part of any OS the GUI is as important as the functions of the plugin.


    But we can drop it, i get it and it was just a question from the beginning if its possible to easy use some custom fonts along with some custom itemHeights

    and the answer i simple. No


    And my second question was. Is it possible for the developers to maybe add this functions to the eListbox

    and the answer is No


    So if you two can speak for the whole developer Team then we can go and have a coffy break boys


    and in the end thanks for taking time and debate this with me :thumbup::thumbup::):):)


    Best Regards Seagen