void ProgFinder::edit() { if (GetFocusWidget() == m_timesList) { ProgramInfo *curPick = m_showData[m_timesList->GetCurrentPos()]; if (curPick) { EditScheduled(curPick); // TODO: When schedule editor is non-blocking, move selectShowData(curPick->GetTitle(), m_timesList->GetCurrentPos()); } } }
void ProgFinder::getInfo(bool toggle) { if (GetFocusWidget() == m_timesList) { ProgramInfo *curPick = m_showData[m_timesList->GetCurrentPos()]; if (curPick) { if (toggle) QuickRecord(curPick); else EditRecording(curPick); } else return; // TODO: When schedule editor is non-blocking, move selectShowData(curPick->GetTitle(), m_timesList->GetCurrentPos()); } }
void ProgFinder::customEvent(QEvent *event) { if ((MythEvent::Type)(event->type()) == MythEvent::MythEventMessage) { MythEvent *me = (MythEvent *)event; QString message = me->Message(); if (message == "SCHEDULE_CHANGE") { if (GetFocusWidget() == m_timesList) { ProgramInfo *curPick = m_showData[m_timesList->GetCurrentPos()]; if (curPick) selectShowData(curPick->GetTitle(), m_timesList->GetCurrentPos()); } } } else if (event->type() == DialogCompletionEvent::kEventType) { DialogCompletionEvent *dce = (DialogCompletionEvent*)(event); QString resultid = dce->GetId(); QString resulttext = dce->GetResultText(); if (resultid == "menu") { if (resulttext == tr("Clear Search")) { m_searchStr.clear(); if (m_searchText) m_searchText->SetText(m_searchStr); updateShowList(); SetFocusWidget(m_showList); } else if (resulttext == tr("Edit Search")) { MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); SearchInputDialog *textInput = new SearchInputDialog(popupStack, m_searchStr); if (textInput->Create()) { textInput->SetReturnEvent(this, "searchtext"); popupStack->AddScreen(textInput); } } else if (resulttext == tr("Toggle Record")) { quickRecord(); } else if (resulttext == tr("Program Details")) { details(); } else if (resulttext == tr("Upcoming")) { upcoming(); } else if (resulttext == tr("Custom Edit")) { customEdit(); } else if (resulttext == tr("Program Guide")) { showGuide(); } } else if (resultid == "searchtext") { m_searchStr = resulttext; if (m_searchText) m_searchText->SetText(m_searchStr); updateShowList(); SetFocusWidget(m_showList); } else ScheduleCommon::customEvent(event); } }
void ProgFinder::timesListTakeFocus(void) { selectShowData("", 0); updateInfo(); }