Browse files

Merge pull request #4282 from Montellese/movie_set_fixes

Fix "Manage movie sets..." doing nothing when there are no sets available
  • Loading branch information...
2 parents bdcc690 + f1fb84a commit d13fc40a47e5893b8c7c0a390d2c286302840176 @jmarshallnz jmarshallnz committed Feb 26, 2014
Showing with 14 additions and 2 deletions.
  1. +8 −0 xbmc/dialogs/GUIDialogSelect.cpp
  2. +5 −1 xbmc/utils/GroupUtils.cpp
  3. +1 −1 xbmc/video/dialogs/GUIDialogVideoInfo.cpp
View
8 xbmc/dialogs/GUIDialogSelect.cpp
@@ -132,6 +132,14 @@ bool CGUIDialogSelect::OnMessage(CGUIMessage& message)
break;
case GUI_MSG_SETFOCUS:
{
+ // make sure the additional button is focused in case the list is empty
+ // (otherwise it is impossible to navigate to the additional button)
+ if (m_vecList->IsEmpty() && m_bButtonEnabled &&
+ m_viewControl.HasControl(message.GetControlId()))
+ {
+ SET_CONTROL_FOCUS(CONTROL_BUTTON, 0);
+ return true;
+ }
if (m_viewControl.HasControl(message.GetControlId()) && m_viewControl.GetCurrentControl() != message.GetControlId())
{
m_viewControl.SetFocused();
View
6 xbmc/utils/GroupUtils.cpp
@@ -36,9 +36,13 @@ typedef map<int, set<CFileItemPtr> > SetMap;
bool GroupUtils::Group(GroupBy groupBy, const std::string &baseDir, const CFileItemList &items, CFileItemList &groupedItems, GroupAttribute groupAttributes /* = GroupAttributeNone */)
{
- if (items.Size() <= 0 || groupBy == GroupByNone)
+ if (groupBy == GroupByNone)
return false;
+ // nothing to do if there are no items to group
+ if (items.Size() <= 0)
+ return true;
+
SetMap setMap;
for (int index = 0; index < items.Size(); index++)
{
View
2 xbmc/video/dialogs/GUIDialogVideoInfo.cpp
@@ -1449,7 +1449,7 @@ bool CGUIDialogVideoInfo::GetSetForMovie(const CFileItem *movieItem, CFileItemPt
CFileItemList listItems;
CStdString baseDir = "videodb://movies/sets/";
- if (!CDirectory::GetDirectory(baseDir, listItems) || listItems.Size() <= 0)
+ if (!CDirectory::GetDirectory(baseDir, listItems))
return false;
listItems.Sort(SortByLabel, SortOrderAscending, SortAttributeIgnoreArticle);

0 comments on commit d13fc40

Please sign in to comment.