void CGUIDialogPVRGuideSearch::UpdateDurationSpin(void) { /* minimum duration */ CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MIN_DURATION); if (!pSpin) return; pSpin->Clear(); pSpin->AddLabel("-", EPG_SEARCH_UNSET); for (int i = 1; i < 12*60/5; i++) { CStdString string; string.Format(g_localizeStrings.Get(14044), i*5); pSpin->AddLabel(string, i*5); } pSpin->SetValue(m_searchFilter->m_iMinimumDuration); /* maximum duration */ pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MAX_DURATION); if (!pSpin) return; pSpin->Clear(); pSpin->AddLabel("-", EPG_SEARCH_UNSET); for (int i = 1; i < 12*60/5; i++) { CStdString string; string.Format(g_localizeStrings.Get(14044),i*5); pSpin->AddLabel(string, i*5); } pSpin->SetValue(m_searchFilter->m_iMaximumDuration); }
void CGUIWindowSettingsCategory::FillControl(CSetting *pSetting, CGUIControl *pSettingControl) { void *filler = CSettings::Get().GetSettingOptionsFiller(pSetting); if (filler == NULL) return; if (pSetting->GetType() == SettingTypeInteger) { CSettingInt *pSettingInt = (CSettingInt*)pSetting; // get the list of options and the current option IntegerSettingOptions options; int currentOption = pSettingInt->GetValue(); ((IntegerSettingOptionsFiller)filler)(pSetting, options, currentOption); // clear the spinner control CGUISpinControlEx *pSpinControl = (CGUISpinControlEx *)pSettingControl; pSpinControl->Clear(); // fill the spinner control for (IntegerSettingOptions::const_iterator option = options.begin(); option != options.end(); option++) pSpinControl->AddLabel(option->first, option->second); // set the current option pSpinControl->SetValue(currentOption); // check if the current setting has changed if (currentOption != pSettingInt->GetValue()) pSettingInt->SetValue(currentOption); } else if (pSetting->GetType() == SettingTypeString) { CSettingString *pSettingString = (CSettingString*)pSetting; // get the list of options and the current option StringSettingOptions options; std::string currentOption = pSettingString->GetValue(); ((StringSettingOptionsFiller)filler)(pSetting, options, currentOption); // clear the spinner control CGUISpinControlEx *pSpinControl = (CGUISpinControlEx *)pSettingControl; pSpinControl->Clear(); // fill the spinner control for (StringSettingOptions::const_iterator option = options.begin(); option != options.end(); option++) pSpinControl->AddLabel(option->first, option->second); // set the current option pSpinControl->SetStringValue(currentOption); // check if the current setting has changed if (currentOption.compare(pSettingString->GetValue()) != 0) pSettingString->SetValue(currentOption); } }
void CGUIDialogPVRChannelManager::Update() { // lock our display, as this window is rendered from the player thread g_graphicsContext.Lock(); m_viewControl.SetCurrentView(CONTROL_LIST_CHANNELS); // empty the lists ready for population Clear(); CPVRChannelGroupPtr channels = g_PVRChannelGroups->GetGroupAll(m_bIsRadio); // No channels available, nothing to do. if(!channels) return; for (int iChannelPtr = 0; iChannelPtr < channels->Size(); iChannelPtr++) { CFileItemPtr channelFile = channels->GetByIndex(iChannelPtr); if (!channelFile || !channelFile->HasPVRChannelInfoTag()) continue; const CPVRChannel *channel = channelFile->GetPVRChannelInfoTag(); channelFile->SetProperty("ActiveChannel", !channel->IsHidden()); channelFile->SetProperty("Name", channel->ChannelName()); channelFile->SetProperty("UseEPG", channel->EPGEnabled()); channelFile->SetProperty("Icon", channel->IconPath()); channelFile->SetProperty("EPGSource", (int)0); channelFile->SetProperty("ParentalLocked", channel->IsLocked()); channelFile->SetProperty("Number", StringUtils::Format("%i", channel->ChannelNumber())); if (channel->IsVirtual()) { channelFile->SetProperty("Virtual", true); channelFile->SetProperty("StreamURL", channel->StreamURL()); } CStdString clientName; if (channel->ClientID() == PVR_VIRTUAL_CLIENT_ID) /* XBMC internal */ clientName = g_localizeStrings.Get(19209); else g_PVRClients->GetClientName(channel->ClientID(), clientName); channelFile->SetProperty("ClientName", clientName); m_channelItems->Add(channelFile); } CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(SPIN_EPGSOURCE_SELECTION); if (pSpin) { pSpin->Clear(); pSpin->AddLabel(g_localizeStrings.Get(19210), 0); /// TODO: Add Labels for EPG scrapers here } Renumber(); m_viewControl.SetItems(*m_channelItems); m_viewControl.SetSelectedItem(m_iSelected); g_graphicsContext.Unlock(); }
void CGUIDialogNetworkSetup::OnInitWindow() { // replace our buttons with edits ChangeButtonToEdit(CONTROL_SERVER_ADDRESS); ChangeButtonToEdit(CONTROL_REMOTE_PATH); ChangeButtonToEdit(CONTROL_USERNAME); ChangeButtonToEdit(CONTROL_PORT_NUMBER); ChangeButtonToEdit(CONTROL_PASSWORD); // start as unconfirmed m_confirmed = false; CGUIDialog::OnInitWindow(); // Add our protocols CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_PROTOCOL); if (!pSpin) return; pSpin->Clear(); pSpin->AddLabel(g_localizeStrings.Get(20171), NET_PROTOCOL_SMB); pSpin->AddLabel(g_localizeStrings.Get(21331), NET_PROTOCOL_TUXBOX); pSpin->AddLabel(g_localizeStrings.Get(20172), NET_PROTOCOL_XBMSP); pSpin->AddLabel(g_localizeStrings.Get(20301), NET_PROTOCOL_HTTPS); pSpin->AddLabel(g_localizeStrings.Get(20300), NET_PROTOCOL_HTTP); pSpin->AddLabel(g_localizeStrings.Get(20173), NET_PROTOCOL_FTP); pSpin->AddLabel(g_localizeStrings.Get(20174), NET_PROTOCOL_DAAP); pSpin->AddLabel(g_localizeStrings.Get(20175), NET_PROTOCOL_UPNP); pSpin->AddLabel(g_localizeStrings.Get(20304), NET_PROTOCOL_RSS); pSpin->SetValue(m_protocol); OnProtocolChange(); }
void CGUIDialogPVRGuideSearch::UpdateGroupsSpin(void) { CFileItemList groups; CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GROUPS); if (!pSpin) return; /* tv groups */ g_PVRChannelGroups->GetTV()->GetGroupList(&groups); for (int iGroupPtr = 0; iGroupPtr < groups.Size(); iGroupPtr++) pSpin->AddLabel(groups[iGroupPtr]->GetLabel(), atoi(groups[iGroupPtr]->GetPath())); /* radio groups */ groups.ClearItems(); g_PVRChannelGroups->GetRadio()->GetGroupList(&groups); for (int iGroupPtr = 0; iGroupPtr < groups.Size(); iGroupPtr++) pSpin->AddLabel(groups[iGroupPtr]->GetLabel(), atoi(groups[iGroupPtr]->GetPath())); pSpin->SetValue(m_searchFilter->m_iChannelGroup); }
void CGUIDialogPVRGuideSearch::UpdateGroupsSpin(void) { CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GROUPS); if (!pSpin) return; std::vector<CPVRChannelGroupPtr> group; std::vector<CPVRChannelGroupPtr>::const_iterator it; /* tv groups */ group = g_PVRChannelGroups->GetTV()->GetMembers(); for (it = group.begin(); it != group.end(); ++it) pSpin->AddLabel((*it)->GroupName(), (*it)->GroupID()); /* radio groups */ group = g_PVRChannelGroups->GetRadio()->GetMembers(); for (it = group.begin(); it != group.end(); ++it) pSpin->AddLabel((*it)->GroupName(), (*it)->GroupID()); pSpin->SetValue(m_searchFilter->m_iChannelGroup); }
void CGUIDialogPVRGuideSearch::UpdateGenreSpin(void) { CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GENRE); if (!pSpin) return; pSpin->Clear(); pSpin->AddLabel(g_localizeStrings.Get(593), EPG_SEARCH_UNSET); pSpin->AddLabel(g_localizeStrings.Get(19500), EPG_EVENT_CONTENTMASK_MOVIEDRAMA); pSpin->AddLabel(g_localizeStrings.Get(19516), EPG_EVENT_CONTENTMASK_NEWSCURRENTAFFAIRS); pSpin->AddLabel(g_localizeStrings.Get(19532), EPG_EVENT_CONTENTMASK_SHOW); pSpin->AddLabel(g_localizeStrings.Get(19548), EPG_EVENT_CONTENTMASK_SPORTS); pSpin->AddLabel(g_localizeStrings.Get(19564), EPG_EVENT_CONTENTMASK_CHILDRENYOUTH); pSpin->AddLabel(g_localizeStrings.Get(19580), EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE); pSpin->AddLabel(g_localizeStrings.Get(19596), EPG_EVENT_CONTENTMASK_ARTSCULTURE); pSpin->AddLabel(g_localizeStrings.Get(19612), EPG_EVENT_CONTENTMASK_SOCIALPOLITICALECONOMICS); pSpin->AddLabel(g_localizeStrings.Get(19628), EPG_EVENT_CONTENTMASK_EDUCATIONALSCIENCE); pSpin->AddLabel(g_localizeStrings.Get(19644), EPG_EVENT_CONTENTMASK_LEISUREHOBBIES); pSpin->AddLabel(g_localizeStrings.Get(19660), EPG_EVENT_CONTENTMASK_SPECIAL); pSpin->AddLabel(g_localizeStrings.Get(19499), EPG_EVENT_CONTENTMASK_USERDEFINED); pSpin->SetValue(m_searchFilter->m_iGenreType); }
bool CGUIDialogPVRGuideSearch::OnMessage(CGUIMessage& message) { CGUIDialog::OnMessage(message); switch (message.GetMessage()) { case GUI_MSG_WINDOW_INIT: { m_bConfirmed = false; m_bCanceled = false; } break; case GUI_MSG_CLICKED: { int iControl = message.GetSenderId(); if (iControl == CONTROL_BTN_SEARCH) { OnSearch(); m_bCanceled = false; Close(); return true; } else if (iControl == CONTROL_BTN_CANCEL) { Close(); m_bCanceled = true; return true; } else if (iControl == CONTROL_BTN_DEFAULTS) { if (m_searchfilter) { m_searchfilter->Reset(); Update(); } return true; } else if (iControl == CONTROL_SPIN_GROUPS) { /* Set Channel list spin */ CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_CHANNELS); if (pSpin) { CFileItemList channelslist_tv; const CPVRChannelGroup *group = CPVRManager::GetChannelGroups()->GetById(false, m_searchfilter->m_iChannelGroup); if (group) group->GetMembers(&channelslist_tv); pSpin->Clear(); pSpin->AddLabel(g_localizeStrings.Get(19217), -1); pSpin->AddLabel(g_localizeStrings.Get(19023), -2); pSpin->AddLabel(g_localizeStrings.Get(19024), -3); for (int i = 0; i < channelslist_tv.Size(); i++) { int chanNumber = channelslist_tv[i]->GetPVRChannelInfoTag()->ChannelNumber(); CStdString string; string.Format("%i %s", chanNumber, channelslist_tv[i]->GetPVRChannelInfoTag()->ChannelName().c_str()); pSpin->AddLabel(string, chanNumber); } } return true; } } break; } return false; }
void CGUIDialogPVRGuideSearch::Update() { CGUISpinControlEx *pSpin; CGUIEditControl *pEdit; CGUIRadioButtonControl *pRadioButton; if (!m_searchfilter) return; pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_SEARCH); if (pEdit) { pEdit->SetLabel2(m_searchfilter->m_strSearchTerm); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT, 16017); } pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_CASE_SENS); if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIsCaseSensitive); pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_INC_DESC); if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bSearchInDescription); pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_FTA_ONLY); if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bFTAOnly); pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_UNK_GENRE); if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIncludeUnknownGenres); pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_REC); if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIgnorePresentRecordings); pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_TMR); if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIgnorePresentTimers); pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_SPIN_NO_REPEATS); if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bPreventRepeats); /* Set duration list spin */ pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MIN_DURATION); if (pSpin) { pSpin->Clear(); pSpin->AddLabel("-", -1); for (int i = 1; i < 12*60/5; i++) { CStdString string; string.Format(g_localizeStrings.Get(14044),i*5); pSpin->AddLabel(string, i*5); } pSpin->SetValue(m_searchfilter->m_iMinimumDuration); } pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MAX_DURATION); if (pSpin) { pSpin->Clear(); pSpin->AddLabel("-", -1); for (int i = 1; i < 12*60/5; i++) { CStdString string; string.Format(g_localizeStrings.Get(14044),i*5); pSpin->AddLabel(string, i*5); } pSpin->SetValue(m_searchfilter->m_iMaximumDuration); } /* Set time fields */ pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_TIME); if (pEdit) { CDateTime time = m_searchfilter->m_startTime; pEdit->SetLabel2(time.GetAsLocalizedTime("", false)); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066); } pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_TIME); if (pEdit) { CDateTime time = m_searchfilter->m_endTime; pEdit->SetLabel2(time.GetAsLocalizedTime("", false)); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066); } pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_DATE); if (pEdit) { CDateTime date = m_searchfilter->m_startDate; pEdit->SetLabel2(date.GetAsDBDate()); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067); } pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_DATE); if (pEdit) { CDateTime date = m_searchfilter->m_endDate; pEdit->SetLabel2(date.GetAsDBDate()); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067); } /* Set Channel list spin */ pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_CHANNELS); if (pSpin) { CFileItemList channelslist_tv; const CPVRChannelGroup *group = CPVRManager::GetChannelGroups()->GetById(false, m_searchfilter->m_iChannelGroup); if (group) group->GetMembers(&channelslist_tv); pSpin->Clear(); pSpin->AddLabel(g_localizeStrings.Get(19217), -1); pSpin->AddLabel(g_localizeStrings.Get(19023), -2); pSpin->AddLabel(g_localizeStrings.Get(19024), -3); for (int i = 0; i < channelslist_tv.Size(); i++) { int chanNumber = channelslist_tv[i]->GetPVRChannelInfoTag()->ChannelNumber(); CStdString string; string.Format("%i %s", chanNumber, channelslist_tv[i]->GetPVRChannelInfoTag()->ChannelName().c_str()); pSpin->AddLabel(string, chanNumber); } pSpin->SetValue(m_searchfilter->m_iChannelNumber); } /* Set Group list spin */ pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GROUPS); if (pSpin) { CFileItemList grouplist; CPVRManager::GetChannelGroups()->GetTV()->GetGroupList(&grouplist); pSpin->Clear(); pSpin->AddLabel(g_localizeStrings.Get(593), -1); for (int i = 0; i < grouplist.Size(); i++) pSpin->AddLabel(grouplist[i]->GetLabel(), atoi(grouplist[i]->m_strPath)); pSpin->SetValue(m_searchfilter->m_iChannelGroup); } /* Set Genre list spin */ pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GENRE); if (pSpin) { pSpin->Clear(); pSpin->AddLabel(g_localizeStrings.Get(593), -1); pSpin->AddLabel(g_localizeStrings.Get(19500), EVCONTENTMASK_MOVIEDRAMA); pSpin->AddLabel(g_localizeStrings.Get(19516), EVCONTENTMASK_NEWSCURRENTAFFAIRS); pSpin->AddLabel(g_localizeStrings.Get(19532), EVCONTENTMASK_SHOW); pSpin->AddLabel(g_localizeStrings.Get(19548), EVCONTENTMASK_SPORTS); pSpin->AddLabel(g_localizeStrings.Get(19564), EVCONTENTMASK_CHILDRENYOUTH); pSpin->AddLabel(g_localizeStrings.Get(19580), EVCONTENTMASK_MUSICBALLETDANCE); pSpin->AddLabel(g_localizeStrings.Get(19596), EVCONTENTMASK_ARTSCULTURE); pSpin->AddLabel(g_localizeStrings.Get(19612), EVCONTENTMASK_SOCIALPOLITICALECONOMICS); pSpin->AddLabel(g_localizeStrings.Get(19628), EVCONTENTMASK_EDUCATIONALSCIENCE); pSpin->AddLabel(g_localizeStrings.Get(19644), EVCONTENTMASK_LEISUREHOBBIES); pSpin->AddLabel(g_localizeStrings.Get(19660), EVCONTENTMASK_SPECIAL); pSpin->AddLabel(g_localizeStrings.Get(19499), EVCONTENTMASK_USERDEFINED); pSpin->SetValue(m_searchfilter->m_iGenreType); } }