/** Default constructor */ ImHistoryBrowser::ImHistoryBrowser(const ChatId &chatId, QTextEdit *edit, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); ui.headerFrame->setHeaderImage(QPixmap(":/images/user/agt_forum64.png")); ui.headerFrame->setHeaderText(tr("Message History")); m_chatId = chatId; textEdit = edit; connect(NotifyQt::getInstance(), SIGNAL(historyChanged(uint, int)), this, SLOT(historyChanged(uint, int))); connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); connect(ui.copyButton, SIGNAL(clicked()), SLOT(copyMessage())); connect(ui.removeButton, SIGNAL(clicked()), SLOT(removeMessages())); connect(ui.listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged())); connect(ui.listWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); ui.filterLineEdit->showFilterIcon(); // embed smileys ? if (m_chatId.isPeerId() || m_chatId.isGxsId()) { embedSmileys = Settings->valueFromGroup("Chat", "Emoteicons_PrivatChat", true).toBool(); } else { embedSmileys = Settings->valueFromGroup("Chat", "Emoteicons_GroupChat", true).toBool(); } style.setStyleFromSettings(ChatStyle::TYPE_HISTORY); ui.listWidget->setItemDelegate(new IMHistoryItemDelegate); QByteArray geometry = Settings->valueFromGroup("HistorieBrowser", "Geometry", QByteArray()).toByteArray(); if (geometry.isEmpty() == false) { restoreGeometry(geometry); } // dummy call for set buttons itemSelectionChanged(); ui.listWidget->installEventFilter(this); m_createThread = new ImHistoryBrowserCreateItemsThread(this, m_chatId); connect(m_createThread, SIGNAL(finished()), this, SLOT(createThreadFinished())); connect(m_createThread, SIGNAL(progress(int,int)), this, SLOT(createThreadProgress(int,int))); m_createThread->start(); }
bool ImHistoryBrowser::eventFilter(QObject *obj, QEvent *event) { if (obj == ui.listWidget) { if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); if (keyEvent && keyEvent->key() == Qt::Key_Delete) { // Delete pressed removeMessages(); return true; // eat event } } } // pass the event on to the parent class return QDialog::eventFilter(obj, event); }
void assertImp(const char *predicateString, const char *file, int line) { string error = predicateString; error += " ("; error += file; error += ", "; error += editor::convertToString(line); error += ")"; LOG_ERROR(error.c_str()); #ifdef WIN32 removeMessages(); #endif // can't use the actual assert clause here, because it // has been lost in the function call (a macro assert would be // the only possible solution, but that would cause problems // with the #undef NDEBUG in the header...) #ifdef FB_TESTBUILD assert(!"testbuild fb_assert encountered."); #endif }
void CineEngine::mainLoop(int bootScriptIdx) { bool playerAction; byte di; uint16 mouseButton; if (_preLoad == false) { resetBgIncrustList(); setTextWindow(0, 0, 20, 200); errorVar = 0; addScriptToGlobalScripts(bootScriptIdx); menuVar = 0; // gfxRedrawPage(page0c, page0, page0c, page0, -1); // gfxWaitVBL(); // gfxRedrawMouseCursor(); inMenu = false; allowPlayerInput = 0; checkForPendingDataLoadSwitch = 0; fadeRequired = false; isDrawCommandEnabled = 0; waitForPlayerClick = 0; menuCommandLen = 0; playerCommand = -1; g_cine->_commandBuffer = ""; g_cine->_globalVars[VAR_MOUSE_X_POS] = 0; g_cine->_globalVars[VAR_MOUSE_Y_POS] = 0; if (g_cine->getGameType() == Cine::GType_OS) { g_cine->_globalVars[VAR_MOUSE_X_POS_2ND] = 0; g_cine->_globalVars[VAR_MOUSE_Y_POS_2ND] = 0; g_cine->_globalVars[VAR_BYPASS_PROTECTION] = 0; // set to 1 to bypass the copy protection g_cine->_globalVars[VAR_LOW_MEMORY] = 0; // set to 1 to disable some animations, sounds etc. } strcpy(newPrcName, ""); strcpy(newRelName, ""); strcpy(newObjectName, ""); strcpy(newMsgName, ""); strcpy(currentCtName, ""); strcpy(currentPartName, ""); g_sound->stopMusic(); } do { // HACK: Force amount of oxygen left to maximum during Operation Stealth's first arcade sequence. // This makes it possible to pass the arcade sequence for now. // FIXME: Remove the hack and make the first arcade sequence normally playable. if (g_cine->getGameType() == Cine::GType_OS) { Common::String bgName(renderer->getBgName()); // Check if the background is one of the three backgrounds // that are only used during the first arcade sequence. if (bgName == "28.PI1" || bgName == "29.PI1" || bgName == "30.PI1") { static const uint oxygenObjNum = 202, maxOxygen = 264; // Force the amount of oxygen left to the maximum. g_cine->_objectTable[oxygenObjNum].x = maxOxygen; } } // HACK: In Operation Stealth after the first arcade sequence jump player's position to avoid getting stuck. // After the first arcade sequence the player comes up stairs from // the water in Santa Paragua's downtown in front of the flower shop. // Previously he was completely stuck after getting up the stairs. // If the background is the one used in the flower shop scene ("21.PI1") // and the player is at the exact location after getting up the stairs // then we just nudge him a tiny bit away from the stairs and voila, he's free! // Maybe the real problem behind all this is collision data related as it looks // like there's some boundary right there near position (204, 110) which we can // jump over by moving the character to (204, 109). The script handling the // flower shop scene is AIRPORT.PRC's 13th script. // FIXME: Remove the hack and solve what's really causing the problem in the first place. if (g_cine->getGameType() == Cine::GType_OS) { if (scumm_stricmp(renderer->getBgName(), "21.PI1") == 0 && g_cine->_objectTable[1].x == 204 && g_cine->_objectTable[1].y == 110) { g_cine->_objectTable[1].y--; // Move the player character upward on-screen by one pixel } } stopMusicAfterFadeOut(); di = executePlayerInput(); // Clear the zoneQuery table (Operation Stealth specific) if (g_cine->getGameType() == Cine::GType_OS) { Common::set_to(g_cine->_zoneQuery.begin(), g_cine->_zoneQuery.end(), 0); } if (g_cine->getGameType() == Cine::GType_OS) { processSeqList(); } executeObjectScripts(); executeGlobalScripts(); purgeObjectScripts(); purgeGlobalScripts(); if (g_cine->getGameType() == Cine::GType_OS) { purgeSeqList(); } if (playerCommand == -1) { setMouseCursor(MOUSE_CURSOR_NORMAL); } else { setMouseCursor(MOUSE_CURSOR_CROSS); } if (renderer->ready()) { renderer->drawFrame(); } // NOTE: In the original Future Wars and Operation Stealth messages // were removed when running the drawOverlays function which is // currently called from the renderer's drawFrame function. removeMessages(); if (waitForPlayerClick) { playerAction = false; _messageLen <<= 3; if (_messageLen < 0x800) _messageLen = 0x800; do { manageEvents(); getMouseData(mouseUpdateStatus, &mouseButton, &dummyU16, &dummyU16); } while (mouseButton != 0 && !shouldQuit()); menuVar = 0; do { manageEvents(); getMouseData(mouseUpdateStatus, &mouseButton, &dummyU16, &dummyU16); playerAction = (mouseButton != 0) || processKeyboard(menuVar); mainLoopSub6(); } while (!playerAction && !shouldQuit()); menuVar = 0; do { manageEvents(); getMouseData(mouseUpdateStatus, &mouseButton, &dummyU16, &dummyU16); } while (mouseButton != 0 && !shouldQuit()); waitForPlayerClick = 0; } if (checkForPendingDataLoadSwitch) { checkForPendingDataLoad(); checkForPendingDataLoadSwitch = 0; } if (di) { if ("quit"[menuCommandLen] == (char)di) { ++menuCommandLen; if (menuCommandLen == 4) { quitGame(); } } else { menuCommandLen = 0; } } manageEvents(); } while (!shouldQuit() && !_restartRequested); hideMouse(); g_sound->stopMusic(); // if (g_cine->getGameType() == Cine::GType_OS) { // freeUnkList(); // } closePart(); }
/*! Removes a QMailMessage with QMailMessageId \a id from the message store. If \a option is QMailStore::CreateRemovalRecord then a removal record will be created for the removed message. Returns \c true if the operation completed successfully, \c false otherwise. */ bool QMailStore::removeMessage(const QMailMessageId& id, QMailStore::MessageRemovalOption option) { return removeMessages(QMailMessageKey::id(id), option); }
void BuriedEngine::removeMouseMessages(Window *window) { removeMessages(window, kMessageTypeMouseBegin, kMessageTypeMouseEnd); }
void BuriedEngine::removeKeyboardMessages(Window *window) { removeMessages(window, kMessageTypeKeyBegin, kMessageTypeKeyEnd); }