void EquipmentInfo::unloadClick(Ref* pSender, TouchEventType type) { if (type == TOUCH_EVENT_ENDED) { ToolFunc::playEffectFile( Click ); if (DataManager::getInstance()->isUnloadEquip(DataManager::getInstance()->reGeneralVector[ 0 ].PKID, equipmentPKID, DataManager::getInstance()->equipType - 1)) { closeClick(NULL, TOUCH_EVENT_ENDED); } } }
void EquipmentInfo::equipClick(Ref* pSender, TouchEventType type) { if (type == TOUCH_EVENT_ENDED) { ToolFunc::playEffectFile( Click ); if (DataManager::getInstance()->isDonSucceed(DataManager::getInstance()->reGeneralVector[ 0 ].PKID, equipmentPKID, DataManager::getInstance()->equipType - 1 )) { if (false == NewComer::isGuideDone(1000)) /* 引导ID为0,且未完成 */ { if (4 == NewComer::getCurGuideStep()) { NewComer::setCurGuideStep(); } } closeClick(NULL, TOUCH_EVENT_ENDED); } } }
void OSDPlugin::processQueue() { if (m_timer->isActive()) return; while (queue.size()){ m_request = queue.front(); queue.erase(queue.begin()); Contact *contact = getContacts()->contact(m_request.contact); if ((contact == NULL) || contact->getIgnore()){ continue; } QString text; OSDUserData *data = NULL; data = (OSDUserData*)contact->getUserData(user_data_id); switch (m_request.type){ case OSD_ALERT: if (data->EnableAlert.bValue){ unsigned style = 0; const char *statusIcon = NULL; if (contact->contactInfo(style, statusIcon) >= STATUS_ONLINE) text = g_i18n("%1 is online", contact) .arg(contact->getName()); } break; case OSD_TYPING: if (data->EnableTyping.bValue){ unsigned style = 0; string wrkIcons; const char *statusIcon = NULL; contact->contactInfo(style, statusIcon, &wrkIcons); bool bTyping = false; while (!wrkIcons.empty()){ if (getToken(wrkIcons, ',') == "typing"){ bTyping = true; break; } } if (bTyping) text = g_i18n("%1 is typing", contact) .arg(contact->getName()); } break; case OSD_MESSAGE: if (data->EnableMessage.bValue && core){ list<msg_id>::iterator it; TYPE_MAP types; TYPE_MAP::iterator itc; QString msg_text; for (it = core->unread.begin(); it != core->unread.end(); ++it){ if ((*it).contact != m_request.contact) continue; unsigned type = (*it).type; itc = types.find(type); if (itc == types.end()){ types.insert(TYPE_MAP::value_type(type, 1)); }else{ (*itc).second++; } if (!data->EnableMessageShowContent.bValue) continue; MessageID id; id.id = (*it).id; id.contact = (*it).contact; id.client = (*it).client.c_str(); Event e(EventLoadMessage, &id); Message *msg = (Message*)(e.process()); if (msg == NULL) continue; QString msgText = msg->getPlainText().stripWhiteSpace(); if (msgText.isEmpty()) continue; if (!msg_text.isEmpty()) msg_text += "\n"; msg_text += msgText; } if (types.empty()) break; for (itc = types.begin(); itc != types.end(); ++itc){ CommandDef *def = core->messageTypes.find((*itc).first); if (def == NULL) continue; MessageDef *mdef = (MessageDef*)(def->param); QString msg = i18n(mdef->singular, mdef->plural, (*itc).second); if ((*itc).second == 1){ int pos = msg.find("1 "); if (pos > 0){ msg = msg.left(pos); }else if (pos == 0){ msg = msg.mid(2); } msg = msg.left(1).upper() + msg.mid(1); } if (!text.isEmpty()) text += ", "; text += msg; } text = i18n("%1 from %2") .arg(text) .arg(contact->getName()); if (msg_text.isEmpty()) break; text += ":\n"; text += msg_text; } } if (!text.isEmpty()){ if (m_osd == NULL){ m_osd = new OSDWidget; connect(m_osd, SIGNAL(dblClick()), this, SLOT(dblClick())); connect(m_osd, SIGNAL(closeClick()), this, SLOT(timeout())); } static_cast<OSDWidget*>(m_osd)->showOSD(text, data); m_timer->start(data->Timeout.value * 1000); return; } } m_timer->stop(); m_request.contact = 0; m_request.type = OSD_NONE; }
void OSDWidget::slotCloseClick() { emit closeClick(); }
void MeshLabXMLStdDialog::loadFrameContent( ) { assert(qf); qf->hide(); QLabel *ql; QGridLayout *gridLayout = new QGridLayout(qf); qf->setLayout(gridLayout); QString fname(curmfc->act->text()); setWindowTitle(fname); ql = new QLabel("<i>"+curmfc->xmlInfo->filterHelp(fname)+"</i>",qf); ql->setTextFormat(Qt::RichText); ql->setWordWrap(true); gridLayout->addWidget(ql,0,0,1,2,Qt::AlignTop); // this widgets spans over two columns. stdParFrame = new XMLStdParFrame(this,curgla); //connect(stdParFrame,SIGNAL(frameEvaluateExpression(const Expression&,Value**)),this,SIGNAL(dialogEvaluateExpression(const Expression&,Value**)),Qt::DirectConnection); MLXMLPluginInfo::XMLMapList mplist = curmfc->xmlInfo->filterParametersExtendedInfo(fname); EnvWrap wrap(env); stdParFrame->loadFrameContent(mplist,wrap); gridLayout->addWidget(stdParFrame,1,0,1,2); //int buttonRow = 2; // the row where the line of buttons start helpButton = new QPushButton("Help", qf); //helpButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); closeButton = new QPushButton("Close", qf); //closeButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); applyButton = new QPushButton("Apply", qf); //applyButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); defaultButton = new QPushButton("Default", qf); //defaultButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); applyButton->setFocus(); ExpandButtonWidget* exp = new ExpandButtonWidget(qf); connect(exp,SIGNAL(expandView(bool)),this,SLOT(extendedView(bool))); connect(this->parentWidget(),SIGNAL(filterExecuted()),this,SLOT(postFilterExecution())); #ifdef Q_WS_MAC // Hack needed on mac for correct sizes of button in the bottom of the dialog. helpButton->setMinimumSize(100, 25); closeButton->setMinimumSize(100,25); applyButton->setMinimumSize(100,25); defaultButton->setMinimumSize(100, 25); #endif QString postCond = curmfc->xmlInfo->filterAttribute(fname,MLXMLElNames::filterPostCond); QStringList postCondList = postCond.split(QRegExp("\\W+"), QString::SkipEmptyParts); curmask = MeshLabFilterInterface::convertStringListToMeshElementEnum(postCondList); if(isPreviewable()) { previewCB = new QCheckBox("Preview", qf); previewCB->setCheckState(Qt::Unchecked); gridLayout->addWidget(previewCB, gridLayout->rowCount(),0,Qt::AlignBottom); connect(previewCB,SIGNAL(toggled(bool)),this,SLOT( togglePreview() )); //buttonRow++; } connect(helpButton,SIGNAL(clicked()),this,SLOT(toggleHelp())); connect(closeButton,SIGNAL(clicked()),this,SLOT(closeClick())); connect(defaultButton,SIGNAL(clicked()),this,SLOT(resetExpressions())); connect(applyButton,SIGNAL(clicked()),this,SLOT(applyClick())); gridLayout->addWidget(exp,gridLayout->rowCount(),0,1,2,Qt::AlignJustify); int firstButLine = gridLayout->rowCount(); gridLayout->addWidget(helpButton, firstButLine,1,Qt::AlignBottom); gridLayout->addWidget(defaultButton,firstButLine,0,Qt::AlignBottom); int secButLine = gridLayout->rowCount(); gridLayout->addWidget(closeButton, secButLine,0,Qt::AlignBottom); gridLayout->addWidget(applyButton, secButLine,1,Qt::AlignBottom); qf->showNormal(); qf->adjustSize(); //set the minimum size so it will shrink down to the right size after the help is toggled //this->setMinimumSize(qf->sizeHint()); this->showNormal(); this->adjustSize(); //setSizePolicy(QSizePolicy::Minimum,QSizePolicy::MinimumExpanding); }
void MeshLabXMLStdDialog::closeEvent( QCloseEvent * /*event*/ ) { closeClick(); }