void RecordingSelector::clearAll() { while (!m_selectedList.isEmpty()) m_selectedList.takeFirst(); m_selectedList.clear(); updateRecordingList(); }
void RecordingSelector::selectAll() { while (!m_selectedList.isEmpty()) m_selectedList.takeFirst(); m_selectedList.clear(); ProgramInfo *p; vector<ProgramInfo *>::iterator i = m_recordingList->begin(); for ( ; i != m_recordingList->end(); i++) { p = *i; m_selectedList.append(p); } updateRecordingList(); }
void RecordingSelector::Init(void) { QString message = tr("Retrieving Recording List. Please Wait..."); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(message, popupStack, "recordingselectorbusydialog"); if (busyPopup->Create()) popupStack->AddScreen(busyPopup, false); else { delete busyPopup; busyPopup = false; } GetRecordingListThread *thread = new GetRecordingListThread(this); while (thread->isRunning()) { qApp->processEvents(); usleep(100); } if (!m_recordingList || m_recordingList->size() == 0) { ShowOkPopup(tr("Either you don't have any recordings or " "no recordings are available locally!")); if (busyPopup) busyPopup->Close(); Close(); return; } updateCategorySelector(); updateSelectedList(); updateRecordingList(); if (busyPopup) busyPopup->Close(); }
void ImportFile::Init(void) { QString message = tr("Retrieving Recording List. Please Wait..."); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(message, popupStack, "getrecordingbusydialog"); if (busyPopup->Create()) popupStack->AddScreen(busyPopup, false); else { delete busyPopup; busyPopup = NULL; } GetImportRecordingListThread *thread = new GetImportRecordingListThread(this); while (thread->isRunning()) { qApp->processEvents(); usleep(2000); } if (m_recordingList.empty()) { ShowOkPopup(tr("Failed to get recording list!")); if (busyPopup) busyPopup->Close(); Close(); return; } updateCategorySelector(); updateSelectedList(); updateRecordingList(); if (busyPopup) busyPopup->Close(); }
void WelcomeDialog::updateAll(void) { updateRecordingList(); updateScheduledList(); }
void WelcomeDialog::customEvent(QEvent *e) { if ((MythEvent::Type)(e->type()) == MythEvent::MythEventMessage) { MythEvent *me = (MythEvent *) e; if (me->Message().left(21) == "RECORDING_LIST_CHANGE" || me->Message() == "UPDATE_PROG_INFO") { LOG(VB_GENERAL, LOG_NOTICE, "MythWelcome received a recording list change event"); QMutexLocker lock(&m_RecListUpdateMuxtex); if (pendingRecListUpdate()) { LOG(VB_GENERAL, LOG_NOTICE, " [deferred to pending handler]"); } else { // we can't query the backend from inside a customEvent QTimer::singleShot(500, this, SLOT(updateRecordingList())); setPendingRecListUpdate(true); } } else if (me->Message().left(15) == "SCHEDULE_CHANGE") { LOG(VB_GENERAL, LOG_NOTICE, "MythWelcome received a SCHEDULE_CHANGE event"); QMutexLocker lock(&m_SchedUpdateMuxtex); if (pendingSchedUpdate()) { LOG(VB_GENERAL, LOG_NOTICE, " [deferred to pending handler]"); } else { QTimer::singleShot(500, this, SLOT(updateScheduledList())); setPendingSchedUpdate(true); } } else if (me->Message().left(18) == "SHUTDOWN_COUNTDOWN") { #if 0 LOG(VB_GENERAL, LOG_NOTICE, "MythWelcome received a SHUTDOWN_COUNTDOWN event"); #endif QString secs = me->Message().mid(19); m_secondsToShutdown = secs.toInt(); updateStatusMessage(); updateScreen(); } else if (me->Message().left(12) == "SHUTDOWN_NOW") { LOG(VB_GENERAL, LOG_NOTICE, "MythWelcome received a SHUTDOWN_NOW event"); if (gCoreContext->IsFrontendOnly()) { // does the user want to shutdown this frontend only machine // when the BE shuts down? if (gCoreContext->GetNumSetting("ShutdownWithMasterBE", 0) == 1) { LOG(VB_GENERAL, LOG_NOTICE, "MythWelcome is shutting this computer down now"); QString poweroff_cmd = gCoreContext->GetSetting("MythShutdownPowerOff", ""); if (!poweroff_cmd.isEmpty()) myth_system(poweroff_cmd); } } } } }
void RecordingSelector::setCategory(MythUIButtonListItem *item) { (void)item; updateRecordingList(); }
void ImportFile::setCategory(MythUIButtonListItem *item) { (void)item; updateRecordingList(); }