[Approved] GUIListControl, popup first letter when scrolling (1 Viewer)

DieBagger

Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    41
    Austria
    Home Country
    Austria Austria
    Tested it and it's working very well but jameson_uk had a few pretty good points:

    1) Depends on the skin, in the current patch there is no config option (do we need one?).
    2) It becomes pretty useless (@pilehave: can you disable it when sorted other then alphabetically?)
    3) It will display the first character.
    4) the patch doesn't introduce a new control, just skin properties (#scrolling.up, #scrolling.down, #selecteditem.firstchar)

    This is an addition of a really neat feature that xmbc already has, so we should definately include this for 1.2 beta...

    :D

    As far as I can tell it should be possible to expose the sortmethod in this function from GUIListControl.cs:

    Code:
        public void Sort(IComparer<GUIListItem> comparer)
        {
          try
          {
            _listItems.Sort(comparer);
          }
          catch (Exception) { }
          _refresh = true;
        }

    There you can disable the scrollcode if it is not sorted by name (which is alphabetically). But I'm not sure of how it would be correct to do it :confused:

    I had a look at it (also asked in irc) and seems that it isn't possible in GUIListController since the plugin can freely decide which sort option it offers... :(

    After a discussion on IRC (thx @ SilentException) I would propose to add a new property to the facade control (GUIFacadeViewControl), default being disabled, so the plugin author can choose to enable this if he feels that the current sort method would benefit from showing the scroll item...

    As for the internal plugins, this would mean that myvideos, mymusic, etc. would need to be updated so they would show the items only when sorted alphabetically.

    Hope this makes sense... ;)
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    As for the internal plugins, this would mean that myvideos, mymusic, etc. would need to be updated so they would show the items only when sorted alphabetically.

    Very importand, since the patch should also include that (modified internal plugins) + modified skin files. Binaries against 1.1.1 and/or 1.2 alpha would be nice for quicker demonstration / testing too.
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    41
    Austria
    Home Country
    Austria Austria
    Hi pilehave,

    I've updated the status of the patch to WIP for now, will change to evaluating once we have an updated version of the patch.

    :D
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    41
    Austria
    Home Country
    Austria Austria
    Hey pilehave,

    hope you don't forget about this patch as it would make a great addition to mp... ;)

    :D
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #15
    I don't know how to make the required changes, if anyone feels up to the job, please do so.
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    I really isn't that hard :)

    10 minutes and this is what I came up with..

    Plugins can now decide when and if they want scrolling feature to work/show.. If you wanna continue working on this (read if you want it implemented), you should edit default plugins (Music, Videos, Pictures, Recordings) to set property FirstLetterScroll to true on facade after sorting alphabetically or by years or (any other suited).

    Also supplying modified skin files would be nice.
     

    Attachments

    • Patch to allow popup of first letter v2.patch
      3.7 KB

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #17
    OK, please try the attached patches for MediaPortal and TvPlugin. I have also attached the skin-files for B3W and the scroller_bg.png image posted in my first post.

    I found two more places where there's sorting involved; Scheduled recordings and Radio.

    I didn't include these in the patch, I don't think it is useful in Scheduled recordings (not many have a lot of schedules) and Radio...well, theoretically you could have like 500 webradio-channels, but what do you think?

    And...thanks for the help and support :D
     

    Attachments

    • Core.patch
      3.7 KB
    • WindowPlugins.patch
      4.3 KB
    • TvPlugin.patch
      1.2 KB
    • Blue3wide.zip
      9.7 KB

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Good job, thanks! Will look at these first thing next week. During weekends I usually avoid computers :)

    For Schedules, doubt it's gonna be needed for anyone :)
    Radio might be useful (most won't have that many stations, but some might...)

    Also, it might be useful to add a skin attribute to enable scrolling (some plugins always sort by name so skin can enable functionality without change in the plugin). What do you think?
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    41
    Austria
    Home Country
    Austria Austria
    Also, it might be useful to add a skin attribute to enable scrolling (some plugins always sort by name so skin can enable functionality without change in the plugin). What do you think?

    Doesn't the skin already have the possibility to "disable" this by just not implementing the scrollitem?

    Will test the patch asap :D
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Also, it might be useful to add a skin attribute to enable scrolling (some plugins always sort by name so skin can enable functionality without change in the plugin). What do you think?

    Doesn't the skin already have the possibility to "disable" this by just not implementing the scrollitem?

    Will test the patch asap :D

    No because now plugin has to control this functionality.. Because of sorting..
     

    Users who are viewing this thread

    Top Bottom