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


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

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


在下文中一共展示了CGUIDialogYesNo::SetText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShowAndGetInput

int CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant text, CVariant noLabel, CVariant yesLabel, CVariant customLabel, unsigned int autoCloseTime)
{
  CGUIDialogYesNo *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO);
  if (!dialog)
    return false;

  dialog->SetHeading(heading);
  dialog->SetText(text);
  if (autoCloseTime)
    dialog->SetAutoClose(autoCloseTime);
  dialog->m_bCanceled = false;
  dialog->m_bCustom = false;
  dialog->SetChoice(0, !noLabel.empty() ? noLabel : 106);
  dialog->SetChoice(1, !yesLabel.empty() ? yesLabel : 107);
  dialog->SetChoice(2, customLabel);  // Button only visible when label is not empty

  dialog->Open();

  if (dialog->m_bCanceled)
    return -1;
  else if (dialog->m_bCustom)
    return 2;
  else if (dialog->IsConfirmed())
    return 1;
  else
    return 0;
}
开发者ID:Arcko,项目名称:xbmc,代码行数:27,代码来源:GUIDialogYesNo.cpp

示例2: OnContextButton

bool CGUIDialogPVRChannelManager::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
  /* Check file item is in list range and get his pointer */
  if (itemNumber < 0 || itemNumber >= (int)m_channelItems->Size()) return false;

  CFileItemPtr pItem = m_channelItems->Get(itemNumber);
  if (!pItem)
    return false;

  if (button == CONTEXT_BUTTON_MOVE)
  {
    m_bMovingMode = true;
    pItem->Select(true);
  }
  else if (button == CONTEXT_BUTTON_SETTINGS)
  {
    PVR_ERROR ret = CServiceBroker::GetPVRManager().Clients()->OpenDialogChannelSettings(pItem->GetPVRChannelInfoTag());
    if (ret == PVR_ERROR_NOT_IMPLEMENTED)
      CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19038}); // "Information", "Not supported by the PVR backend."
    else if (ret != PVR_ERROR_NO_ERROR)
      CGUIDialogOK::ShowAndGetInput(CVariant{2103}, CVariant{16029});  // "Add-on error", "Check the log for more information about this message."
  }
  else if (button == CONTEXT_BUTTON_DELETE)
  {
    CGUIDialogYesNo* pDialog = g_windowManager.GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO);
    if (!pDialog)
      return true;

    pDialog->SetHeading(CVariant{19211}); // Delete channel
    pDialog->SetText(CVariant{750});      // Are you sure?
    pDialog->Open();

    if (pDialog->IsConfirmed())
    {
      CPVRChannelPtr channel = pItem->GetPVRChannelInfoTag();
      PVR_ERROR ret = CServiceBroker::GetPVRManager().Clients()->DeleteChannel(channel);
      if (ret == PVR_ERROR_NO_ERROR)
      {
        CServiceBroker::GetPVRManager().ChannelGroups()->GetGroupAll(channel->IsRadio())->RemoveFromGroup(channel);
        m_channelItems->Remove(m_iSelected);
        m_viewControl.SetItems(*m_channelItems);
        Renumber();
      }
      else if (ret == PVR_ERROR_NOT_IMPLEMENTED)
        CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19038}); // "Information", "Not supported by the PVR backend."
      else
        CGUIDialogOK::ShowAndGetInput(CVariant{2103}, CVariant{16029});  // "Add-on error", "Check the log for more information about this message."
    }
  }
  else if (button == CONTEXT_BUTTON_EDIT_SOURCE)
  {
    std::string strURL = pItem->GetProperty("StreamURL").asString();
    if (CGUIKeyboardFactory::ShowAndGetInput(strURL, CVariant{g_localizeStrings.Get(19214)}, false))
      pItem->SetProperty("StreamURL", strURL);
  }
  return true;
}
开发者ID:Razzeee,项目名称:xbmc,代码行数:57,代码来源:GUIDialogPVRChannelManager.cpp

示例3: OnContextButton

bool CGUIDialogPVRChannelManager::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
  /* Check file item is in list range and get his pointer */
  if (itemNumber < 0 || itemNumber >= (int)m_channelItems->Size()) return false;

  CFileItemPtr pItem = m_channelItems->Get(itemNumber);
  if (!pItem)
    return false;

  if (button == CONTEXT_BUTTON_MOVE)
  {
    m_bMovingMode = true;
    pItem->Select(true);
  }
  else if (button == CONTEXT_BUTTON_SETTINGS)
  {
    if (!g_PVRClients->OpenDialogChannelSettings(pItem->GetPVRChannelInfoTag()))
      CGUIDialogOK::ShowAndGetInput(2103, 0, 16029, 0);  // Add-on error;Check the log file for details.
  }
  else if (button == CONTEXT_BUTTON_DELETE)
  {
    CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
    if (!pDialog)
      return true;

    pDialog->SetHeading(19211); // Delete channel
    pDialog->SetText(750);      // Are you sure?
    pDialog->DoModal();

    if (pDialog->IsConfirmed())
    {
      CPVRChannelPtr channel = pItem->GetPVRChannelInfoTag();
      if (g_PVRClients->DeleteChannel(channel))
      {
        g_PVRChannelGroups->GetGroupAll(channel->IsRadio())->RemoveFromGroup(channel);
        m_channelItems->Remove(m_iSelected);
        m_viewControl.SetItems(*m_channelItems);
        Renumber();
      }
      else
        CGUIDialogOK::ShowAndGetInput(2103, 0, 16029, 0);  // Add-on error;Check the log file for details.
    }
  }
  else if (button == CONTEXT_BUTTON_EDIT_SOURCE)
  {
    std::string strURL = pItem->GetProperty("StreamURL").asString();
    if (CGUIKeyboardFactory::ShowAndGetInput(strURL, g_localizeStrings.Get(19214), false))
      pItem->SetProperty("StreamURL", strURL);
  }
  return true;
}
开发者ID:JamesLinus,项目名称:xbmc,代码行数:51,代码来源:GUIDialogPVRChannelManager.cpp

示例4: ShowAndGetInput

bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant text, bool &bCanceled, CVariant noLabel /* = "" */, CVariant yesLabel /* = "" */, unsigned int autoCloseTime)
{
  CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!dialog)
    return false;

  dialog->SetHeading(heading);
  dialog->SetText(text);
  if (autoCloseTime)
    dialog->SetAutoClose(autoCloseTime);
  dialog->m_bCanceled = false;
  dialog->SetChoice(0, !noLabel.empty() ? noLabel : 106);
  dialog->SetChoice(1, !yesLabel.empty() ? yesLabel : 107);
  dialog->Open();

  bCanceled = dialog->m_bCanceled;
  return (dialog->IsConfirmed()) ? true : false;
}
开发者ID:Greihawk,项目名称:xbmc,代码行数:18,代码来源:GUIDialogYesNo.cpp

示例5: ShowAndGetInput

bool CGUIDialogYesNo::ShowAndGetInput(const std::string& heading, const std::string& text, bool& bCanceled, const std::string& noLabel, const std::string& yesLabel)
{
  CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!dialog) return false;
  dialog->SetHeading(heading);
  dialog->SetText(text);
  dialog->m_bCanceled = false;
  if (!noLabel.empty())
    dialog->SetChoice(0,noLabel);
  else
    dialog->SetChoice(0,106);
  if (!yesLabel.empty())
    dialog->SetChoice(1,yesLabel);
  else
    dialog->SetChoice(1,107);
  dialog->DoModal();
  bCanceled = dialog->m_bCanceled;
  return (dialog->IsConfirmed()) ? true : false;
}
开发者ID:7orlum,项目名称:xbmc,代码行数:19,代码来源:GUIDialogYesNo.cpp


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