Permalink
Browse files

GUIDialogMediaFilter: show the number of available choices for filter…

…s like genre, actors, studios etc
  • Loading branch information...
1 parent 918f64b commit d1e8d38bdb6ecc9199e03b827c5c4d10d450789c @Montellese committed Sep 9, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 xbmc/dialogs/GUIDialogMediaFilter.cpp
@@ -563,11 +563,20 @@ void CGUIDialogMediaFilter::UpdateControls()
{
CFileItemList items;
OnBrowse(itFilter->second, items, true);
- if (items.Size() <= 0 ||
- (items.Size() == 1 && items[0]->HasProperty("total") && items[0]->GetProperty("total").asInteger() <= 1))
+
+ int size = items.Size();
+ if (items.Size() == 1 && items[0]->HasProperty("total"))
+ size = (int)items[0]->GetProperty("total").asInteger();
+
+ CStdString label = g_localizeStrings.Get(itFilter->second.label);
+ if (size <= 1)
CONTROL_DISABLE(itFilter->second.controlIndex);
else
+ {
CONTROL_ENABLE(itFilter->second.controlIndex);
+ label.Format("%s [%d]", label, size);
+ }
+ SET_CONTROL_LABEL(itFilter->second.controlIndex, label);
}
}
}

0 comments on commit d1e8d38

Please sign in to comment.