本文整理汇总了C++中UserWnd::setStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ UserWnd::setStatus方法的具体用法?C++ UserWnd::setStatus怎么用?C++ UserWnd::setStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserWnd
的用法示例。
在下文中一共展示了UserWnd::setStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processEvent
bool Container::processEvent(Event *e)
{
if (m_tabBar == NULL)
return false;
switch (e->type()){
case eEventMessageReceived: {
EventMessage *em = static_cast<EventMessage*>(e);
Message *msg = em->msg();
if (msg->type() == MessageStatus){
Contact *contact = getContacts()->contact(msg->contact());
if (contact)
contactChanged(contact);
return false;
}
if (msg->getFlags() & MESSAGE_NOVIEW)
return false;
if (CorePlugin::m_plugin->getContainerMode()){
if (isActiveWindow() && !isMinimized()){
UserWnd *userWnd = m_tabBar->currentWnd();
if (userWnd && (userWnd->id() == msg->contact()))
userWnd->markAsRead();
}else{
UserWnd *userWnd = wnd(msg->contact());
if (userWnd)
QTimer::singleShot(0, this, SLOT(flash()));
}
}
// no break here - otherwise we have to duplicate the code below...
}
case eEventMessageRead: {
EventMessage *em = static_cast<EventMessage*>(e);
Message *msg = em->msg();
UserWnd *userWnd = wnd(msg->contact());
if (userWnd){
bool bBold = false;
for (list<msg_id>::iterator it = CorePlugin::m_plugin->unread.begin(); it != CorePlugin::m_plugin->unread.end(); ++it){
if ((*it).contact != msg->contact())
continue;
bBold = true;
break;
}
m_tabBar->setBold(msg->contact(), bBold);
}
break;
}
case eEventActiveContact: {
EventActiveContact *eac = static_cast<EventActiveContact*>(e);
if (!isActiveWindow())
return false;
UserWnd *userWnd = m_tabBar->currentWnd();
if (userWnd) {
eac->setContactID(userWnd->id());
return true;
}
break;
}
case eEventContact: {
EventContact *ec = static_cast<EventContact*>(e);
Contact *contact = ec->contact();
UserWnd *userWnd = wnd(contact->id());
if(!userWnd)
break;
switch(ec->action()) {
case EventContact::eDeleted: {
removeUserWnd(userWnd);
break;
}
case EventContact::eChanged: {
if (contact->getIgnore()){
removeUserWnd(userWnd);
break;
}
m_tabBar->changeTab(contact->id());
contactChanged(contact);
break;
}
case EventContact::eStatus: {
unsigned style = 0;
QString wrkIcons;
QString statusIcon;
contact->contactInfo(style, statusIcon, &wrkIcons);
bool bTyping = false;
while (!wrkIcons.isEmpty()){
if (getToken(wrkIcons, ',') == "typing"){
bTyping = true;
break;
}
}
if (userWnd->m_bTyping != bTyping){
userWnd->m_bTyping = bTyping;
if (bTyping){
userWnd->setStatus(g_i18n("%1 is typing", contact) .arg(contact->getName()));
}else{
userWnd->setStatus("");
}
userWnd = m_tabBar->currentWnd();
if (userWnd && (contact->id() == userWnd->id()))
m_status->message(userWnd->status());
}
}
//.........这里部分代码省略.........