Plugin config order and language file strings within the plugin (1 Viewer)

Lightning303

MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    I now combined them all as you suggested aswell as removed the redundant declarations.
    However the menu items are still ordered alphabetically.
    I've checked the code and found the reason: https://github.com/MediaPortal/Medi...ents/Configuration/ConfigurationModel.cs#L480.

    Here a WorkflowAction is created, using the label as sort criteria.

    What should we do? I would extend the config section metadata with a custom "sort" attribute, so you can define it inside plugin.xml. If it's null or empty default sorting will be title as now. Would this be what you need?

    So i would be able to change my plugin.xml to something like this?

    Code:
      <Register Location="/Configuration/Settings/Plugins/AtmoLight">
        <ConfigSection
            Id="General"
            Sort=1
            Text="[AtmoLight.General]"/>
        <ConfigSection
            Id="AtmoWin"
            Sort=2
            Text="[AtmoLight.AtmoWin]"/>
        <ConfigSection
            Id="Hue"
            Sort=3
            Text="[AtmoLight.Hue]"/>
        <ConfigSection
            Id="Hyperion"
            Sort=4
            Text="[AtmoLight.Hyperion]"/>
        <ConfigSection
            Id="Effects"
            Sort=5
            Text="[AtmoLight.Effects]"/>
        <ConfigSection
            Id="Buttons"
            Sort=6
            Text="[AtmoLight.Buttons]"/>
        <ConfigSection
            Id="Advanced"
            Sort=7
            Text="[AtmoLight.Advanced]"/>
      </Register>

    If so, yeah thats what i would need/like to do.

    Thanks!
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Please try this new branch:
    [21:53] <MP2-GitBot> [MediaPortal-2] morpheusxx created FEAT_ConfigSort (+1 new commit): http://git.io/hBtstQ
    [21:53] <MP2-GitBot> MediaPortal-2/FEAT_ConfigSort 4e4e3a1 morpheusxx: Added "Sort" attribute for configuration items

    The "Sort" is a string which you can fill as you like:
    <ConfigSection
    Id="Advanced"
    Sort="Atmo-07"
    Text="[AtmoLight.Advanced]"/>
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Another point to consider: if you have so many options, it would be more comfortable if you provide an own model + dialog which can offer more input at once.

    Examples are:
    • Weather setup dialog
    • Trakt.tv setup dialog
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Please try this new branch:
    [21:53] <MP2-GitBot> [MediaPortal-2] morpheusxx created FEAT_ConfigSort (+1 new commit): http://git.io/hBtstQ
    [21:53] <MP2-GitBot> MediaPortal-2/FEAT_ConfigSort 4e4e3a1 morpheusxx: Added "Sort" attribute for configuration items

    The "Sort" is a string which you can fill as you like:
    <ConfigSection
    Id="Advanced"
    Sort="Atmo-07"
    Text="[AtmoLight.Advanced]"/>

    Thanks!
    This works perfectly. :) Im a happy camper.


    Another point to consider: if you have so many options, it would be more comfortable if you provide an own model + dialog which can offer more input at once.
    Examples are:
    Weather setup dialog
    Trakt.tv setup dialog

    I will have a look at that, however i think the config interface that MP2 provides is really good and suits my needs perfectly.
     

    Users who are viewing this thread

    Top Bottom