Skip to content

Commit

Permalink
[stubs] Display requested message when stub files are used and no opt…
Browse files Browse the repository at this point in the history
…ical drive is present
  • Loading branch information
popcornmix committed Apr 3, 2020
1 parent 7b39009 commit 91947fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
10 changes: 1 addition & 9 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -2038,15 +2038,7 @@ msgctxt "#434"
msgid "From {0:s} at {1:d} {2:s}"
msgstr ""

#: xbmc/Application.cpp
msgctxt "#435"
msgid "No optical disc drive detected"
msgstr ""

#: xbmc/Application.cpp
msgctxt "#436"
msgid "You need an optical disc drive to play this video"
msgstr ""
#empty strings from id 435 to 436

msgctxt "#437"
msgid "Removable disk"
Expand Down
17 changes: 15 additions & 2 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2781,10 +2781,23 @@ bool CApplication::PlayFile(CFileItem item, const std::string& player, bool bRes
// Can't do better as CGUIDialogPlayEject calls CMediaManager::IsDiscInDrive, which assumes default DVD drive anyway
return MEDIA_DETECT::CAutorun::PlayDiscAskResume();
}
else
#endif
HELPERS::ShowOKDialogText(CVariant{435}, CVariant{436});

// Figure out Lines 1 and 2 of the dialog
std::string strLine1, strLine2;
CXBMCTinyXML discStubXML;
if (discStubXML.LoadFile(item.GetPath()))
{
TiXmlElement * pRootElement = discStubXML.RootElement();
if (!pRootElement || StringUtils::CompareNoCase(pRootElement->Value(), "discstub") != 0)
CLog::Log(LOGERROR, "Error loading %s, no <discstub> node", item.GetPath().c_str());
else
{
XMLUtils::GetString(pRootElement, "title", strLine1);
XMLUtils::GetString(pRootElement, "message", strLine2);
}
}
HELPERS::ShowOKDialogText(strLine1, strLine2);
return true;
}

Expand Down

0 comments on commit 91947fe

Please sign in to comment.