[Approved] Patch to allow skins to open plugins with a parameter *Updated for 1.1* (1 Viewer)

DieBagger

Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    36
    Austria
    Austria Austria
    The original idea can be found here: https://forum.team-mediaportal.com/improvement-suggestions-46/allow-skins-plugins-parameters-74058/

    I'll outline the idea again: The patch adds a new property (hyperlinkParameter) to GUIButtonControl. This property will be passed to the plugin that is opened with the hyperlink property. The plugin can then open a specific view/site/part of the plugin, depending on the parameter.

    Here are some usecases for a few of the most popular plugins:

    MovingPictures
    The BasicHome screen contains two hyperlinks to MovingPictures with two different hyperlinkParameters
    • Link 1 is named "Kids Movies" and will open MovingPictures with the category defined for save usage by the children
    • Link2 is named "Movies" and will open MovingPictures and show all movies (it may be secured with a pin)

    MP-TVSeries

    The BasicHome of skin x contains two links to mp-tvseries each with a different hyperlinkParameter
    • Link 1 will open mp-tvseries and show Bobs Favorite series
    • Link2 will open Janes favorite series
    • Link3 will show all shows for the kids

    OnlineVideos
    BasicHome will have own icons for OnlineVideos->Youtube and OnlineVideos->GameTrailers, you get the idea ;)

    Other Plugins
    • MyTrailers can be called from other plugins with an imdb id as parameter, MyTrailers will show trailer for this specific movie
    • Weather plugin could be called for different cities
    • ...

    Implementation
    That's why I think why this patch would provide an improvement to MediaPortal, now here's what I've done:
    - Added skin property to GuiButtonControl class
    Code:
    [XMLSkinElement("hyperlinkParameter")] protected string _hyperLinkParameter = "";
    - When button is pressed and contains a hyperlink AND a hyperlinkParameter the method
    Code:
    GUIWindowManager.ActivateWindow((int)_hyperLinkWindowId, _hyperLinkParameter);
    is called instead of
    Code:
    GUIWindowManager.ActivateWindow((int)_hyperLinkWindowId);
    - the parameter will be added (as lpVoid) to the GuiMessage GUI_MSG_WINDOW_INIT
    - in the GUIWindow class, the parameter will be stored in the new field _loadParameter
    Code:
    protected string _loadParameter = null;
    - a plugin can then check if(_loadParameter != null) in the OnPageLoad() method

    Remarks:
    • I did consider using a second OnPageLoad(string parameter) method but this would cause sideeffects with the overrides
    • I talked to fforde (movingpictures) and damienh (mp-tvseries) and both agreed that a simple string would be sufficient as a parameter
    • This is my first patch so please be gentle :p Comments are very welcome!

    Patch: View attachment AllowSkinToOpenPluginWithParameter.patch


    Files for testing (Needs the latest svn snapshot and MovingPictures 1.0 installed), just overwrite the files with the ones included in the rar file and you'll have a BasicHome that opens moving pictures in different category views.
    View attachment LoadMovingPicturesWithSpecifiedCategory.rar
    • Modified BasicHome.xml for Blue3Wide
    • Modified MovingPictures 1.0
    • Modified Core.dll (including the changes)
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,702
    7,087
    Sydney
    Australia Australia
    Country flag
    Great enhancement, im sure others whom ask for multiple instances of a plugin will agree :)

    I will definitely support adding this to TVSeries once its approved.
     

    fforde

    Community Plugin Dev
    June 7, 2007
    2,666
    1,699
    39
    Texas
    United States of America United States of America
    Fantastic work DieBagger. I definitely look forward to this patch making it into MP! Well done. :)


    :D
     

    rekenaar

    Retired Team Member
  • Premium Supporter
  • December 17, 2006
    4,421
    805
    South Africa South Africa
    Great work.

    We will of course have to wait until MediaPortal 1.1.0 final has been released before the patch will be evaluated by our devs.
     

    fforde

    Community Plugin Dev
    June 7, 2007
    2,666
    1,699
    39
    Texas
    United States of America United States of America
    Would it make sense to evaluate now and if it looks good schedule it on mantis? Would hate to see a great patch like this lost in the shuffle.
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Re: Patch to allow skins to open plugins with a parameter

    Just giving this a bump as I agree, this would be a fantastic addition which opens up many new possibilities. Hope it won't be forgotten :)
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,981
    3,703
    Stuttgart
    Germany Germany
    Country flag
    Re: Patch to allow skins to open plugins with a parameter

    Nice Addition! Would love to see this in MePo as well.
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    46
    Milano, Italy
    Italy Italy
    Country flag
    Re: Patch to allow skins to open plugins with a parameter

    :D for help improving MP.

    As you may now MP is currently in feature freeze so we have to postpone the validation of your patch.

    Cheers,
    Simone
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    36
    Austria
    Austria Austria
    Ok, so since the patch sadly didn't make it into 1.1, here's the updated version for the current svn. The changes I did are pretty much the same as in the original patch, I tested it with a modified version of moving pictures that will directly open the category that is specified with the parameter.

    Patch:
    View attachment AllowSkinToOpenPluginWithParameter.patch

    Compiled Testversion:

    This archive includes the patched core.dll, a modified basic home of blue3wide and the modified moving picutures binaries. Just override the existing files (don't forget to backup ;)) and you'll get a basichome from which you can directly open the following categories of movingpictures:
    • All movies
    • Unwatched Movies
    • Genres
    • Recently Added
    • Year

    View attachment OpenMovingPicturesWithParameter.rar

    :D
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    N [Approved] [MP2-198-200] Playlist handling patches Submit: Code Patches 4
    BlueMax1916 [no Bug] Windows 10 1803 January Patch -> H.265 videos without video output MediaPortal 2 6
    O General Merging various patches into TVE3 TV Engine 21
    emphatic Allow remote control mapping of all plugins Improvement Suggestions 0
    N [Finished] [MP2-806] Playing a recorded radio program does not show screen to allow skipping forward, etc MediaPortal 2 141
    R MediaPortal will not allow windows shortcut keys to work OffTopic 0
    P Mediaportal does not allow my TV tuner to enter low power state General Support 1
    B [MP2-745] Allow direct navigation to specified media item/filter Archive 7
    S Stiefmütterliche Unterstützung für Maussteuerung in MP (Titan Skin) Allgemeines Supportforum 14
    Rob Hexenmeister Skin functions: What is available? General Support 7
    Rob Hexenmeister Skinning Online Videos question OnlineVideos 2
    Rob Hexenmeister Quick question - skinning MyPics General Support 7
    ajs [Info] 0.7 Beta - MPExtended, WebMP, Bootstrap skin by ajs - Hard way MPExtended 602
    S Touchscreen skin? MediaPortal 1 Talk 6
    azzuro [fixed] 5011: Version label in Splash screen - pos, size from skin MediaPortal 1 61
    catavolt [WiP] When changing theme in my skins, I always get this error message in logs MediaPortal 1 9
    joecrow MultiShortcut Plugin (Uavailable) in DWHD skin General Support 58
    V Skin With Menu Editor MediaPortal 1 Skins 13
    wizard123 New Skin Template ? MediaPortal 2 8
    Rob Hexenmeister [solved] Latest Media Handler - skinning buttons Fanart Handler 19
    CyberSimian [solved] MP1-4976 Built-in skin variables for current date MediaPortal 1 8
    Mr6686 [solved] Titan skin broken since update to 1.23 Installation, configuration support 6
    doskabouter Skin question Skins and Plugins Installer (MPEI) 1
    Y Titan Skin unter 1.23 nicht mehr so schön Allgemeines Supportforum 1
    framug 1.22.0 BasicHome Editor settings for DefaultWide HD skin not kept when update 1.22 3
    Similar threads

























    Top Bottom