NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 31 32 33 34 35 … 93 Next »
Plugin settings in the Config application

 
  • 0 Vote(s) - 0 Average
Plugin settings in the Config application
Khurram
Offline

Member

Posts: 112
Threads: 19
Joined: May 2008
#1
2008-06-08, 06:07 PM
I am trying to develop a plugin. Can someone please help me out in the following:


1) how do you get the window (what event to hadle) after clicking on the settings buttons in the Config application Plugin tab?

2) Can you display a .net windows form after clicking on the settings button?


Thanks,
Khurram.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#2
2008-06-08, 06:47 PM
Add a regular form to the plugin. Here are the basic parts needed (C#).

Code:
public partial class ConfigForm : Form
    {
        private XmlDocument settings;
        
        // Constructor. Add an XML document as a parameter.
        public ConfigForm(XmlDocument document)
        {
            InitializeComponent();
            settings = document;
        }

        public XmlDocument ConfigDocument
        {
            get { return this.settings; }
            set { this.settings = value; }
        }
    }

Also check the wiki. There are some plugin source codes available that should have config form instances.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,595
Threads: 387
Joined: Dec 2004
#3
2008-06-08, 07:39 PM
Although it's not yet implemented, I took the easy route using Visual Studio for a config form in the DVB-T Radio plugin...

Right-click the solution / project and select Add... to add a Windows Form. In the plugin, use the overridden GetConfigFormInstance as follows...
Code:
public override Form GetConfigFormInstance(XmlDocument document)
{
        DvbtrConfigForm ConfigForm = new DvbtrConfigForm();
        return ConfigForm;
}
The Settings button in the Config app. is automatically enabled for any plugin which returns an object derived from a Form class.

The XmlDocument that's passed as a parameter to GetConfigFormInstance is the GB-PVR config.xml file - you can use this if you want to add settings for your plugin to the <PluginSettings> area or you can choose to ignore it and use your own private xml or plain text ini file etc. for your settings.

Hope that helps.

Cheers,
Brian
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#4
2008-06-08, 07:51 PM
I forgot that override had to be in the plugin code. Sorry.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,595
Threads: 387
Joined: Dec 2004
#5
2008-06-08, 08:49 PM
whurlston Wrote:I forgot that override had to be in the plugin code. Sorry.
Actually, I didn't do a full job of explaining it either.

@Khurram - If you want your form to use the default config.xml with whurlston's example constructor, then my example for the GetConfigFormInstance should have been...
Code:
public override Form GetConfigFormInstance(XmlDocument document)
{
        DvbtrConfigForm ConfigForm = new DvbtrConfigForm([B][color=Red]document[/color][/B]);
        return ConfigForm;
}
@whurlston - I think we got there in the end. Smile

Cheers,
Brian
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#6
2008-06-08, 08:51 PM
See what brilliant minds can accomplish when they come together? Cool
Khurram
Offline

Member

Posts: 112
Threads: 19
Joined: May 2008
#7
2008-06-09, 04:20 AM
Thanks for the information guys.

Khurram.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 3,087 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,566 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,647 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 3,012 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,881 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,331 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 2,029 2013-03-12, 06:48 AM
Last Post: psycik
  Best way to load settings for NPVR? reven 4 2,241 2012-11-01, 01:13 AM
Last Post: reven
  Plugin problems with started from the command line mvallevand 11 5,255 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,343 2012-02-11, 05:42 PM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode