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


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

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


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

示例1: StartRecordFile

bool CGUIWindowPVRBase::StartRecordFile(const CFileItem &item)
{
  if (!item.HasEPGInfoTag())
    return false;

  const CEpgInfoTag *tag = item.GetEPGInfoTag();
  CPVRChannelPtr channel;
  if (tag)
    channel = tag->ChannelTag();

  if (!channel || !g_PVRManager.CheckParentalLock(*channel))
    return false;

  CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(&item);
  if (timer && timer->HasPVRTimerInfoTag())
  {
    CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
    return false;
  }

  // ask for confirmation before starting a timer
  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!pDialog)
    return false;
  pDialog->SetHeading(264);
  pDialog->SetLine(0, tag->PVRChannelName());
  pDialog->SetLine(1, "");
  pDialog->SetLine(2, tag->Title());
  pDialog->DoModal();

  if (!pDialog->IsConfirmed())
    return false;

  CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
  bool bReturn(false);
  if (newTimer)
  {
    bReturn = g_PVRTimers->AddTimer(*newTimer);
    delete newTimer;
  }
  return bReturn;
}
开发者ID:Robertof,项目名称:xbmc,代码行数:42,代码来源:GUIWindowPVRBase.cpp

示例2: ShowAndGetInput

bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, 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->SetLine(0, line0);
  dialog->SetLine(1, line1);
  dialog->SetLine(2, line2);
  if (autoCloseTime)
    dialog->SetAutoClose(autoCloseTime);
  dialog->SetChoice(0, !noLabel.empty() ? noLabel : 106);
  dialog->SetChoice(1, !yesLabel.empty() ? yesLabel : 107);
  dialog->m_bCanceled = false;
  dialog->Open();

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

示例3: ActionRecord

bool CGUIWindowPVRCommon::ActionRecord(CFileItem *item)
{
  bool bReturn = false;

  CEpgInfoTag *epgTag = item->GetEPGInfoTag();
  if (!epgTag)
    return bReturn;

  if (!epgTag->HasPVRChannel())
    return bReturn;

  if (epgTag->Timer() == NULL)
  {
    /* create a confirmation dialog */
    CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
    if (!pDialog)
      return bReturn;

    pDialog->SetHeading(264);
    pDialog->SetLine(0, "");
    pDialog->SetLine(1, epgTag->Title());
    pDialog->SetLine(2, "");
    pDialog->DoModal();

    /* prompt for the user's confirmation */
    if (!pDialog->IsConfirmed())
      return bReturn;

    CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*epgTag);
    CFileItem *item = new CFileItem(*newtimer);

    bReturn = g_PVRTimers->AddTimer(*item);
  }
  else
  {
    CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
    bReturn = true;
  }

  return bReturn;
}
开发者ID:Omel,项目名称:xbmc,代码行数:41,代码来源:GUIWindowPVRCommon.cpp

示例4: OnContextButtonDeleteAll

bool CGUIWindowPVRRecordings::OnContextButtonDeleteAll(CFileItem *item, CONTEXT_BUTTON button)
{
  bool bReturn = false;

  if (button != CONTEXT_BUTTON_DELETE_ALL || !item->IsDeletedPVRRecording())
    return bReturn;

  /* show a confirmation dialog */
  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!pDialog)
    return bReturn;


  pDialog->SetHeading(CVariant{19292}); // Delete all permanently
  pDialog->SetLine(0, CVariant{19293}); // Delete all recordings permanently?
  pDialog->SetLine(1, CVariant{""});
  pDialog->SetLine(2, CVariant{""});
  pDialog->SetChoice(1, CVariant{117}); // Delete

  /* prompt for the user's confirmation */
  pDialog->Open();
  if (!pDialog->IsConfirmed())
    return bReturn;

  /* undelete the recording */
  if (g_PVRRecordings->DeleteAllRecordingsFromTrash())
  {
    g_PVRManager.TriggerRecordingsUpdate();
    bReturn = true;

    /* remove the item from the list immediately, otherwise the
    item count further down may be wrong */
    m_vecItems->Clear();

    /* go to the parent folder if we're in a subdirectory and just deleted the last item */
    CPVRRecordingsPath path(m_vecItems->GetPath());
    if (path.IsValid() && !path.IsRecordingsRoot() && m_vecItems->GetObjectCount() == 0)
      GoParentFolder();
  }
  return bReturn;
}
开发者ID:Almarefa,项目名称:xbmc,代码行数:41,代码来源:GUIWindowPVRRecordings.cpp

示例5: ShowAndGetInput

bool CGUIDialogYesNo::ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, bool& bCanceled, const CStdString& noLabel, const CStdString& yesLabel)
{
  CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!dialog) return false;
  dialog->SetHeading(heading);
  dialog->SetLine(0, line0);
  dialog->SetLine(1, line1);
  dialog->SetLine(2, line2);
  dialog->m_bCanceled = false;
  if (!noLabel.IsEmpty())
    dialog->SetChoice(0,noLabel);
  else
    dialog->SetChoice(0,106);
  if (!yesLabel.IsEmpty())
    dialog->SetChoice(1,yesLabel);
  else
    dialog->SetChoice(1,107);
  dialog->DoModal();
  bCanceled = dialog->m_bCanceled;
  return (dialog->IsConfirmed()) ? true : false;
}
开发者ID:A600,项目名称:xbmc,代码行数:21,代码来源:GUIDialogYesNo.cpp

示例6: StartRecordFile

bool CGUIWindowPVRCommon::StartRecordFile(CFileItem *item)
{
  bool bReturn = false;

  if (!item->HasEPGInfoTag())
    return bReturn;

  CPVREpgInfoTag *tag = (CPVREpgInfoTag *) item->GetEPGInfoTag();
  if (!tag || !tag->ChannelTag() || tag->ChannelTag()->ChannelNumber() <= 0)
    return bReturn;

  CPVRTimerInfoTag *timer = CPVRManager::GetTimers()->GetMatch(item);
  if (timer)
  {
    CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
    return bReturn;
  }

  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!pDialog)
    return bReturn;
  pDialog->SetHeading(264);
  pDialog->SetLine(0, tag->ChannelTag()->ChannelName());
  pDialog->SetLine(1, "");
  pDialog->SetLine(2, tag->Title());
  pDialog->DoModal();

  if (!pDialog->IsConfirmed())
    return bReturn;

  CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
  CFileItem *newTimerItem = new CFileItem(*newtimer);
  if (CPVRManager::GetTimers()->AddTimer(*newTimerItem))
  {
    CPVRManager::GetTimers()->Update();
    bReturn = true;
  }

  return bReturn;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:40,代码来源:GUIWindowPVRCommon.cpp

示例7: ActionStartTimer

bool CGUIDialogPVRGuideInfo::ActionStartTimer(const CEpgInfoTag *tag)
{
  bool bReturn = false;

  if (!tag)
    return false;

  CPVRChannelPtr channel = tag->ChannelTag();
  if (!channel || !g_PVRManager.CheckParentalLock(*channel))
    return false;

  // prompt user for confirmation of channel record
  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);

  if (pDialog)
  {
    pDialog->SetHeading(264);
    pDialog->SetLine(0, "");
    pDialog->SetLine(1, tag->Title());
    pDialog->SetLine(2, "");
    pDialog->DoModal();

    if (pDialog->IsConfirmed())
    {
      Close();
      CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
      if (newTimer)
      {
        bReturn = CPVRTimers::AddTimer(*newTimer);
        delete newTimer;
      }
      else
      {
        bReturn = false;
      }
    }
  }

  return bReturn;
}
开发者ID:2BReality,项目名称:xbmc,代码行数:40,代码来源:GUIDialogPVRGuideInfo.cpp

示例8: ActionDeleteRecording

bool CGUIWindowPVRRecordings::ActionDeleteRecording(CFileItem *item)
{
  bool bReturn = false;

  if (!item->IsPVRRecording() && !item->m_bIsFolder)
    return bReturn;

  /* show a confirmation dialog */
  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!pDialog)
    return bReturn;

  pDialog->SetHeading(122); // Confirm delete
  pDialog->SetLine(0, item->m_bIsFolder ? 19113 : 19112); // Are you sure?
  pDialog->SetLine(1, "");
  pDialog->SetLine(2, item->GetLabel());
  pDialog->SetChoice(1, 117); // Delete

  /* prompt for the user's confirmation */
  pDialog->DoModal();
  if (!pDialog->IsConfirmed())
    return bReturn;

  /* delete the recording */
  if (g_PVRRecordings->Delete(*item))
  {
    g_PVRManager.TriggerRecordingsUpdate();
    bReturn = true;

    /* remove the item from the list immediately, otherwise the
    item count further down may be wrong */
    m_vecItems->Remove(item);

    /* go to the parent folder if we're in a subdirectory and just deleted the last item */
    if (m_vecItems->GetPath() != "pvr://recordings/" && m_vecItems->GetObjectCount() == 0)
      GoParentFolder();
  }

  return bReturn;
}
开发者ID:Jmend25,项目名称:boxeebox-xbmc,代码行数:40,代码来源:GUIWindowPVRRecordings.cpp

示例9: ShowAndGetInput

bool CGUIDialogYesNo::ShowAndGetInput(int heading, int line0, int line1, int line2, int iNoLabel, int iYesLabel, bool& bCanceled, unsigned int autoCloseTime)
{
  CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!dialog) return false;
  dialog->SetHeading(heading);
  dialog->SetLine(0, line0);
  dialog->SetLine(1, line1);
  dialog->SetLine(2, line2);
  if (autoCloseTime)
    dialog->SetAutoClose(autoCloseTime);
  if (iNoLabel != -1)
    dialog->SetChoice(0,iNoLabel);
  else
    dialog->SetChoice(0,106);
  if (iYesLabel != -1)
    dialog->SetChoice(1,iYesLabel);
  else
    dialog->SetChoice(1,107);
  dialog->m_bCanceled = false;
  dialog->DoModal();
  bCanceled = dialog->m_bCanceled;
  return (dialog->IsConfirmed()) ? true : false;
}
开发者ID:7orlum,项目名称:xbmc,代码行数:23,代码来源:GUIDialogYesNo.cpp

示例10: ActionDeleteTimer

bool CGUIWindowPVRCommon::ActionDeleteTimer(CFileItem *item)
{
  /* check if the timer tag is valid */
  CPVRTimerInfoTag *timerTag = item->GetPVRTimerInfoTag();
  if (!timerTag || timerTag->m_iClientIndex < 0)
    return false;

  /* show a confirmation dialog */
  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!pDialog)
    return false;
  pDialog->SetHeading(122);
  pDialog->SetLine(0, 19040);
  pDialog->SetLine(1, "");
  pDialog->SetLine(2, timerTag->m_strTitle);
  pDialog->DoModal();

  /* prompt for the user's confirmation */
  if (!pDialog->IsConfirmed())
    return false;

  /* delete the timer */
  return g_PVRTimers->DeleteTimer(*item);
}
开发者ID:Omel,项目名称:xbmc,代码行数:24,代码来源:GUIWindowPVRCommon.cpp

示例11: ActionCancelTimer

bool CGUIDialogPVRGuideInfo::ActionCancelTimer(const CPVRTimerInfoTag *tag)
{
  bool bReturn = false;

  // prompt user for confirmation of timer deletion
  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);

  if (pDialog)
  {
    pDialog->SetHeading(265);
    pDialog->SetLine(0, "");
    pDialog->SetLine(1, tag->m_strTitle);
    pDialog->SetLine(2, "");
    pDialog->DoModal();

    if (pDialog->IsConfirmed())
    {
      Close();
      bReturn = CPVRTimers::DeleteTimer(*tag);
    }
  }

  return bReturn;
}
开发者ID:SirTomselon,项目名称:xbmc,代码行数:24,代码来源:GUIDialogPVRGuideInfo.cpp

示例12: PlayFile

bool CGUIWindowPVRBase::PlayFile(CFileItem *item, bool bPlayMinimized /* = false */, bool bCheckResume /* = true */)
{
  if (item->m_bIsFolder)
  {
    return false;
  }

  CPVRChannelPtr channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : CPVRChannelPtr();
  if (item->GetPath() == g_application.CurrentFile() ||
      (channel && channel->HasRecording() && channel->GetRecording()->GetPath() == g_application.CurrentFile()))
  {
    CGUIMessage msg(GUI_MSG_FULLSCREEN, 0, GetID());
    g_windowManager.SendMessage(msg);
    return true;
  }

  CMediaSettings::GetInstance().SetVideoStartWindowed(bPlayMinimized);

  if (item->HasPVRRecordingInfoTag())
  {
    return PlayRecording(item, bPlayMinimized, bCheckResume);
  }
  else
  {
    bool bSwitchSuccessful(false);
    CPVRChannelPtr channel(item->GetPVRChannelInfoTag());

    if (channel && g_PVRManager.CheckParentalLock(channel))
    {
      CPVRRecordingPtr recording = channel->GetRecording();
      if (recording)
      {
        CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
        if (pDialog)
        {
          pDialog->SetHeading(CVariant{19687}); // Play recording
          pDialog->SetLine(0, CVariant{""});
          pDialog->SetLine(1, CVariant{12021}); // Start from beginning
          pDialog->SetLine(2, CVariant{recording->m_strTitle});
          pDialog->Open();

          if (pDialog->IsConfirmed())
          {
            CFileItem recordingItem(recording);
            return PlayRecording(&recordingItem, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRPLAYBACK_PLAYMINIMIZED), bCheckResume);
          }
        }
      }

      /* try a fast switch */
      if ((g_PVRManager.IsPlayingTV() || g_PVRManager.IsPlayingRadio()) &&
         (channel->IsRadio() == g_PVRManager.IsPlayingRadio()))
      {
        if (channel->StreamURL().empty())
          bSwitchSuccessful = g_application.m_pPlayer->SwitchChannel(channel);
      }

      if (!bSwitchSuccessful)
      {
        CApplicationMessenger::GetInstance().PostMsg(TMSG_MEDIA_PLAY, 0, 0, static_cast<void*>(new CFileItem(*item)));
        return true;
      }
    }

    if (!bSwitchSuccessful)
    {
      std::string channelName = g_localizeStrings.Get(19029); // Channel
      if (channel)
        channelName = channel->ChannelName();
      std::string msg = StringUtils::Format(g_localizeStrings.Get(19035).c_str(), channelName.c_str()); // CHANNELNAME could not be played. Check the log for details.

      CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error,
              g_localizeStrings.Get(19166), // PVR information
              msg);
      return false;
    }
  }

  return true;
}
开发者ID:MrMC,项目名称:mrmc,代码行数:80,代码来源:GUIWindowPVRBase.cpp

示例13: OnMessage

bool CGUIDialogPVRGuideInfo::OnMessage(CGUIMessage& message)
{
  switch (message.GetMessage())
  {
  case GUI_MSG_WINDOW_INIT:
    {
      CGUIDialog::OnMessage(message);
      Update();
      break;
    }
  case GUI_MSG_CLICKED:
    {
      int iControl = message.GetSenderId();
      if (iControl == CONTROL_BTN_OK)
      {
        Close();
        return true;
      }
      else if (iControl == CONTROL_BTN_RECORD)
      {
        if (((CPVREpgInfoTag *)m_progItem->GetEPGInfoTag())->ChannelTag()->ChannelNumber() > 0)
        {
          if (((CPVREpgInfoTag *) m_progItem->GetEPGInfoTag())->Timer() == NULL)
          {
            // prompt user for confirmation of channel record
            CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);

            if (pDialog)
            {
              pDialog->SetHeading(264);
              pDialog->SetLine(0, "");
              pDialog->SetLine(1, m_progItem->GetEPGInfoTag()->Title());
              pDialog->SetLine(2, "");
              pDialog->DoModal();

              if (pDialog->IsConfirmed())
              {
                CPVREpgInfoTag *tag = (CPVREpgInfoTag *) m_progItem->GetEPGInfoTag();
                CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
                CFileItem *item = new CFileItem(*newtimer);
                CPVRTimers::AddTimer(*item);
              }
            }
          }
          else
          {
            CGUIDialogOK::ShowAndGetInput(19033,19067,0,0);
          }
        }
        Close();
        return true;
      }
      else if (iControl == CONTROL_BTN_SWITCH)
      {
        Close();

        if (!g_application.PlayFile(CFileItem(*((CPVREpgInfoTag *)m_progItem->GetEPGInfoTag())->ChannelTag())))
        {
          CGUIDialogOK::ShowAndGetInput(19033,0,19035,0);
          return false;
        }
        return true;
      }
    }
  }

  return CGUIDialog::OnMessage(message);
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:68,代码来源:GUIDialogPVRGuideInfo.cpp

示例14: CacheRarredFile

bool CRarManager::CacheRarredFile(CStdString& strPathInCache, const CStdString& strRarPath, const CStdString& strPathInRar, BYTE  bOptions, const CStdString& strDir, const int64_t iSize)
{
#ifdef HAS_FILESYSTEM_RAR
  CSingleLock lock(m_CritSection);

  //If file is listed in the cache, then use listed copy or cleanup before overwriting.
  bool bOverwrite = (bOptions & EXFILE_OVERWRITE) != 0;
  map<CStdString, pair<ArchiveList_struct*,vector<CFileInfo> > >::iterator j = m_ExFiles.find( strRarPath );
  CFileInfo* pFile=NULL;
  if( j != m_ExFiles.end() )
  {
    pFile = GetFileInRar(strRarPath,strPathInRar);
    if (pFile)
    {
      if (pFile->m_bIsCanceled())
        return false;

      if( CFile::Exists( pFile->m_strCachedPath) )
      {
        if( !bOverwrite )
        {
          strPathInCache = pFile->m_strCachedPath;
          pFile->m_iUsed++;
          return true;
        }

        CFile::Delete(pFile->m_strCachedPath);
        pFile->m_iUsed++;
      }
    }
  }

  int iRes = 0;
  if (iSize > EXTRACTION_WARN_SIZE)
  {
    CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
    if (pDialog)
    {
      pDialog->SetHeading(120);
      pDialog->SetLine(0, 645);
      pDialog->SetLine(1, URIUtils::GetFileName(strPathInRar));
      pDialog->SetLine(2, "");
      pDialog->DoModal();
      if (!pDialog->IsConfirmed())
        iRes = 2; // pretend to be canceled
    }
  }
  if (CheckFreeSpace(strDir) < iSize && iRes != 2)
  {
    ClearCache();
    if (CheckFreeSpace(strDir) < iSize)
    {
      CFileItemList items;
      CDirectory::GetDirectory(g_advancedSettings.m_cachePath,items);
      items.Sort(SortBySize, SortOrderDescending);
      while (items.Size() && CheckFreeSpace(strDir) < iSize)
      {
        if (!items[0]->m_bIsFolder)
          if (!CFile::Delete(items[0]->GetPath()))
            break;

        items.Remove(0);
      }
      if (!items.Size())
        return false;
    }
  }

  CStdString strPath = strPathInRar;
#ifndef TARGET_POSIX
  StringUtils::Replace(strPath, '/', '\\');
#endif
  //g_charsetConverter.unknownToUTF8(strPath);
  CStdString strCachedPath = URIUtils::AddFileToFolder(strDir + "rarfolder%04d",
                                           URIUtils::GetFileName(strPathInRar));
  strCachedPath = CUtil::GetNextPathname(strCachedPath, 9999);
  if (strCachedPath.empty())
  {
    CLog::Log(LOGWARNING, "Could not cache file %s", (strRarPath + strPathInRar).c_str());
    return false;
  }
  strCachedPath = CUtil::MakeLegalPath(strCachedPath);
  int64_t iOffset = -1;
  if (iRes != 2)
  {
    if (pFile)
    {
      if (pFile->m_iOffset != -1)
        iOffset = pFile->m_iOffset;
    }


    if (iOffset == -1 && j != m_ExFiles.end())  // grab from list
    {
      for( ArchiveList_struct* pIterator = j->second.first; pIterator  ; pIterator ? pIterator = pIterator->next : NULL)
      {
        CStdString strName;

        /* convert to utf8 */
        if( pIterator->item.NameW && wcslen(pIterator->item.NameW) > 0)
//.........这里部分代码省略.........
开发者ID:Anankin,项目名称:xbmc,代码行数:101,代码来源:RarManager.cpp

示例15: OnMessage

bool CGUIDialogBoxeeCtx::OnMessage(CGUIMessage &message)
{
  switch (message.GetMessage())
  {
  case GUI_MSG_ITEM_LOADED:
  {
    // New data received from the item loader, update existing item
    CFileItemPtr pItem ((CFileItem *)message.GetPointer());
    message.SetPointer(NULL);
    if (pItem) {
      m_item = *pItem;
      CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), INFO_HIDDEN_LIST, 0);
      OnMessage(msg);
      
      CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), INFO_HIDDEN_LIST, 0, 0, pItem);
      OnMessage(winmsg);

      CGUIMessage ref1(GUI_MSG_REFRESH_THUMBS, GetID(), IMG1);
      OnMessage(ref1);

      CGUIMessage ref2(GUI_MSG_REFRESH_THUMBS, GetID(), IMG2);
      OnMessage(ref2);

      CGUIMessage ref3(GUI_MSG_REFRESH_THUMBS, GetID(), IMG3);
      OnMessage(ref3);

      CGUIMessage ref4(GUI_MSG_REFRESH_THUMBS, GetID(), IMG4);
      OnMessage(ref4);
    }

    return true;
  }

  case GUI_MSG_CLICKED:
    {
      unsigned int iControl = message.GetSenderId();
      if (iControl == BTN_MORE_INFO)
      {
        OnMoreInfo();
        return true;
      }
      else if (iControl == BTN_RATE)
      {
        bool bLike;
        if (CGUIDialogBoxeeRate::ShowAndGetInput(bLike))
        {
          BoxeeUtils::Rate(&m_item, bLike);
          g_application.m_guiDialogKaiToast.QueueNotification(CGUIDialogKaiToast::ICON_STAR, "", g_localizeStrings.Get(51034), 5000 , KAI_YELLOW_COLOR, KAI_GREY_COLOR);
        }
      }
      else if (iControl == BTN_SHARE)
      {
        CGUIDialogBoxeeShare *pShare = (CGUIDialogBoxeeShare *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SHARE);

        if (pShare)
        {
          pShare->SetItem(&m_item);
          pShare->DoModal();
        }
        else
        {
          CLog::Log(LOGERROR,"CGUIDialogBoxeeCtx::OnMessage - GUI_MSG_CLICKED - BTN_SHARE - FAILED to get WINDOW_DIALOG_BOXEE_SHARE (share)");
        }
      }
      else if (iControl == BTN_PRESET)
      {
        if (m_item.GetPropertyBOOL("IsPreset"))
        {
          CGUIDialogYesNo* dlgYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
          if (dlgYesNo)
          {
            dlgYesNo->SetHeading(51020);
            dlgYesNo->SetLine(0, 51021);
            dlgYesNo->SetLine(1, m_item.GetLabel() + "?");
            dlgYesNo->SetLine(2, "");
            dlgYesNo->DoModal();

            if (dlgYesNo->IsConfirmed())
            {
              g_settings.DeleteSource(GetItemShareType(), m_item.GetProperty("ShareName"), m_item.m_strPath);
              CGUIWindow *pWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
              if (pWindow)
              {
                CGUIMessage msg(GUI_MSG_REFRESH_APPS, 0, 0);
                pWindow->OnMessage(msg);
              }
            }
          }
        } 
        else
        {
          CMediaSource newShare;
          newShare.strPath = m_item.m_strPath;
          newShare.strName = m_item.GetLabel();
          if (m_item.HasProperty("OriginalThumb") && !m_item.GetProperty("OriginalThumb").IsEmpty())
            newShare.m_strThumbnailImage = m_item.GetProperty("OriginalThumb");
          else
            newShare.m_strThumbnailImage = m_item.GetThumbnailImage();
          newShare.vecPaths.push_back(m_item.m_strPath);
          g_settings.AddShare(GetItemShareType(), newShare);
//.........这里部分代码省略.........
开发者ID:Kr0nZ,项目名称:boxee,代码行数:101,代码来源:GUIDialogBoxeeCtx.cpp


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