Logo Search packages:      
Sourcecode: nateon version File versions  Download package

void KNateon::slotChatMessage ( const QStringList &  slCommand  )  [private, slot]

채팅창이 아웃포커싱일때 팝업창 띄우기 위한...

채팅창이 아웃포커싱일때 채팅메세지가 오면 팝업창 보이기.

0: Online, 1: incoming chat, 2: incoming memo

비버디 대화

0: Online, 1: incoming chat, 2: incoming memo

Definition at line 4609 of file knateon.cpp.

References nmconfig::alarmrequirechat, Common::fixOutString(), BuddyList::getBuddyByID(), CurrentAccount::getBuddyList(), BuddyBase::getName(), slotIncomingChat(), sPicsPath, nmconfig::startchatsoundpath, nmconfig::usesound, and nmconfig::usestartchatsound.

Referenced by createChat().

{
      if ( stConfig.usesound && stConfig.usestartchatsound )
            Sound::play( stConfig.startchatsoundpath );

      if ( stConfig.alarmrequirechat )
      {
            QPoint point = systemTrayWidget_->mapToGlobal( systemTrayWidget_->pos() );
            if ( !pChatPopup)
            {
                  pChatPopup= new PopupWindow();
                  connect(pChatPopup, SIGNAL( clickText( int, QString ) ), SLOT( slotIncomingChat(int, QString ) ) );
                  connect(pChatPopup, SIGNAL( hidePopup() ), SLOT( slotHidePopup() ) );
            }
            int screen = kapp->desktop()->screenNumber();
            QRect screenSize = kapp->desktop()->availableGeometry(screen);
            
            int nX = point.x();
            int nY = screenSize.height() + screenSize.top();
            
            pChatPopup->setID( slCommand[2] );
            pChatPopup->setAnchor( QPoint(nX, nY) );
            pChatPopup->setLogo( sPicsPath + "popup_notice_chat.bmp" );
            
            m_pBuddyList = m_pCurrentAccount->getBuddyList();
            Buddy* pBuddy = m_pBuddyList->getBuddyByID( slCommand[2] );

            if ( pBuddy )
            {
                  QString sMsg;
                  sMsg = pBuddy->getName();
                  sMsg += "...";
                  sMsg += UTF8("님의 대화 :\n");
                  int nSeper = slCommand[4].findRev("%09");
                  QString sTemp( slCommand[4].mid( nSeper + 3 , slCommand[4].length() ) );

                  if ( sTemp.find( QRegExp("<FLCON.*FLCON>") ) != -1 )
                        sTemp = UTF8("플래시콘을 보내셨습니다.%0D%0A현재 리눅스 버전은 플래시콘을 지원하지 않습니다.");
                  
                  QString sTemp2;
                  if ( sTemp.find("%0A") != -1 )
                        sTemp2 = sTemp.left( sTemp.find("%0A") );
                  else
                        sTemp2 = sTemp;
                  sMsg += sTemp2;
                  
                  if ( sMsg.length() > 36 )
                  {
                        int nOver = sMsg.length() - 36;
                        
                        sMsg = pBuddy->getName();
                        sMsg += "...";
                        sMsg += UTF8("님의 대화 :\n");
                        sMsg += sTemp.left( sTemp.length() - nOver );
                  }
                  Common::fixOutString( sMsg );
                  pChatPopup->setText( sMsg );
                  
                  /*! 0: Online, 1: incoming chat, 2: incoming memo */
                  pChatPopup->setType(1);
                  pChatPopup->show();
                  nPopupY++;
            }
            else
            {
                  /*!
             * 비버디 대화
             */
                  QString sMsg;
                  sMsg = slCommand[2];
                  // sMsg += "...";
                  sMsg += UTF8("님의 대화 :\n");
                  int nSeper = slCommand[4].findRev("%09");
                  QString sTemp( slCommand[4].mid( nSeper + 3 , slCommand[4].length() ) );
                  QString sTemp2;
                  if ( sTemp.find("%0A") != -1 )
                        sTemp2 = sTemp.left( sTemp.find("%0A") );
                  else
                        sTemp2 = sTemp;
                  sMsg += sTemp2;

                  if ( sMsg.length() > 36 )
                  {
                        int nOver = sMsg.length() - 36;
                        
                        sMsg = pBuddy->getName();
                        sMsg += "...";
                        sMsg += UTF8("님의 대화 :\n");
                        sMsg += sTemp.left( sTemp.length() - nOver );
                  }
                  Common::fixOutString( sMsg );
                  pChatPopup->setText( sMsg );
                  
                  /*! 0: Online, 1: incoming chat, 2: incoming memo */
                  pChatPopup->setType(1);
                  pChatPopup->show();
                  nPopupY++;
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index