When implementing BaseButtonListUiTask, you have two methods/functions (among others): GetName() and GetDescription(). This GetDescription() example uses GBPVRCommonUtilities (a third party library) while the GetName() example does not. You can choose which you want and use the same method for both. This example is in C#
So in my plugin setting section of config.xml, I can have the following to make them appear in the main menu of GBPVR:
You can add a text field in your Config form if you like or just have people edit the config.xml manually if you only want power users to do it. Keep in mind that if you allow the change in your Config form, users must exit Config, then reopen it and enable the plugin under the new name. If they just change the description, restarting Config is not necessary.
Edit: I stink at instructions so feel free to ask questions on anything that's not clear.
Edit 2: Corrected the post. BaseButtonListUiTask should be implemented and not IMenuTask.
Code:
// This example requires a reference to GBPVRCommonUtilities
public override string getDescription()
{
System.Xml.XmlDocument s = new System.Xml.XmlDocument();
try { s.Load("config.xml"); }
catch
{
// Custom log method. Do whatever you like here in the event that config.xml could not be loaded.
// CommonUtils.LogMessage(LogLevel.Error, "Could not load config.xml");
}
// This queries <PluginSettings> <NetflixPlugin> <WatchNowDesc>, if it is not found, it returns "Watch movies from netflix.com" by default.
return ConfigFileUtilities.GetStringConfigSetting(s, "NetflixPlugin", "WatchNowDesc", "Watch movies from netflix.com", false);
}
// This example requires no additional references.
public override string getName()
{
string DispName;
System.Xml.XmlDocument s = new System.Xml.XmlDocument();
try
{
s.Load("config.xml");
// This queries <PluginSettings> <NetflixPlugin> <WatchNowName>.
DispName = s.SelectSingleNode("/settings/PluginSettings/NetflixPlugin/WatchNowName").InnerText;
}
catch (Exception)
{
If the query fails, use this value by default.
DispName = "Netflix Watch Now";
}
return DispName;
}
So in my plugin setting section of config.xml, I can have the following to make them appear in the main menu of GBPVR:
Code:
<PluginSettings>
<NetflixPlugin>
<WatchNowName>Netflix</WatchNowName>
<WatchNowDesc>My custom Netflix description</WatchNowDesc>
</NetflixPlugin>
</PluginSettings>
You can add a text field in your Config form if you like or just have people edit the config.xml manually if you only want power users to do it. Keep in mind that if you allow the change in your Config form, users must exit Config, then reopen it and enable the plugin under the new name. If they just change the description, restarting Config is not necessary.
Edit: I stink at instructions so feel free to ask questions on anything that's not clear.
Edit 2: Corrected the post. BaseButtonListUiTask should be implemented and not IMenuTask.