Settings UI for ServerSettings (1 Viewer)

osre

Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    I want to do a little contribution, and I thought I start with an UI for
    MediaPortal.Common.Services.ResourceAccess.Settings.ServerSettings.
    I think I know already how, but I'm not sure where I should add it.
    I guess that "\MediaPortal\Source\UI\UiComponents\SkinBase\plugin.xml" is a good place.
    or "\MediaPortal\Incubator\ServerSettings.Client\plugin.xml"
    But where do I put the entry classes?
    In "\MediaPortal\Source\Core\MediaPortal.Common\Services\ResourceAccess\Settings\" or a sub folder like "
    "\MediaPortal\Source\Core\MediaPortal.Common\Services\ResourceAccess\Settings\ConfigurationClasses\"?
    or
    "\MediaPortal\Incubator\ServerSettings.Client\Settings\Configuration\"

    Please give me advice, and I do it.
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,475
    1,385
    Country flag
    I'll leave that to @morpheus_xx to answer :)
    "\MediaPortal\Incubator\ServerSettings.Client\plugin.xml is probably right, when you want to implement the possibility that you can change the settings of the MP2-Server from the client front end (that's why this plugin is called "ServerSettings".
    If you want to add the possibility to change the settings of the MP2-Client from the (same) MP2 Client, then probably MediaPortal\Source\UI\UiComponents\SkinBase\plugin.xml would be better.
    As to the settings classes, maybe this helps: http://wiki.team-mediaportal.com/2_...e/Development/4_Modules/Plugins/Configuration

    In any case: Thanks for contributing (y). Any help is appreciated!
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    I think I did it.
    Since the MultiplyEntryListController was not implemented, and I needed it for the IPBindings Setting, I implemented it also.
    It might not be perfect, but it works.
    What is missing (or not so nice so far).
    Changing these settings normally needs some reinitialization.
    Since I did not really know how I should do this, I simply added a notification, that the MediaProtal Client should be restarted.
    Even that I know how to use localized strings, I have currently hard coded these messages in the code.
    May be it would be a good idea to have some kind of global handler where a necessary restart can be notified.

    The patch is based on the Weekly branch from 2014_12_19.
    p.s. I hope the patch works, I'm not really used to use GIT.
     

    Attachments

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    I just have seen that I added the check if the ip addresses are valid to the MultipleEntryListController, which is in fact a but stupid :oops:
    I'll fix this and post the updated patch.
     

    MrTechno

    Development Group
  • Team MediaPortal
  • February 27, 2011
    1,256
    511
    London
    United Kingdom United Kingdom
    Country flag
    IP filtering is safe up to a point. Loopback and localhost are always bound to so you can talk from client to server on the same machine. It's still possible to use invalid settings by editing the file directly but less likely that anyone will do this if you can do it from the GUI
     

    MrTechno

    Development Group
  • Team MediaPortal
  • February 27, 2011
    1,256
    511
    London
    United Kingdom United Kingdom
    Country flag
    What should probably happen is the startup check should make sure there's at least one entry in the filtered list and if not fall back to the full unfiltered list and set a user error notification
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    What should probably happen is the startup check should make sure there's at least one entry in the filtered list and if not fall back to the full unfiltered list and set a user error notification
    An empty list (the default) will result in no filtering, which should be allowed I think.
    If someone enters an invalid IP address, and nothing works anymore, then an error notification would be a good thing I guess. But so far I did not modify anything in the initialization. I made the settings available from UI (with a simple check if a IP entry is really an IP.[DOUBLEPOST=1419695137][/DOUBLEPOST]I've moved the check for valid IP addresses to the IPAddressBindingSetting and added copyright notices and some comments to the code.
    patch0-updated.patch replaces the patch0.patch, means the weekly branch is the direct base.
    If you have already applies the patch0.patch, you can apply patch1.patch to get the latest modifications.
     

    Attachments

    Last edited:

    MrTechno

    Development Group
  • Team MediaPortal
  • February 27, 2011
    1,256
    511
    London
    United Kingdom United Kingdom
    Country flag
    When you say invalid are you using a regex or does it check against the list of IPs assigned to the machine?
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,360
    4,987
    France - IDF
    France France
    Country flag
    hello Osre,
    welcome in our community, i can't help on developing side, all our dev are great and have experience with MP. (y) so don't hesitate to their ask.
    what i can say, is don't forget to provide an small wiki page on how work your plugin and what can done... i know it's a bit young ... for now

    Thank you for your contribution, and happy christmas.
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    I just use IPAddress.TryParse()
    When you say invalid are you using a regex or does it check against the list of IPs assigned to the machine?
    I use IPAddress.TryParse().
    Checking the actual list of available addresses is a good idea.
    It would also not be a bad idea to use MultipleSelectionListController, prefilled with all actual addresses of the system.
    But my soulution made me implement the MultipleEntryListController, which was kinda fun for my 1st contribution[DOUBLEPOST=1419695673][/DOUBLEPOST]
    hello Osre,
    welcome in our community, i can't help on developing side, all our dev are great and have experience with MP. (y) so don't hesitate to their ask.
    what i can say, is don't forget to provide an small wiki page on how work your plugin and what can done... i know it's a bit young ... for now

    Thank you for your contribution, and happy christmas.
    Thank you for the warm welcome.
    My contribution is not an plugin on it's own, it is an extension to the core, which hopefully will be added to MP2 by one of the devs.
    Generally it allows to edit several of the settings, which were not editable via the GUI so far.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    R Correct setting for recordings on shared folder General 0
    J New computer with win10 and how will i set Mediaportal up ? Newcomers Forum 55
    M [fixed] [MP2-831] 12h time format shown in TV Guide with Swedish language settings Submit: Bug Reports 27
    joEhSuper Backup Setting - ErrorBackupFolder TV-Server 9
    Rob Hexenmeister [solved] Customising Fanart Handler settings Fanart Handler 3
    joecrow AMD Radeon Settings app. won't start after hibernation. General Support 0
    L [solved] Modifying programmed recording after setting it General 0
    B [solved] How to manually set MAC of TV Server for WOL Installation, configuration support 2
    X MadVR Settings Video & DVD 2
    J Resume from Standby Last Module TV Showing TV Server Settings Television (MyTV frontend and TV-Server) 2
    D Correct wake-on-lan settings General 3
    G MP Crashed during setting up recording. Newcomers Forum 1
    cbr954rr Overtake/overwrite settings for all clients Feature Requests 0
    cbr954rr Same settings on all Clients? General 6
    framug 1.22.0 BasicHome Editor settings for DefaultWide HD skin not kept when update 1.22 3
    N [Question] [MP2-493] Default culture not saved in settings MediaPortal 2 0
    cbr954rr Movie sets in films General 20
    D PC rebuild & MP2 upgrade - how to preserve database and settings? General 1
    cbr954rr Possibillity to export and import all client settings? General 0
    morpheus_xx [Finished] [MP2-802] TV-Settings availability in all TV screens MediaPortal 2 12
    N [will not fix] Changed settings do not take effect until MP2-Client is stopped and restarted. Submit: Bug Reports 4
    ajs [solved] Latest Media Handler - Skin settings - Custom latests items number Fanart Handler 27
    Rob Hexenmeister [solved] Latests Media Handler - Skinning an updating window or control Fanart Handler 26
    A Operating System Important Win10 Settings for MP Operating System 1
    T Mp 1.20 won't play .265 hdr capable file......settings problem? logs inc. Watch / Listen Media 0
    Similar threads

























    Top Bottom