Skip to content

Commit

Permalink
Disc stubs: Changes to the displayed title in the dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ScudLee committed Mar 30, 2012
1 parent 7f7f20c commit 247bde1
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions xbmc/dialogs/GUIDialogPlayEject.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -101,30 +101,25 @@ bool CGUIDialogPlayEject::ShowAndGetInput(const CFileItem & item,
if (!pDialog) if (!pDialog)
return false; return false;


// Figure out Line 1 of the dialog // Figure out Lines 1 and 2 of the dialog
CStdString strLine1; CStdString strLine1, strLine2;
if (item.GetVideoInfoTag())
{
strLine1 = item.GetVideoInfoTag()->m_strTitle;
}
else
{
strLine1 = URIUtils::GetFileName(item.GetPath());
URIUtils::RemoveExtension(strLine1);
}

// Figure out Line 2 of the dialog
CStdString strLine2;
TiXmlDocument discStubXML; TiXmlDocument discStubXML;
if (discStubXML.LoadFile(item.GetPath())) if (discStubXML.LoadFile(item.GetPath()))
{ {
TiXmlElement * pRootElement = discStubXML.RootElement(); TiXmlElement * pRootElement = discStubXML.RootElement();
if (!pRootElement || strcmpi(pRootElement->Value(), "discstub") != 0) if (!pRootElement || strcmpi(pRootElement->Value(), "discstub") != 0)
CLog::Log(LOGERROR, "Error loading %s, no <discstub> node", item.GetPath().c_str()); CLog::Log(LOGERROR, "Error loading %s, no <discstub> node", item.GetPath().c_str());
else else
{
XMLUtils::GetString(pRootElement, "title", strLine1);
XMLUtils::GetString(pRootElement, "message", strLine2); XMLUtils::GetString(pRootElement, "message", strLine2);
}
} }


// Use the label for Line 1 if not defined
if (strLine1.IsEmpty())
strLine1 = item.GetLabel();

// Setup dialog parameters // Setup dialog parameters
pDialog->SetHeading(219); pDialog->SetHeading(219);
pDialog->SetLine(0, 429); pDialog->SetLine(0, 429);
Expand Down

0 comments on commit 247bde1

Please sign in to comment.