本文整理汇总了C++中MythGenericTree::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ MythGenericTree::GetData方法的具体用法?C++ MythGenericTree::GetData怎么用?C++ MythGenericTree::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythGenericTree
的用法示例。
在下文中一共展示了MythGenericTree::GetData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showMenu
void GameUI::showMenu()
{
MythGenericTree *node = m_gameUITree->GetCurrentNode();
MythScreenStack *popupStack = GetMythMainWindow()->
GetStack("popup stack");
MythDialogBox *showMenuPopup =
new MythDialogBox(node->GetText(), popupStack, "showMenuPopup");
if (showMenuPopup->Create())
{
showMenuPopup->SetReturnEvent(this, "showMenuPopup");
showMenuPopup->AddButton(tr("Scan For Changes"));
if (isLeaf(node))
{
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
if (romInfo)
{
showMenuPopup->AddButton(tr("Show Information"));
if (romInfo->Favorite())
showMenuPopup->AddButton(tr("Remove Favorite"));
else
showMenuPopup->AddButton(tr("Make Favorite"));
showMenuPopup->AddButton(tr("Retrieve Details"));
showMenuPopup->AddButton(tr("Edit Details"));
}
}
popupStack->AddScreen(showMenuPopup);
}
else
delete showMenuPopup;
}
示例2: doDeleteVideo
void NetTree::doDeleteVideo(bool remove)
{
if (!remove)
return;
ResultItem *item;
if (m_type == DLG_TREE)
item = qVariantValue<ResultItem *>(m_siteMap->GetCurrentNode()->GetData());
else
{
MythGenericTree *node = GetNodePtrFromButton(m_siteButtonList->GetItemCurrent());
if (!node)
return;
item = qVariantValue<ResultItem *>(node->GetData());
}
if (!item)
return;
QString filename = GetDownloadFilename(item->GetTitle(),
item->GetMediaURL());
if (filename.startsWith("myth://"))
RemoteFile::DeleteFile(filename);
else
{
QFile file(filename);
file.remove();
}
}
示例3: streamWebVideo
void NetTree::streamWebVideo()
{
ResultItem *item;
if (m_type == DLG_TREE)
item = qVariantValue<ResultItem *>(m_siteMap->GetCurrentNode()->GetData());
else
{
MythGenericTree *node = GetNodePtrFromButton(m_siteButtonList->GetItemCurrent());
if (!node)
return;
item = qVariantValue<ResultItem *>(node->GetData());
}
if (!item)
return;
if (!item->GetDownloadable())
{
showWebVideo();
return;
}
GetMythMainWindow()->HandleMedia("Internal", item->GetMediaURL(),
item->GetDescription(), item->GetTitle(), item->GetSubtitle(), QString(),
item->GetSeason(), item->GetEpisode(), QString(), item->GetTime().toInt(),
item->GetDate().toString("yyyy"));
}
示例4: toggleFavorite
void GameUI::toggleFavorite(void)
{
MythGenericTree *node = m_gameUITree->GetCurrentNode();
if (isLeaf(node))
{
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
romInfo->setFavorite(true);
updateChangedNode(node, romInfo);
}
}
示例5: showMenu
void NetTree::showMenu(void)
{
QString label = tr("Playback/Download Options");
MythMenu *menu = new MythMenu(label, this, "options");
ResultItem *item = NULL;
if (m_type == DLG_TREE)
{
MythGenericTree *node = m_siteMap->GetCurrentNode();
if (node)
item = qVariantValue<ResultItem *>(node->GetData());
}
else
{
MythGenericTree *node = GetNodePtrFromButton(m_siteButtonList->GetItemCurrent());
if (node)
item = qVariantValue<ResultItem *>(node->GetData());
}
if (item)
{
if (item->GetDownloadable())
menu->AddItem(tr("Stream Video"), SLOT(streamWebVideo()));
menu->AddItem(tr("Open Web Link"), SLOT(showWebVideo()));
if (item->GetDownloadable())
menu->AddItem(tr("Save This Video"), SLOT(doDownloadAndPlay()));
}
menu->AddItem(tr("Scan/Manage Subscriptions"), NULL, createShowManageMenu());
menu->AddItem(tr("Change View"), NULL, createShowViewMenu());
MythDialogBox *menuPopup = new MythDialogBox(menu, m_popupStack, "mythnettreemenupopup");
if (menuPopup->Create())
m_popupStack->AddScreen(menuPopup);
else
delete menuPopup;
}
示例6: OnGameSearchDone
void GameUI::OnGameSearchDone(MetadataLookup *lookup)
{
if (m_busyPopup)
{
m_busyPopup->Close();
m_busyPopup = NULL;
}
if (!lookup)
return;
MythGenericTree *node = qVariantValue<MythGenericTree *>(lookup->GetData());
if (!node)
return;
RomInfo *metadata = qVariantValue<RomInfo *>(node->GetData());
if (!metadata)
return;
metadata->setGamename(lookup->GetTitle());
metadata->setYear(QString::number(lookup->GetYear()));
metadata->setPlot(lookup->GetDescription());
metadata->setSystem(lookup->GetSystem());
QStringList coverart, fanart, screenshot;
// Imagery
ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart);
for (ArtworkList::const_iterator p = coverartlist.begin();
p != coverartlist.end(); ++p)
{
coverart.prepend((*p).url);
}
ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart);
for (ArtworkList::const_iterator p = fanartlist.begin();
p != fanartlist.end(); ++p)
{
fanart.prepend((*p).url);
}
ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot);
for (ArtworkList::const_iterator p = screenshotlist.begin();
p != screenshotlist.end(); ++p)
{
screenshot.prepend((*p).url);
}
StartGameImageSet(node, coverart, fanart, screenshot);
metadata->SaveToDatabase();
updateChangedNode(node, metadata);
}
示例7:
/** \fn GalleryViewHelper::GetImageMetadataFromSelectedNode()
* \brief Returns the data selected node
* \return ImageMetadata
*/
ImageMetadata *GalleryViewHelper::GetImageMetadataFromSelectedNode()
{
if (!m_currentNode)
return NULL;
MythGenericTree *node = m_currentNode->getSelectedChild();
if (!node)
return NULL;
ImageMetadata *im = node->GetData().value<ImageMetadata *>();
if (!im)
return NULL;
return im;
}
示例8:
/** \fn GalleryView::GetImageMetadataFromButton(MythUIButtonListItem *)
* \brief Returns the data of the given image list item
* \param item The given image list item
* \return ImageMetadata
*/
ImageMetadata *GalleryView::GetImageMetadataFromButton(MythUIButtonListItem *item)
{
if (!item)
return NULL;
MythGenericTree *node = item->GetData().value<MythGenericTree *>();
if (!node)
return NULL;
ImageMetadata *data = node->GetData().value<ImageMetadata *>();
if (!data)
return NULL;
return data;
}
示例9:
/** \fn GalleryViewHelper::GetImageMetadataFromNode(int)
* \brief Returns the data of the given node id
* \param id The specified node id that shall be used
* \return ImageMetadata
*/
ImageMetadata *GalleryViewHelper::GetImageMetadataFromNode(int i)
{
if (!m_currentNode)
return NULL;
MythGenericTree *node = m_currentNode->getChildAt(i);
if (!node)
return NULL;
ImageMetadata *im = qVariantValue<ImageMetadata *>(node->GetData());
if (!im)
return NULL;
return im;
}
示例10: doPlayVideo
void NetTree::doPlayVideo(QString filename)
{
ResultItem *item;
if (m_type == DLG_TREE)
item = qVariantValue<ResultItem *>(m_siteMap->GetCurrentNode()->GetData());
else
{
MythGenericTree *node = GetNodePtrFromButton(m_siteButtonList->GetItemCurrent());
if (!node)
return;
item = qVariantValue<ResultItem *>(node->GetData());
}
if (!item)
return;
GetMythMainWindow()->HandleMedia("Internal", filename);
}
示例11: showInfo
void GameUI::showInfo()
{
MythGenericTree *node = m_gameUITree->GetCurrentNode();
if (isLeaf(node))
{
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
if (!romInfo)
return;
MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
GameDetailsPopup *details_dialog =
new GameDetailsPopup(mainStack, romInfo);
if (details_dialog->Create())
{
mainStack->AddScreen(details_dialog);
details_dialog->SetReturnEvent(this, "detailsPopup");
}
else
delete details_dialog;
}
}
示例12: edit
void GameUI::edit(void)
{
MythGenericTree *node = m_gameUITree->GetCurrentNode();
if (isLeaf(node))
{
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
MythScreenStack *screenStack = GetScreenStack();
EditRomInfoDialog *md_editor = new EditRomInfoDialog(screenStack,
"mythgameeditmetadata", romInfo);
if (md_editor->Create())
{
screenStack->AddScreen(md_editor);
md_editor->SetReturnEvent(this, "editMetadata");
}
else
delete md_editor;
}
}
示例13: itemClicked
void GameUI::itemClicked(MythUIButtonListItem*)
{
MythGenericTree *node = m_gameUITree->GetCurrentNode();
if (isLeaf(node))
{
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
if (!romInfo)
return;
if (romInfo->RomCount() == 1)
{
GameHandler::Launchgame(romInfo, NULL);
}
else
{
//: %1 is the game name
QString msg = QString(tr("Choose System for:\n%1"))
.arg(node->getString());
MythScreenStack *popupStack = GetMythMainWindow()->
GetStack("popup stack");
MythDialogBox *chooseSystemPopup = new MythDialogBox(
msg, popupStack, "chooseSystemPopup");
if (chooseSystemPopup->Create())
{
chooseSystemPopup->SetReturnEvent(this, "chooseSystemPopup");
QString all_systems = romInfo->AllSystems();
QStringList players = all_systems.split(",");
for (QStringList::Iterator it = players.begin();
it != players.end(); ++it)
{
chooseSystemPopup->AddButton(*it);
}
chooseSystemPopup->AddButton(tr("Cancel"));
popupStack->AddScreen(chooseSystemPopup);
}
else
delete chooseSystemPopup;
}
}
}
示例14: doDownloadAndPlay
void NetTree::doDownloadAndPlay()
{
ResultItem *item;
if (m_type == DLG_TREE)
item = qVariantValue<ResultItem *>(m_siteMap->GetCurrentNode()->GetData());
else
{
MythGenericTree *node = GetNodePtrFromButton(m_siteButtonList->GetItemCurrent());
if (!node)
return;
item = qVariantValue<ResultItem *>(node->GetData());
}
if (!item)
return;
QString baseFilename = GetDownloadFilename(item->GetTitle(),
item->GetMediaURL());
QString finalFilename = generate_file_url("Default",
gCoreContext->GetMasterHostName(),
baseFilename);
LOG(VB_GENERAL, LOG_INFO, QString("Downloading %1 to %2")
.arg(item->GetMediaURL()) .arg(finalFilename));
// Does the file already exist?
bool exists = RemoteFile::Exists(finalFilename);
if (exists)
{
doPlayVideo(finalFilename);
return;
}
else
DownloadVideo(item->GetMediaURL(), baseFilename);
}
示例15: handleDownloadedImages
void GameUI::handleDownloadedImages(MetadataLookup *lookup)
{
if (!lookup)
return;
MythGenericTree *node = qVariantValue<MythGenericTree *>(lookup->GetData());
if (!node)
return;
RomInfo *metadata = qVariantValue<RomInfo *>(node->GetData());
if (!metadata)
return;
DownloadMap downloads = lookup->GetDownloads();
if (downloads.isEmpty())
return;
for (DownloadMap::iterator i = downloads.begin();
i != downloads.end(); ++i)
{
VideoArtworkType type = i.key();
ArtworkInfo info = i.value();
QString filename = info.url;
if (type == kArtworkCoverart)
metadata->setBoxart(filename);
else if (type == kArtworkFanart)
metadata->setFanart(filename);
else if (type == kArtworkScreenshot)
metadata->setScreenshot(filename);
}
metadata->SaveToDatabase();
updateChangedNode(node, metadata);
}