コード例 #1
0
ファイル: GUIDialogKaiToast.cpp プロジェクト: A600/xbmc
void CGUIDialogKaiToast::OnWindowLoaded()
{
  CGUIDialog::OnWindowLoaded();
  CGUIImage *image = (CGUIImage *)GetControl(POPUP_ICON);
  if (image)
    m_defaultIcon = image->GetFileName();
}
コード例 #2
0
bool CGUIDialogKaiToast::DoWork()
{
  CSingleLock lock(m_critical);

  if (m_notifications.size() > 0 &&
      CTimeUtils::GetFrameTime() - m_timer > m_toastMessageTime)
  {
    Notification toast = m_notifications.front();
    m_notifications.pop();
    lock.Leave();

    m_toastDisplayTime = toast.displayTime;
    m_toastMessageTime = toast.messageTime;

    CSingleLock lock2(g_graphicsContext);

    if(!Initialize())
      return false;

    SET_CONTROL_LABEL(POPUP_CAPTION_TEXT, toast.caption);

    SET_CONTROL_LABEL(POPUP_NOTIFICATION_BUTTON, toast.description);

    CGUIImage *image = (CGUIImage *)GetControl(POPUP_ICON);
    if (image)
    {
      CStdString strTypeImage = toast.imagefile;

      if (strTypeImage.IsEmpty())
      {
        CGUIImage *typeImage = NULL;

        if (toast.eType == Info)
          typeImage = (CGUIImage *)GetControl(POPUP_ICON_INFO);
        else if (toast.eType == Warning)
          typeImage = (CGUIImage *)GetControl(POPUP_ICON_WARNING);
        else if (toast.eType == Error)
          typeImage = (CGUIImage *)GetControl(POPUP_ICON_ERROR);
        else
          typeImage = image;

        strTypeImage = typeImage->GetFileName();
      }

      image->SetFileName(strTypeImage);
    }

    //  Play the window specific init sound for each notification queued
    SetSound(toast.withSound);

    ResetTimer();
    return true;
  }

  return false;
}
コード例 #3
0
ファイル: GUIDialogKaiToast.cpp プロジェクト: A600/xbmc
void CGUIDialogKaiToast::AddToQueue(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/)
{
  CGUIImage *image    = NULL;
  
  if (eType == Info)
    image = (CGUIImage *)GetControl(POPUP_ICON_INFO);
  else if (eType == Warning)
    image = (CGUIImage *)GetControl(POPUP_ICON_WARNING);
  else if (eType == Error)
    image = (CGUIImage *)GetControl(POPUP_ICON_ERROR);
  
  CStdString strImage;
  if (image)
    strImage = image->GetFileName();
  
  AddToQueue(strImage, aCaption, aDescription, displayTime, withSound, messageTime);
}
コード例 #4
0
void CGUIDialogProfileSettings::OnWindowLoaded()
{
  CGUIDialogSettings::OnWindowLoaded();
  CGUIImage *pImage = (CGUIImage*)GetControl(2);
  m_strDefaultImage = pImage ? pImage->GetFileName() : "";
}