void GameUI::searchStart(void) { MythGenericTree *parent = m_gameUITree->GetCurrentNode()->getParent(); if (parent != NULL) { QStringList childList; QList<MythGenericTree*>::iterator it; QList<MythGenericTree*> *children = parent->getAllChildren(); for (it = children->begin(); it != children->end(); ++it) { MythGenericTree *child = *it; childList << child->GetText(); } MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUISearchDialog *searchDialog = new MythUISearchDialog(popupStack, tr("Game Search"), childList, true, ""); if (searchDialog->Create()) { connect(searchDialog, SIGNAL(haveResult(QString)), SLOT(searchComplete(QString))); popupStack->AddScreen(searchDialog); } else delete searchDialog; } }
void EditMetadataDialog::searchGenre() { QString msg = tr("Select a Genre"); QStringList searchList = Metadata::fillFieldList("genre"); // load genre list /* searchList.clear(); for (int x = 0; x < genre_table_size; x++) searchList.push_back(QString(genre_table[x])); searchList.sort(); */ QString s = m_metadata->Genre(); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUISearchDialog *searchDlg = new MythUISearchDialog(popupStack, msg, searchList, false, s); if (!searchDlg->Create()) { delete searchDlg; return; } connect(searchDlg, SIGNAL(haveResult(QString)), SLOT(setGenre(QString))); popupStack->AddScreen(searchDlg); }
void Ripper::searchAlbum() { QString msg = tr("Select an Album"); QStringList searchList = MusicMetadata::fillFieldList("album"); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUISearchDialog *searchDlg = new MythUISearchDialog(popupStack, msg, searchList, false, ""); if (!searchDlg->Create()) { delete searchDlg; return; } connect(searchDlg, SIGNAL(haveResult(QString)), SLOT(setAlbum(QString))); popupStack->AddScreen(searchDlg); }
void ImportNative::showList(const QString &caption, QString &value, const char *slot) { MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUISearchDialog *searchDialog = new MythUISearchDialog(popupStack, caption, m_searchList, true, value); if (!searchDialog->Create()) { delete searchDialog; searchDialog = NULL; return; } connect(searchDialog, SIGNAL(haveResult(QString)), this, slot); popupStack->AddScreen(searchDialog); }
void EditMetadataDialog::searchCompilationArtist() { QString msg = tr("Select a Compilation Artist"); QStringList searchList = Metadata::fillFieldList("compilation_artist"); QString s = m_metadata->CompilationArtist(); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUISearchDialog *searchDlg = new MythUISearchDialog(popupStack, msg, searchList, false, s); if (!searchDlg->Create()) { delete searchDlg; return; } connect(searchDlg, SIGNAL(haveResult(QString)), SLOT(setCompArtist(QString))); popupStack->AddScreen(searchDlg); }
void Ripper::chooseBackend(void) { QStringList hostList; // get a list of hosts with a directory defined for the 'Music' storage group MSqlQuery query(MSqlQuery::InitCon()); QString sql = "SELECT DISTINCT hostname " "FROM storagegroup " "WHERE groupname = 'Music'"; if (!query.exec(sql) || !query.isActive()) MythDB::DBError("Ripper::chooseBackend get host list", query); else { while(query.next()) { hostList.append(query.value(0).toString()); } } if (hostList.isEmpty()) { LOG(VB_GENERAL, LOG_ERR, "Ripper::chooseBackend: No backends found"); return; } QString msg = tr("Select where to save tracks"); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUISearchDialog *searchDlg = new MythUISearchDialog(popupStack, msg, hostList, false, ""); if (!searchDlg->Create()) { delete searchDlg; return; } connect(searchDlg, SIGNAL(haveResult(QString)), SLOT(setSaveHost(QString))); popupStack->AddScreen(searchDlg); }