NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 21 22 23 24 25 … 93 Next »
How to display custom plugin names and descriptions.

 
  • 0 Vote(s) - 0 Average
How to display custom plugin names and descriptions.
scb147
Offline

Posting Freak

Posts: 806
Threads: 77
Joined: Nov 2006
#11
2009-12-30, 08:04 PM
whurlston Wrote:This usually happens when it doesn't read the config file properly and it drops back to the default setting.
It is reading the config file though, as config.exe is reading the correct tag, and the menu is showing the name/description in my config.xml.

It's just the upper-left corner of the plugin that is still displaying the actual plugin name.

The attachments show what I mean.
Author of Weather (NPVR) & Weather2 (GBPVR)
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#12
2009-12-30, 10:56 PM
I'm not having that issue. Would you mind sending me a copy of the code? You can email it to me at my username at oshinetworks.com or pm me a download location.
scb147
Offline

Posting Freak

Posts: 806
Threads: 77
Joined: Nov 2006
#13
2009-12-31, 03:51 AM
Here is my getName() function:
Code:
private static string mName = "Weather2";
...
public string getName()
{
    return WizInfo.cfgGetString(mName, "Weather2Name", mName);
}
I am using the WizUtilities method cfgGetString. The arguments are:
1. section
2. property
3. default value

So I am getting the "Weather2Name" node from the mName, or "Weather2" property. The config.xml looks like this:
Code:
<PluginSettings>
    <Weather2>
      <Weather2Name>Accuweather</Weather2Name>
      <Weather2Description>My custom Weather2 description</Weather2Description>
    </Weather2>
</PluginSettings>

The only main difference I see is that I do not have the override flag on my getName() method. When I add this, it tells me there is no method to override, which makes sense. If you need more code, let me know.
Author of Weather (NPVR) & Weather2 (GBPVR)
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#14
2009-12-31, 04:38 AM
That should work for the getName function. Try this to see if it makes a difference although this is probably all the WizInfo function is doing:

Code:
try
            {
                System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
                doc.Load("config.xml");
                return doc.SelectSingleNode("/settings/PluginSettings/Weather2/Weather2Name").InnerText;
            }
            catch (Exception e) { return mName; }

As for the override, are you implementing IMenuTask? If not, this may be the issue.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using GBPVR.Public;
using GBPVRX2;
using GBPVRX2.UiSupport;

namespace MovieLibrary
{
    public partial class MovieLibrary [B][color=Red]: IMenuTask[/color][/B]
    {
        #region IMenuTask Members

        System.Windows.Forms.Form IMenuTask.GetConfigFormInstance(System.Xml.XmlDocument document)
        {
            return new ConfigForm(document);
        }

        #region OnKey/OnClick Handlers
        ...
        #endregion

        [B][color=red]public override string getDescription()[/color][/B]
        {
            return Config.GetValue(settings, "/settings/PluginSettings/MovieLibrary/Description", "Watch Blu-ray, HD DVD and DVD movies");
        }

        [B][color=Red]public override string getName()[/color][/B]
        {
            return Config.GetValue(settings, "/settings/PluginSettings/MovieLibrary/DisplayName", "Movie Library");
        }

       [B][color=red] public override string getSkinSubdirectory()[/color][/B]
        {
            return "Movie Library";
        }

        [B][color=red]public override ArrayList GetRenderList()[/color][/B]
        {
            return base.GetRenderList();
        }

        [B][color=red]public override bool needsRendering()[/color][/B]
        {
            return base.needsRendering();
        }

        #endregion
    }
}
scb147
Offline

Posting Freak

Posts: 806
Threads: 77
Joined: Nov 2006
#15
2009-12-31, 09:02 PM
So, I changed my getName() to the try/catch you posted, and then for the exception catch, I returned "Weather2 Exception". I figured if it was getting to that point, I'd see that as the name in the upper-left.

Well, it still shows "Weather2"... I'm baffled...

As for the override, I am implementing IMenuTask.
Author of Weather (NPVR) & Weather2 (GBPVR)
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#16
2009-12-31, 09:22 PM
Strange. This is my result of the above code. As you can see, it displays "Blu-ray Library" instead of "Movie Library". Did you try setting breakpoints on the "return" lines to see if it was hitting them? My getName function gets called 5 times when pvrx2 starts (assuming this if for the menu) and then twice when entering the plugin. First when activating the plugin and then after populating the list.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,188
Threads: 958
Joined: May 2006
#17
2009-12-31, 11:22 PM
This method works perfect fine with Web Radio for me, but I can't get it to work with override in Music Library3 I get

Code:
'PsycikProductions.MusicLibrary.MusicLibrary3.getName()': no suitable method found to override

Unfortunately ML3 doesn't use the baseskin.xml for the Screen Name either. Like scb147 the description and title are written on the main menu.

Martin
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#18
2010-01-01, 02:08 AM
How does your class setup look? Does it look like this (minus the "override") or is it different?

Code:
namespace PsycikProductions.MusicLibrary
{
  public class MusicLibrary3 : IMenuTask
  {
    public override string getName() { ... }

    // ... other functions
  }
}
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,188
Threads: 958
Joined: May 2006
#19
2010-01-01, 06:25 AM
Code:
namespace PsycikProductions.MusicLibrary
{


    public partial class MusicLibrary3 : MusicLibraryPartial,
                                    IUiTask, IMenuTask,
                                    UiSimpleList.CommandCallback
    {


If I rename public string getName() I get this

Code:
'PsycikProductions.MusicLibrary.MusicLibrary3' does not implement interface member 'GBPVR.Public.IMenuTask.getName()'

Martin
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#20
2010-01-01, 06:35 AM (This post was last modified: 2010-01-01, 06:42 AM by whurlston.)
Ah. I usually separate my implementations so IMenuTaskMembers.cs will have:

Code:
public partial class MovieLibrary : IMenuTask

and then IUiTaskMembers.cs will have:

Code:
public partial class MovieLibrary : IUiTaskMembers

For the way you are doing it, try the following (I think it's called explicitly implementing):

Code:
public override string [color=Blue]IMenuTask[/color].getDescription() { ... }

public override string [color=Blue]IMenuTask[/color].getName() { ... }
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (3): « Previous 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom recording tomx 2 768 2025-02-07, 09:14 AM
Last Post: tomx
  PIP plugin for Kodi sgilani 2 3,107 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,578 2020-11-14, 08:01 PM
Last Post: sub
  custom creation of a recurring error p37307 2 2,423 2017-12-19, 03:45 AM
Last Post: mvallevand
  VIdeo playback from plugin mvallevand 5 3,655 2015-08-06, 10:43 PM
Last Post: sub
  Custom recording rules mvallevand 58 22,840 2014-12-08, 03:28 AM
Last Post: mvallevand
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 3,020 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,896 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,342 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 2,035 2013-03-12, 06:48 AM
Last Post: psycik

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode