Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple content elements in a single container #10730

Merged
merged 1 commit into from
Feb 18, 2017

Conversation

b-pass
Copy link
Contributor

@b-pass b-pass commented Oct 19, 2016

Description

This change adds a new IListProvider, called CMultiProvider, which aggregates several independent <content> blocks (either DirectoryProviders or StaticProviders or both).

Motivation and Context

DirectoryProviders (dynamically filled <content> blocks) are a powerful feature. But currently you can only fill a list with a single directory at a time, and you also cannot add other static elements to a dynamic list. For example, you might like to add some navigational list entries at the top of a list, and have it fill with dynamic content below those static entries. Or maybe you would like to combine two different directories in one list for some reason. This was hinted as a potential new feature in 2014, but it seems it never got added: http://forum.kodi.tv/showthread.php?tid=176864

How Has This Been Tested?

I tested this by trying a few different combinations of multiple <content> blocks.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

@ronie ronie added Type: Feature non-breaking change which adds functionality Component: GUI engine v18 Leia labels Oct 19, 2016
@Hitcher
Copy link
Contributor

Hitcher commented Oct 19, 2016

Nice, thanks.

@BigNoid
Copy link
Member

BigNoid commented Oct 19, 2016

Nice, tested and works great. Thx for this addition!
You can pick BigNoid@241de15 for Xcode sync

@b-pass
Copy link
Contributor Author

b-pass commented Oct 19, 2016

Picked and Squashed, thanks!

virtual void Reset(bool immediately = false);
virtual bool OnClick(const CGUIListItemPtr &item);
virtual bool OnInfo(const CGUIListItemPtr &item);
virtual bool OnContextMenu(const CGUIListItemPtr &item);

This comment was marked as spam.

This comment was marked as spam.

@xhaggi
Copy link
Member

xhaggi commented Oct 20, 2016

looks good +1

@da-anda
Copy link
Member

da-anda commented Nov 18, 2016

this would be great for some home screen widgets on Estuary in v17. Are there any major concerns to hold it back for v17 (besides of feature freeze)?


protected:
std::vector<IListProviderPtr> m_providers;
mutable std::map<CGUIListItem*, IListProviderPtr> m_itemMap;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@b-pass
Copy link
Contributor Author

b-pass commented Jan 5, 2017

Fixed conflicts and squashed

@b-pass
Copy link
Contributor Author

b-pass commented Feb 9, 2017

Is there anything else I need to get this merged? I don't want it to get forgotten and miss the boat for v18....

@ronie
Copy link
Member

ronie commented Feb 9, 2017

jenkins build this please

@@ -0,0 +1,109 @@
/*
* Copyright (C) 2013 Team XBMC
* http://xbmc.org

This comment was marked as spam.

This comment was marked as spam.

provider->Fetch(subItems);
for (auto& item : subItems)
{
m_itemMap[item.get()] = provider;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@b-pass b-pass force-pushed the multi-content branch 2 times, most recently from 6174b73 to f99eb35 Compare February 9, 2017 10:53
@tamland
Copy link
Member

tamland commented Feb 18, 2017

jenkins build this please

@MartijnKaijser MartijnKaijser added this to the L 18.0-alpha1 milestone Feb 18, 2017
@MartijnKaijser MartijnKaijser merged commit 2c1977f into xbmc:master Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: GUI engine Type: Feature non-breaking change which adds functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants