本文整理汇总了C++中CGUIDialogTextViewer类的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogTextViewer类的具体用法?C++ CGUIDialogTextViewer怎么用?C++ CGUIDialogTextViewer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGUIDialogTextViewer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnChangeLog
void CGUIDialogAddonInfo::OnChangeLog()
{
CGUIDialogTextViewer* pDlgInfo = (CGUIDialogTextViewer*)g_windowManager.GetWindow(WINDOW_DIALOG_TEXT_VIEWER);
CStdString name;
if (m_addon)
name = m_addon->Name();
else if (m_localAddon)
name = m_localAddon->Name();
pDlgInfo->SetHeading(g_localizeStrings.Get(24054)+" - "+name);
if (m_item->GetProperty("Addon.Changelog").empty())
{
pDlgInfo->SetText(g_localizeStrings.Get(13413));
CFileItemList items;
if (m_localAddon &&
!m_item->GetProperty("Addon.UpdateAvail").asBoolean())
{
items.Add(CFileItemPtr(new CFileItem(m_localAddon->ChangeLog(),false)));
}
else
items.Add(CFileItemPtr(new CFileItem(m_addon->ChangeLog(),false)));
items[0]->Select(true);
m_jobid = CJobManager::GetInstance().AddJob(
new CFileOperationJob(CFileOperationJob::ActionCopy,items,
"special://temp/"),this);
}
else
pDlgInfo->SetText(m_item->GetProperty("Addon.Changelog").asString());
m_changelog = true;
pDlgInfo->DoModal();
m_changelog = false;
}
示例2: OnJobComplete
void CGUIDialogAddonInfo::OnJobComplete(unsigned int jobID, bool success,
CJob* job)
{
if (!m_changelog)
return;
CGUIDialogTextViewer* pDlgInfo = (CGUIDialogTextViewer*)g_windowManager.GetWindow(WINDOW_DIALOG_TEXT_VIEWER);
m_jobid = 0;
if (!success)
{
pDlgInfo->SetText(g_localizeStrings.Get(195));
}
else
{
CFile file;
if (file.Open("special://temp/"+
URIUtils::GetFileName(((CFileOperationJob*)job)->GetItems()[0]->GetPath())))
{
char* temp = new char[(size_t)file.GetLength()+1];
file.Read(temp,file.GetLength());
temp[file.GetLength()] = '\0';
m_item->SetProperty("Addon.Changelog",temp);
pDlgInfo->SetText(temp);
delete[] temp;
}
}
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, WINDOW_DIALOG_TEXT_VIEWER, 0, GUI_MSG_UPDATE);
g_windowManager.SendThreadMessage(msg);
}
示例3: OnJobComplete
void CGUIDialogAddonInfo::OnJobComplete(unsigned int jobID, bool success,
CJob* job)
{
if (!m_changelog)
return;
CGUIDialogTextViewer* pDlgInfo = (CGUIDialogTextViewer*)g_windowManager.GetWindow(WINDOW_DIALOG_TEXT_VIEWER);
m_jobid = 0;
if (!success)
{
pDlgInfo->SetText(g_localizeStrings.Get(195));
}
else
{
CFile file;
XFILE::auto_buffer buf;
if (file.LoadFile("special://temp/" +
URIUtils::GetFileName(((CFileOperationJob*)job)->GetItems()[0]->GetPath()), buf) > 0)
{
std::string str(buf.get(), buf.length());
m_item->SetProperty("Addon.Changelog", str);
pDlgInfo->SetText(str);
}
}
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, WINDOW_DIALOG_TEXT_VIEWER, 0, GUI_MSG_UPDATE);
g_windowManager.SendThreadMessage(msg);
}
示例4: dcguard
void Dialog::textviewer(const String& heading, const String& text)
{
DelayedCallGuard dcguard(languageHook);
const int window = WINDOW_DIALOG_TEXT_VIEWER;
CGUIDialogTextViewer* pDialog = (CGUIDialogTextViewer*)g_windowManager.GetWindow(window);
if (pDialog == NULL)
throw WindowException("Error: Window is NULL, this is not possible :-)");
if (!heading.empty())
pDialog->SetHeading(heading);
if (!text.empty())
pDialog->SetText(text);
pDialog->Open();
}
示例5: open
void Interface_GUIDialogTextViewer::open(void* kodiBase, const char *heading, const char *text)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (!addon)
{
CLog::Log(LOGERROR, "Interface_GUIDialogTextViewer::%s - invalid data", __FUNCTION__);
return;
}
CGUIDialogTextViewer* dialog = g_windowManager.GetWindow<CGUIDialogTextViewer>(WINDOW_DIALOG_TEXT_VIEWER);
if (!heading || !text || !dialog)
{
CLog::Log(LOGERROR, "Interface_GUIDialogTextViewer::%s - invalid handler data (heading='%p', text='%p', dialog='%p') on addon '%s'", __FUNCTION__,
heading, text, dialog, addon->ID().c_str());
return;
}
dialog->SetHeading(heading);
dialog->SetText(text);
dialog->Open();
}