当前位置: 首页>>代码示例>>C++>>正文


C++ CGUIDialogTextViewer::SetText方法代码示例

本文整理汇总了C++中CGUIDialogTextViewer::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogTextViewer::SetText方法的具体用法?C++ CGUIDialogTextViewer::SetText怎么用?C++ CGUIDialogTextViewer::SetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGUIDialogTextViewer的用法示例。


在下文中一共展示了CGUIDialogTextViewer::SetText方法的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;
}
开发者ID:DrHerbz,项目名称:xbmc,代码行数:32,代码来源:GUIDialogAddonInfo.cpp

示例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);
}
开发者ID:DrHerbz,项目名称:xbmc,代码行数:30,代码来源:GUIDialogAddonInfo.cpp

示例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);
}
开发者ID:louis89,项目名称:xbmc,代码行数:28,代码来源:GUIDialogAddonInfo.cpp

示例4: textviewer

    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();
    }
开发者ID:KeTao,项目名称:kodi-cmake,代码行数:14,代码来源:Dialog.cpp

示例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();
}
开发者ID:micahg,项目名称:xbmc,代码行数:21,代码来源:DialogTextViewer.cpp


注:本文中的CGUIDialogTextViewer::SetText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。