Purpose

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.

How this new feature is used is up to the plugin/skin developers but here are some scenarios with a few of the most popular plugins:

MovingPictures

The BasicHome screen contains two hyperlinks to MovingPictures with two different hyperlinkParameters

MP-TVSeries

The BasicHome of skin x contains two links to mp-tvseries each with a different hyperlinkParameter

OnlineVideos

BasicHome will have own icons for OnlineVideos->Youtube and OnlineVideos->GameTrailers.

Other Plugins

Description of Change

The button control (GuiButtonControl) and each control that derivates from button has a new attribute "hyperlinkparameter". If this attribute is set, the containing string will be passed to the plugin when its loaded. If the plugin recognises the string format, it can start in a specific manner (e.g. show a specific item/view/...)

[XMLSkinElement("hyperlinkParameter")] protected string _hyperLinkParameter = "";

How the plugin handles this string is completely up to the plugin developer. The might use a single string, they could also use seperators to allow multiple parameters (e.g. parameter1|parameter2|...|parameterX). It is then up to the skin designer to decide if they want to support this new feature by defining these parameters in their skins or by allowing their users to edit the parameters (e.g. with a BasicHome editor).

Details

More information on how to use parameterized startup can be found on the following locations:

Additional Information and References

XML/Code Samples

The following shows a button that opens the plugin MovingPictures (window id 96742) with the name of a specific category (${UnwatchedMovies}), which will be shown directly when the plugin is opened.

<control>
    <type>button</type>
    <hyperlink>96742</hyperlink>
    <hyperlinkParameter>UnwatchedMovies</hyperlinkParameter>
</control>

 

With the following code sample, the plugin can then check for the variable (e.g. when starting the plugin)

protected override void OnPageLoad() {   

             ....            

             if (_loadParameter != null)
                {
                  List<DBNode<DBMovieInfo>> categories = browser.CategoriesMenu.RootNodes;
                  foreach (DBNode<DBMovieInfo> i in categories )
                  {
                    if (i.Name.Equals(_loadParameter))
                    {
                      browser.CurrentNode = i;
                      break;
                    }
                  }
                }

            ....

        }

Screenshots