*/
private void updateFilterPanel() {
Channel[] allChannels = ChannelList.getAvailableChannels();
mCategoryCB.removeAllItems();
mCategoryCB.addItem(new FilterItem(mLocalizer.msg("allCategories",
"All Categories"), null));
mCategoryCB.addItem(new FilterItem(mLocalizer.msg("allExceptEventCinema",
"All except Event/Cinema"), new Integer[] { Channel.CATEGORY_TV,
Channel.CATEGORY_RADIO, Channel.CATEGORY_NONE }));
if (channelListContains(allChannels, Channel.CATEGORY_TV)) {
addCategoryFilter(Channel.CATEGORY_TV);
if (channelListContains(allChannels, Channel.CATEGORY_TV)) {
mCategoryCB.addItem(new FilterItem(mLocalizer.msg("categoryNotSpecial",
"TV"), Channel.CATEGORY_TV * -1));
}
if (channelListContains(allChannels, Channel.CATEGORY_DIGITAL)) {
addCategoryFilter(Channel.CATEGORY_DIGITAL);
}
if (channelListContains(allChannels, Channel.CATEGORY_SPECIAL_MUSIC)) {
addCategoryFilter(Channel.CATEGORY_SPECIAL_MUSIC);
}
if (channelListContains(allChannels, Channel.CATEGORY_SPECIAL_SPORT)) {
addCategoryFilter(Channel.CATEGORY_SPECIAL_SPORT);
}
if (channelListContains(allChannels, Channel.CATEGORY_SPECIAL_NEWS)) {
addCategoryFilter(Channel.CATEGORY_SPECIAL_NEWS);
}
if (channelListContains(allChannels, Channel.CATEGORY_SPECIAL_OTHER)) {
addCategoryFilter(Channel.CATEGORY_SPECIAL_OTHER);
}
if (channelListContains(allChannels, Channel.CATEGORY_PAY_TV)) {
addCategoryFilter(Channel.CATEGORY_PAY_TV);
}
if (channelListContains(allChannels, Channel.CATEGORY_RADIO)) {
addCategoryFilter(Channel.CATEGORY_RADIO);
}
}
if (channelListContains(allChannels, Channel.CATEGORY_CINEMA)) {
addCategoryFilter(Channel.CATEGORY_CINEMA);
}
if (channelListContains(allChannels, Channel.CATEGORY_EVENTS)) {
addCategoryFilter(Channel.CATEGORY_EVENTS);
}
if (channelListContains(allChannels, Channel.CATEGORY_PAYED_DATA_TV)) {
addCategoryFilter(Channel.CATEGORY_PAYED_DATA_TV);
}
if (channelListContains(allChannels, Channel.CATEGORY_NONE)) {
addCategoryFilter(Channel.CATEGORY_NONE);
}
if(mCategoryCB.getItemCount() > Settings.propSelectedChannelCategoryIndex.getByte()) {
mCategoryCB.setSelectedIndex(Settings.propSelectedChannelCategoryIndex.getByte());
}
HashSet<String> countries = new HashSet<String>();
for (Channel allChannel : allChannels) {
String country = allChannel.getCountry();
if (country != null) {
countries.add(country.toLowerCase());
}
}
mCountryCB.removeAllItems();
mCountryCB.addItem(new FilterItem(mLocalizer.msg("allCountries",
"All Countries"), null));
ArrayList<FilterItem> items = new ArrayList<FilterItem>(countries.size());
for (String country : countries) {
Locale locale = new Locale(Locale.getDefault().getLanguage(), country);
items.add(new FilterItem(locale.getDisplayCountry(), country));
}
Collections.sort(items);
String defaultCountry = Settings.propSelectedChannelCountry.getString();
for (FilterItem item : items) {