bool ArchiveFileSelector::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("mythnative-ui.xml", "archivefile_selector", this); if (!foundtheme) return false; bool err = false; UIUtilW::Assign(this, m_titleText, "title"); UIUtilE::Assign(this, m_fileButtonList, "filelist", &err); UIUtilE::Assign(this, m_locationEdit, "location_edit", &err); UIUtilE::Assign(this, m_backButton, "back_button", &err); UIUtilE::Assign(this, m_homeButton, "home_button", &err); UIUtilE::Assign(this, m_nextButton, "next_button", &err); UIUtilE::Assign(this, m_prevButton, "prev_button", &err); UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err); UIUtilE::Assign(this, m_progTitle, "title_text", &err); UIUtilE::Assign(this, m_progSubtitle, "subtitle_text", &err); UIUtilE::Assign(this, m_progStartTime, "starttime_text", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'archivefile_selector'"); return false; } if (m_titleText) m_titleText->SetText(tr("Find File To Import")); connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(nextPressed())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed())); connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(prevPressed())); connect(m_locationEdit, SIGNAL(LosingFocus()), this, SLOT(locationEditLostFocus())); m_locationEdit->SetText(m_curDirectory); connect(m_backButton, SIGNAL(Clicked()), this, SLOT(backPressed())); connect(m_homeButton, SIGNAL(Clicked()), this, SLOT(homePressed())); connect(m_fileButtonList, SIGNAL(itemSelected(MythUIButtonListItem *)), this, SLOT(itemSelected(MythUIButtonListItem *))); connect(m_fileButtonList, SIGNAL(itemClicked(MythUIButtonListItem *)), this, SLOT(itemClicked(MythUIButtonListItem *))); BuildFocusList(); SetFocusWidget(m_fileButtonList); updateSelectedList(); updateFileList(); return true; }
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(); }
bool FileSelector::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("mytharchive-ui.xml", "file_selector", this); if (!foundtheme) return false; bool err = false; UIUtilW::Assign(this, m_titleText, "title_text"); UIUtilE::Assign(this, m_fileButtonList, "filelist", &err); UIUtilE::Assign(this, m_locationEdit, "location_edit", &err); UIUtilE::Assign(this, m_backButton, "back_button", &err); UIUtilE::Assign(this, m_homeButton, "home_button", &err); UIUtilE::Assign(this, m_okButton, "ok_button", &err); UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'file_selector'"); return false; } if (m_titleText) { switch (m_selectorType) { case FSTYPE_FILE: m_titleText->SetText(tr("Find File")); break; case FSTYPE_DIRECTORY: m_titleText->SetText(tr("Find Directory")); break; default: m_titleText->SetText(tr("Find Files")); break; } } connect(m_okButton, SIGNAL(Clicked()), this, SLOT(OKPressed())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed())); connect(m_locationEdit, SIGNAL(LosingFocus()), this, SLOT(locationEditLostFocus())); m_locationEdit->SetText(m_curDirectory); connect(m_backButton, SIGNAL(Clicked()), this, SLOT(backPressed())); connect(m_homeButton, SIGNAL(Clicked()), this, SLOT(homePressed())); connect(m_fileButtonList, SIGNAL(itemClicked(MythUIButtonListItem *)), this, SLOT(itemClicked(MythUIButtonListItem *))); BuildFocusList(); SetFocusWidget(m_fileButtonList); updateSelectedList(); updateFileList(); return true; }