本文整理汇总了C++中CGUIDialogSelect::GetSelectedLabelText方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogSelect::GetSelectedLabelText方法的具体用法?C++ CGUIDialogSelect::GetSelectedLabelText怎么用?C++ CGUIDialogSelect::GetSelectedLabelText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogSelect
的用法示例。
在下文中一共展示了CGUIDialogSelect::GetSelectedLabelText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBrowse
//.........这里部分代码省略.........
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_ARTIST || m_rule.m_field == CSmartPlaylistRule::FIELD_ALBUMARTIST)
{
if (m_type.Equals("songs") || m_type.Equals("mixed") || m_type.Equals("albums"))
database.GetArtistsNav("musicdb://5/",items,-1,m_rule.m_field == CSmartPlaylistRule::FIELD_ALBUMARTIST);
if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
{
CFileItemList items2;
videodatabase.GetMusicVideoArtistsByName("",items2);
items.Append(items2);
}
iLabel = 557;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_ALBUM)
{
if (m_type.Equals("songs") || m_type.Equals("mixed") || m_type.Equals("albums"))
database.GetAlbumsNav("musicdb://6/",items,-1,-1,-1,-1);
if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
{
CFileItemList items2;
videodatabase.GetMusicVideoAlbumsByName("",items2);
items.Append(items2);
}
iLabel = 558;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_ACTOR)
{
videodatabase.GetActorsNav("",items,type);
iLabel = 20337;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_DIRECTOR)
{
videodatabase.GetDirectorsNav("",items,type);
iLabel = 20339;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_STUDIO)
{
videodatabase.GetStudiosNav("",items,type);
iLabel = 572;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_WRITER)
{
videodatabase.GetWritersNav("",items,type);
iLabel = 20417;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_TVSHOWTITLE)
{
videodatabase.GetTvShowsNav("",items);
iLabel = 20343;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_PLAYLIST)
{
// use filebrowser to grab another smart playlist
// Note: This can cause infinite loops (playlist that refers to the same playlist) but I don't
// think there's any decent way to deal with this, as the infinite loop may be an arbitrary
// number of playlists deep, eg playlist1 -> playlist2 -> playlist3 ... -> playlistn -> playlist1
CStdString path = "special://videoplaylists/";
if (m_type.Equals("songs") || m_type.Equals("albums"))
path = "special://musicplaylists/";
XFILE::CDirectory::GetDirectory(path, items, ".xsp",false,false,XFILE::DIR_CACHE_ONCE,true,true);
iLabel = 559;
}
else if (m_rule.m_field == CSmartPlaylistRule::FIELD_PATH)
{
VECSOURCES sources;
if (m_type == "songs" || m_type == "mixed")
sources = *g_settings.GetSourcesFromType("music");
if (m_type != "songs")
{
VECSOURCES sources2 = *g_settings.GetSourcesFromType("video");
sources.insert(sources.end(),sources2.begin(),sources2.end());
}
g_mediaManager.GetLocalDrives(sources);
CGUIDialogFileBrowser::ShowAndGetDirectory(sources,g_localizeStrings.Get(657),m_rule.m_parameter,false);
UpdateButtons();
return;
}
else
{ // TODO: Add browseability in here.
assert(false);
}
// sort the items
items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC);
CGUIDialogSelect* pDialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDialog->Reset();
pDialog->SetItems(&items);
CStdString strHeading;
strHeading.Format(g_localizeStrings.Get(13401),g_localizeStrings.Get(iLabel));
pDialog->SetHeading(strHeading);
pDialog->DoModal();
if (pDialog->GetSelectedLabel() > -1)
{
m_rule.m_parameter = pDialog->GetSelectedLabelText();
UpdateButtons();
}
pDialog->Reset();
}
示例2: GetSearchResults
//.........这里部分代码省略.........
{
strResult += strSearch[i];
if (!isdigit(strSearch[i]))
break;
}
if (i == 8)
{
return true; // match
}
}
// no match, wipe string
strResult = "";
}
CGUIDialogSelect *pDlgSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
CGUIDialogProgress *pDlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
//do the download
CStdString strURL;
CStdString strXML;
XFILE::CFileCurl httpUtil;
if (pDlgProgress)
{
pDlgProgress->SetHeading(410); //"Accessing Weather.com"
pDlgProgress->SetLine(0, 194); //"Searching"
pDlgProgress->SetLine(1, strSearch);
pDlgProgress->SetLine(2, "");
pDlgProgress->StartModal();
pDlgProgress->Progress();
}
strURL.Format("http://xoap.weather.com/search/search?where=%s", strSearch);
if (!httpUtil.Get(strURL, strXML))
{
if (pDlgProgress)
pDlgProgress->Close();
return false;
}
//some select dialog init stuff
if (!pDlgSelect)
{
if (pDlgProgress)
pDlgProgress->Close();
return false;
}
pDlgSelect->SetHeading(396); //"Select Location"
pDlgSelect->Reset();
///////////////////////////////
// load the xml file
///////////////////////////////
TiXmlDocument xmlDoc;
xmlDoc.Parse(strXML.c_str());
if (xmlDoc.Error())
return false;
TiXmlElement *pRootElement = xmlDoc.RootElement();
if (pRootElement)
{
CStdString strItemTmp;
TiXmlElement *pElement = pRootElement->FirstChildElement("loc");
while (pElement)
{
if (!pElement->NoChildren())
{
strItemTmp.Format("%s - %s", pElement->Attribute("id"), pElement->FirstChild()->Value());
pDlgSelect->Add(strItemTmp);
}
pElement = pElement->NextSiblingElement("loc");
}
}
if (pDlgProgress)
pDlgProgress->Close();
pDlgSelect->EnableButton(true, 222); //'Cancel' button returns to weather settings
pDlgSelect->DoModal();
if (pDlgSelect->GetSelectedLabel() < 0)
{
if (pDlgSelect->IsButtonPressed())
{
pDlgSelect->Close(); //close the select dialog and return to weather settings
return true;
}
}
//copy the selected code into the settings
if (pDlgSelect->GetSelectedLabel() >= 0)
strResult = pDlgSelect->GetSelectedLabelText();
if (pDlgProgress)
pDlgProgress->Close();
return true;
}