void CGUIDialogPVRChannelManager::SetData(int iItem) { CGUIEditControl *pEdit; CGUIRadioButtonControl *pRadioButton; /* Check file item is in list range and get his pointer */ if (iItem < 0 || iItem >= (int)m_channelItems->Size()) return; CFileItemPtr pItem = m_channelItems->Get(iItem); if (!pItem) return; pEdit = (CGUIEditControl *)GetControl(EDIT_NAME); if (pEdit) { pEdit->SetLabel2(pItem->GetProperty("Name").asString()); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT, 19208); } pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_ACTIVE); if (pRadioButton) pRadioButton->SetSelected(pItem->GetProperty("ActiveChannel").asBoolean()); pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_USEEPG); if (pRadioButton) pRadioButton->SetSelected(pItem->GetProperty("UseEPG").asBoolean()); pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_PARENTAL_LOCK); if (pRadioButton) pRadioButton->SetSelected(pItem->GetProperty("ParentalLocked").asBoolean()); }
void CGUIDialogSettings::UpdateSetting(unsigned int id) { unsigned int settingNum = (unsigned int)-1; for (unsigned int i = 0; i < m_settings.size(); i++) { if (m_settings[i].id == id) { settingNum = i; break; } } if(settingNum == (unsigned int)-1) return; SettingInfo &setting = m_settings.at(settingNum); unsigned int controlID = settingNum + CONTROL_START; if (setting.type == SettingInfo::SPIN) { CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(controlID); if (pControl && setting.data) pControl->SetValue(*(int *)setting.data); } else if (setting.type == SettingInfo::CHECK) { CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(controlID); if (pControl && setting.data) pControl->SetSelected(*(bool *)setting.data); } else if (setting.type == SettingInfo::CHECK_UCHAR) { CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(controlID); if (pControl && setting.data) pControl->SetSelected(*(unsigned char*)setting.data ? true : false); } else if (setting.type == SettingInfo::SLIDER) { CGUISettingsSliderControl *pControl = (CGUISettingsSliderControl *)GetControl(controlID); float value = *(float *)setting.data; if (pControl && setting.data) { pControl->SetFloatValue(value); if (setting.formatFunction) pControl->SetTextValue(setting.formatFunction(value, setting.interval)); } } else if (setting.type == SettingInfo::BUTTON) { SET_CONTROL_LABEL(controlID,setting.name); if (m_usePopupSliders && setting.data && setting.formatFunction) SET_CONTROL_LABEL2(controlID,setting.formatFunction(*(float *)setting.data, setting.interval)); } if (setting.enabled) { CONTROL_ENABLE(controlID); } else { CONTROL_DISABLE(controlID); } }
bool CGUIDialogPVRChannelManager::OnClickButtonRadioParentalLocked(CGUIMessage &message) { CGUIRadioButtonControl *pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_PARENTAL_LOCK); // ask for PIN first if (!g_PVRManager.CheckParentalPIN(g_localizeStrings.Get(19262).c_str())) { pRadioButton->SetSelected(!pRadioButton->IsSelected()); return false; } if (pRadioButton) { CFileItemPtr pItem = m_channelItems->Get(m_iSelected); if (pItem) { pItem->SetProperty("Changed", true); pItem->SetProperty("ParentalLocked", pRadioButton->IsSelected()); m_bContainsChanges = true; Renumber(); return true; } } return false; }
void CGUIWindowPVRRecordings::UpdateButtons(void) { int iWatchMode = CMediaSettings::GetInstance().GetWatchedMode("recordings"); int iStringId = 257; // "Error" if (iWatchMode == WatchedModeAll) iStringId = 22015; // "All recordings" else if (iWatchMode == WatchedModeUnwatched) iStringId = 16101; // "Unwatched" else if (iWatchMode == WatchedModeWatched) iStringId = 16102; // "Watched" SET_CONTROL_LABEL(CONTROL_BTNSHOWMODE, g_localizeStrings.Get(iStringId)); bool bGroupRecordings = m_settings.GetBoolValue(CSettings::SETTING_PVRRECORD_GROUPRECORDINGS); SET_CONTROL_SELECTED(GetID(), CONTROL_BTNGROUPITEMS, bGroupRecordings); CGUIRadioButtonControl *btnShowDeleted = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWDELETED); if (btnShowDeleted) { btnShowDeleted->SetVisible(m_bRadio ? CServiceBroker::GetPVRManager().Recordings()->HasDeletedRadioRecordings() : CServiceBroker::GetPVRManager().Recordings()->HasDeletedTVRecordings()); btnShowDeleted->SetSelected(m_bShowDeletedRecordings); } CGUIWindowPVRBase::UpdateButtons(); SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowDeletedRecordings ? g_localizeStrings.Get(19179) : ""); /* Deleted recordings trash */ const CPVRRecordingsPath path(m_vecItems->GetPath()); SET_CONTROL_LABEL(CONTROL_LABEL_HEADER2, bGroupRecordings && path.IsValid() ? path.GetUnescapedDirectoryPath() : ""); }
void CGUIWindowPVRChannels::UpdateButtons(void) { CGUIRadioButtonControl *btnShowHidden = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWHIDDEN); if (btnShowHidden) { btnShowHidden->SetVisible(g_PVRChannelGroups->GetGroupAll(m_bRadio)->GetNumHiddenChannels() > 0); btnShowHidden->SetSelected(m_bShowHiddenChannels); } CGUIWindowPVRBase::UpdateButtons(); SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowHiddenChannels ? g_localizeStrings.Get(19022) : GetGroup()->GroupName()); }
void CGUIWindowPVRRecordings::UpdateButtons(void) { CGUIRadioButtonControl *btnShowDeleted = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWDELETED); if (btnShowDeleted) { btnShowDeleted->SetVisible(m_bRadio ? g_PVRRecordings->HasDeletedRadioRecordings() : g_PVRRecordings->HasDeletedTVRecordings()); btnShowDeleted->SetSelected(m_bShowDeletedRecordings); } CGUIWindowPVRBase::UpdateButtons(); SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowDeletedRecordings ? g_localizeStrings.Get(19179) : ""); /* Deleted recordings trash */ }
void CGUIWindowPVRChannelsBase::UpdateButtons(void) { CGUIRadioButtonControl *btnShowHidden = static_cast<CGUIRadioButtonControl*>(GetControl(CONTROL_BTNSHOWHIDDEN)); if (btnShowHidden) { btnShowHidden->SetVisible(CServiceBroker::GetPVRManager().ChannelGroups()->GetGroupAll(m_bRadio)->GetNumHiddenChannels() > 0); btnShowHidden->SetSelected(m_bShowHiddenChannels); } CGUIWindowPVRBase::UpdateButtons(); SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowHiddenChannels ? g_localizeStrings.Get(19022) : GetChannelGroup()->GroupName()); }
void CGUIWindowPVRRecordings::UpdateButtons(void) { SET_CONTROL_SELECTED(GetID(), CONTROL_BTNGROUPITEMS, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRRECORD_GROUPRECORDINGS)); CGUIRadioButtonControl *btnShowDeleted = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWDELETED); if (btnShowDeleted) { btnShowDeleted->SetVisible(m_bRadio ? g_PVRRecordings->HasDeletedRadioRecordings() : g_PVRRecordings->HasDeletedTVRecordings()); btnShowDeleted->SetSelected(m_bShowDeletedRecordings); } CGUIWindowPVRBase::UpdateButtons(); SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowDeletedRecordings ? g_localizeStrings.Get(19179) : ""); /* Deleted recordings trash */ }
void CGUIDialogPVRGuideSearch::Update() { 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 time fields */ pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_TIME); if (pEdit) { pEdit->SetLabel2(m_searchFilter->m_endDateTime.GetAsLocalizedTime("", false)); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066); } pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_TIME); if (pEdit) { pEdit->SetLabel2(m_searchFilter->m_startDateTime.GetAsLocalizedTime("", false)); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066); } pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_DATE); if (pEdit) { pEdit->SetLabel2(m_searchFilter->m_startDateTime.GetAsDBDate()); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067); } pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_DATE); if (pEdit) { pEdit->SetLabel2(m_searchFilter->m_endDateTime.GetAsDBDate()); pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067); } UpdateDurationSpin(); UpdateGroupsSpin(); UpdateChannelSpin(); UpdateGenreSpin(); }
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); } }
void CGUIDialogSettings::UpdateSetting(unsigned int id) { unsigned int settingNum = (unsigned int)-1; for (unsigned int i = 0; i < m_settings.size(); i++) { if (m_settings[i].id == id) { settingNum = i; break; } } if(settingNum == (unsigned int)-1) return; SettingInfo &setting = m_settings.at(settingNum); unsigned int controlID = settingNum + CONTROL_START; if (setting.type == SettingInfo::SPIN) { CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(controlID); if (pControl && setting.data) pControl->SetValue(*(int *)setting.data); } else if (setting.type == SettingInfo::CHECK) { CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(controlID); if (pControl && setting.data) pControl->SetSelected(*(bool *)setting.data); } else if (setting.type == SettingInfo::CHECK_UCHAR) { CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(controlID); if (pControl && setting.data) pControl->SetSelected(*(unsigned char*)setting.data ? true : false); } else if (setting.type == SettingInfo::SLIDER) { CGUISettingsSliderControl *pControl = (CGUISettingsSliderControl *)GetControl(controlID); if (pControl && setting.data) { float value = *(float *)setting.data; pControl->SetFloatValue(value); if (setting.formatFunction) pControl->SetTextValue(setting.formatFunction(value, setting.interval)); } } else if (setting.type == SettingInfo::BUTTON_DIALOG) { SET_CONTROL_LABEL(controlID,setting.name); CGUIButtonControl *pControl = (CGUIButtonControl *)GetControl(controlID); if (pControl && setting.data) pControl->SetLabel2(*(CStdString *)setting.data); } else if (setting.type == SettingInfo::EDIT) { CGUIEditControl *pControl = (CGUIEditControl *)GetControl(controlID); if (pControl && setting.data) pControl->SetLabel2(*(CStdString *)setting.data); } else if (setting.type == SettingInfo::EDIT_NUM) { CGUIEditControl *pControl = (CGUIEditControl *)GetControl(controlID); if (pControl && setting.data) { CStdString strIndex; strIndex.Format("%i", *(int *)setting.data); pControl->SetLabel2(strIndex); } } else if (setting.type == SettingInfo::STRING) { SET_CONTROL_LABEL(controlID, setting.name); string strNewValue = string(*(CStdString *)setting.data); if (strNewValue.empty()) strNewValue = "-"; SET_CONTROL_LABEL2(controlID, strNewValue); } if (setting.enabled) { CONTROL_ENABLE(controlID); } else { CONTROL_DISABLE(controlID); } }