home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Create a plugin configuration
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="morpheus_xx" data-source="post: 798588" data-attributes="member: 48495"><p><strong>AW: Create a plugin configuration</strong></p><p></p><p>First, there is a difference between the "Setting" and the "Configuration":</p><p></p><p>"Setting" stores your configured values (i.e. a string "Share").</p><p>"Configuration" classes used to provide support for changing settings from GUI.</p><p></p><p>For a very simple example look at the Setting for my slimtv4homeprovider:</p><p>[CODE] class TV4HomeProviderSettings</p><p> {</p><p> /// <summary></p><p> /// Holds the host name or IP adress of the TV4home service (running on same machine as TvServer).</p><p> /// </summary></p><p> [Setting(SettingScope.User, "localhost")]</p><p> public string TvServerHost { get; set; }</p><p> }[/CODE]</p><p></p><p>and the related configuration class: TV4HomeServerAddress.cs (note the inheritance from "Entry", a simple string input)</p><p></p><p>[CODE]using MediaPortal.Common.Configuration.ConfigurationClasses;</p><p>using MediaPortal.Plugins.SlimTvClient.Providers.Settings;</p><p></p><p>namespace MediaPortal.Plugins.SlimTv.Providers.Settings.Configuration</p><p>{</p><p> public class TV4HomeServerAddress[B] : Entry[/B]</p><p> {</p><p> public override void Load()</p><p> {</p><p> _value = SettingsManager.Load<TV4HomeProviderSettings>().TvServerHost;</p><p> }</p><p></p><p> public override void Save()</p><p> {</p><p> base.Save();</p><p> TV4HomeProviderSettings settings = SettingsManager.Load<TV4HomeProviderSettings>();</p><p> settings.TvServerHost = _value;</p><p> SettingsManager.Save(settings);</p><p> }</p><p></p><p> public override int DisplayLength</p><p> {</p><p> get { return 50; }</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>You can use some different configuration "editor" classes from the MediaPortal.Common.Configuration.ConfigurationClasses namespace.</p><p></p><p>The plugin.xml then have to contain the class name of a Configuration class.</p><p></p><p>I hope this brings you a step further <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>Morpheus</p></blockquote><p></p>
[QUOTE="morpheus_xx, post: 798588, member: 48495"] [b]AW: Create a plugin configuration[/b] First, there is a difference between the "Setting" and the "Configuration": "Setting" stores your configured values (i.e. a string "Share"). "Configuration" classes used to provide support for changing settings from GUI. For a very simple example look at the Setting for my slimtv4homeprovider: [CODE] class TV4HomeProviderSettings { /// <summary> /// Holds the host name or IP adress of the TV4home service (running on same machine as TvServer). /// </summary> [Setting(SettingScope.User, "localhost")] public string TvServerHost { get; set; } }[/CODE] and the related configuration class: TV4HomeServerAddress.cs (note the inheritance from "Entry", a simple string input) [CODE]using MediaPortal.Common.Configuration.ConfigurationClasses; using MediaPortal.Plugins.SlimTvClient.Providers.Settings; namespace MediaPortal.Plugins.SlimTv.Providers.Settings.Configuration { public class TV4HomeServerAddress[B] : Entry[/B] { public override void Load() { _value = SettingsManager.Load<TV4HomeProviderSettings>().TvServerHost; } public override void Save() { base.Save(); TV4HomeProviderSettings settings = SettingsManager.Load<TV4HomeProviderSettings>(); settings.TvServerHost = _value; SettingsManager.Save(settings); } public override int DisplayLength { get { return 50; } } } }[/CODE] You can use some different configuration "editor" classes from the MediaPortal.Common.Configuration.ConfigurationClasses namespace. The plugin.xml then have to contain the class name of a Configuration class. I hope this brings you a step further :) Morpheus [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Create a plugin configuration
Contact us
RSS
Top
Bottom