Window Plugin without Skin XML (1 Viewer)

usminion

New Member
September 1, 2009
2
0
I've been using MediaPortal for a few months now and decided to delve into plugin development for MediaPortal. I noticed that each plugin has to create a separate skin XML file for each possible MediaPortal skin which seems crazy to me. I was wondering if it is possible to programmatically define the screen using code. I did a couple basic tests where I instantiated a couple controls and added them to the window from the plugin's Load method but I always get an error stating "Invalid or Missing File:".

Any suggestions?

Thanks!
 

SilentException

Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    If there is no need for GUI window why don't you consider changing to process plugin?

    There is also a way to programmatically define components like this:
    [SkinControlAttribute]
    GUIButtonControl btn = new GUIButtonControl(constructor arguments)..

    I'm not sure if you can skip XML file all together but take a look at Init method and set the result to true without loading any XML..
     

    usminion

    New Member
    September 1, 2009
    2
    0
    Thanks for your response.

    The question was not about not needing a GUI Window, it was more about dynamically building the Window to match the user's environment. If I can layout the window in code and query about the application's skin to determine fonts, colors, etc... then I can avoid the headache of keeping multiple skins in sync and verifying that each skin works as expected.

    Returning true from the Init function without loading a skin file results in the same "Missing or Invalid file:" error I get when trying to manually add controls to the window.

    The introductory code sample uses the SkinControlAttribute to bind objects to the predefined nodes. I may be wrong but I don't believe it can be used to dynamically add controls to the window.

    Any other ideas?
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    GUI controls can be dynamically created by the method i already mentioned.

    About missing or invalid skin file you should consider digging in MePo source and checking the conditions in which it appears..
     

    cul8er

    Retired Team Member
  • Premium Supporter
  • August 31, 2006
    2,159
    2,679
    Home Country
    Sweden Sweden
    Hi usminion,

    There are two sides to this coin. On one side it would be good for you as a plugin developer to be able to code this and not having to bother about skin files. On the other side you have community skinners who makes custom skin files for most plugins so that "their" skin get a consistent look. I would argue that hard code the look and feel in a plugin would be the wrong way to go. Just my two cents.

    The requirements for plugin developers are to create the plugin and add skin files for MP skins (Blue3 and Blue3Wide). Skin files for most other skins are usually created by users of these skins or community skinners;)

    best regards
    cul8er
     

    Users who are viewing this thread

    Top Bottom