Esempio n. 1
0
void NfcManager::startEventProcessing() {
	qDebug() << "XXXX starting event processing...";
	_future = new QFuture<void>;
	_watcher = new QFutureWatcher<void>;
	*_future = QtConcurrent::run(_workerInstance, &NfcWorker::startEventLoop);
	_watcher->setFuture(*_future);
	QObject::connect(_watcher, SIGNAL(finished()), this, SLOT(workerStopped()));
	QObject::connect(_workerInstance, SIGNAL(message(QVariant)), this, SLOT(message(QVariant)), Qt::QueuedConnection);
	QObject::connect(_workerInstance, SIGNAL(clearMessages()), this, SLOT(clearMessages()), Qt::QueuedConnection);
	qDebug() << "XXXX startEventProcessing - event loop started";
}
void LLFloaterMarketplaceValidation::onOpen(/*const LLSD& key*/)
{
	// Clear the messages
	clearMessages();

	// Get the folder UUID to validate. Use the whole marketplace listing if none provided.
	LLUUID cat_id(mKey.asUUID());
	if (cat_id.isNull())
	{
		cat_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false);
	}

	// Validates the folder
	if (cat_id.notNull())
	{
		LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
		validate_marketplacelistings(cat, boost::bind(&LLFloaterMarketplaceValidation::appendMessage, this, _1, _2, _3), false);
	}

	// Handle the listing folder being processed
	handleCurrentListing();

	// Dump result to the editor panel
	if (mEditor)
	{
		mEditor->setValue(LLSD());
		if (mMessages.empty())
		{
			// Display a no error message
			mEditor->appendText(LLTrans::getString("Marketplace Validation No Error"), false, false);
		}
		else
		{
			// Print out all the messages to the panel
			message_list_t::iterator mCurrentLine = mMessages.begin();
			bool new_line = false;
			while (mCurrentLine != mMessages.end())
			{
				// Errors are printed in bold, other messages in normal font
				LLStyleSP style(new LLStyle);
				style->setColor(mEditor->getReadOnlyFgColor());
				style->mBold = mCurrentLine->mErrorLevel == LLError::LEVEL_ERROR;
				mEditor->appendText(mCurrentLine->mMessage, false, new_line, style);
				new_line = true;
				mCurrentLine++;
			}
		}
	}
	// We don't need the messages anymore
	clearMessages();
}
Esempio n. 3
0
	void IComponent::activate() {
		if(_isActivated) return;

		_isActivated = true;
		clearMessages();
		onActivate();
	}
Esempio n. 4
0
// delete graphics only related to the level in specific
void Graphics::closeLevelGFX()
{
	clearMessages();
	if (bg != NULL)
	{
		delete bg;
		bg = NULL;
	}
	for (int i = bgObjects.size() - 1; i >= 0; i--)
	{
		if (bgObjects[i].first != NULL)
		{
			delete bgObjects[i].first;
			bgObjects[i].first = NULL;
		}
		bgObjects.pop_back();
	}
	for (int i = particles.size() - 1; i >= 0; i--)
	{
		if (particles[i].first != NULL)
		{
			delete particles[i].first;
			particles[i].first = NULL;
		}
		particles.pop_back();
	}
}
Esempio n. 5
0
void Graphics::handleGameOverlay(int time, int score, bool reset)
{
	static int timeIndex = -1, scoreIndex = -1;
	static int oldTime = 0, oldScore = 0;
	if (reset)
	{
		clearMessages();
		timeIndex = scoreIndex = -1;
		oldTime = oldScore = 0;
		return;
	}
	if (timeIndex == -1 || scoreIndex == -1)
	{
		timeIndex = messages.size();
		newMessage(std::to_string(time), 36, -1, { 0, 0, 0, 255 }, UP, RIGHT, true);
		scoreIndex = messages.size();
		newMessage(std::to_string(score), 36, -1, { 0, 0, 0, 255 }, DOWN, RIGHT, true);
	}
	else
	{
		if(oldTime != time)
			messages[timeIndex]->setText(std::to_string(time));
		if(oldScore != score)
			messages[scoreIndex]->setText(std::to_string(score));
		if (Game::Mode == GAME_END)
		{
			messages[timeIndex]->text->txRect.y = Window::geth();
			messages[scoreIndex]->text->txRect.y = Window::geth();
		}
	}
	oldTime = time;
	oldScore = score;
}
Esempio n. 6
0
int packagesPage::resetLists()
{
    packagesListWidget->blockSignals(true);
    reposListWidget->blockSignals(true);

    while(packagesListWidget->count() > 0)
    {
        packagesListWidget->takeItem(0);
    }

    while(reposListWidget->count() > 0)
    {
        reposListWidget->takeItem(0);
    }
   
   emit clearMessages();

    packagesListWidget->blockSignals(false);
    reposListWidget->blockSignals(false);

    packages.clear();
    packagesList.clear();
    statuses.clear();
    initAll();
    return 0;
}
Esempio n. 7
0
void FullpipeEngine::restartGame() {
	_floaters->stopAll();

	clearGlobalMessageQueueList();
	clearMessages();

	initObjectStates();

	if (_scene2) {
		_scene2->getAniMan();
		_scene2 = 0;
	}

	if (_currentScene) {
		_gameLoader->unloadScene(_currentScene->_sceneId);

		_currentScene = 0;
	}

	_gameLoader->restoreDefPicAniInfos();

	getGameLoaderInventory()->clear();
	getGameLoaderInventory()->addItem(ANI_INV_MAP, 1);
	getGameLoaderInventory()->rebuildItemRects();

	initMap();

	if (_flgPlayIntro) {
		_gameLoader->loadScene(SC_INTRO1);
		_gameLoader->gotoScene(SC_INTRO1, TrubaUp);
	} else {
		_gameLoader->loadScene(SC_1);
		_gameLoader->gotoScene(SC_1, TrubaLeft);
	}
}
bool MIPSamplingRateConverter::pull(const MIPComponentChain &chain, int64_t iteration, MIPMessage **pMsg)
{
	if (!m_init)
	{
		setErrorString(MIPSAMPLINGRATECONVERTER_ERRSTR_NOTINIT);
		return false;
	}

	if (m_prevIteration != iteration)
	{
		clearMessages();
		m_prevIteration = iteration;
	}

	if (m_msgIt == m_messages.end())
	{
		*pMsg = 0;
		m_msgIt = m_messages.begin();
	}
	else
	{
		*pMsg = *m_msgIt;
		m_msgIt++;
	}
	return true;
}
Esempio n. 9
0
bool MIPRTPL16Encoder::pull(const MIPComponentChain &chain, int64_t iteration, MIPMessage **pMsg)
{
	if (!m_init)
	{
		setErrorString(MIPRTPL16ENCODER_ERRSTR_NOTINIT);
		return false;
	}
	
	if (m_prevIteration != iteration)
	{
		m_prevIteration = iteration;
		clearMessages();
	}

	if (m_msgIt == m_messages.end())
	{
		m_msgIt = m_messages.begin();
		*pMsg = 0;
	}
	else
	{
		*pMsg = *m_msgIt;
		m_msgIt++;
	}
	return true;
}
Esempio n. 10
0
bool MIPMediaBuffer::pull(const MIPComponentChain &chain, int64_t iteration, MIPMessage **pMsg)
{
	//std::cout << "I " << iteration << " MIPMediaBuffer::pull" << (void *)this << std::endl;
	if (!m_init)
	{
		setErrorString(MIPMEDIABUFFER_ERRSTR_NOTINIT);
		return false;
	}

	if (iteration != m_prevIteration)
	{
		m_prevIteration = iteration;
		clearMessages();
		buildOutputMessages();
	}

	if (m_msgIt == m_messages.end())
	{
		*pMsg = 0;
		m_msgIt = m_messages.begin();
	}
	else
	{
		*pMsg = *m_msgIt;
		m_msgIt++;
	}

	return true;
}
void InspectorConsoleAgent::reset()
{
    ErrorString error;
    clearMessages(&error);
    m_times.clear();
    m_counts.clear();
}
Esempio n. 12
0
void CVSService::slotBrowseLog()
{
  startService(); 
  if (!m_defaultFile.isEmpty())
  {
    if (m_defaultFile.startsWith(m_repositoryPath))
    {
      QString file = m_defaultFile.remove(m_repositoryPath);
      if (m_repository && !m_appId.isEmpty() )
      {
        emit clearMessages();
        emit showMessage(i18n("Showing CVS log...") + "\n", false);
        m_files += file;
        m_job = m_cvsService->log(file);
        m_cvsCommand = "log";
        m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj());

        connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true);
        connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true);
        connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true);
        m_cvsJob->execute();
      }
    } else
    {
      notInRepository();
    }
  }
}
Esempio n. 13
0
void CVSService::slotCommit(const QStringList &files)
{
   startService(); 
   m_commitDlg->fileList->clear();
   m_commitDlg->fileList->insertStringList(files);
   m_commitDlg->logEdit->clear();
   m_commitDlg->messageCombo->insertItem(i18n("Current"), 0);
   m_commitDlg->messageCombo->setCurrentItem(0);
   
   if (m_repository && !m_appId.isEmpty() && m_commitDlg->exec())
   {
      m_commitDlg->messageCombo->removeItem(0);
      QString message = m_commitDlg->logEdit->text();
      if (message != m_commitDlg->messageCombo->currentText())
          m_commitDlg->messageCombo->insertItem(message, 0);
      emit clearMessages();
      emit showMessage(i18n("Running CVS commit...") + "\n", false);
      m_files = files;
      m_job = m_cvsService->commit(files, message, true);
      m_cvsCommand = "commit";
      m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj());

      connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true);
      connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true);
      connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true);
      m_cvsJob->execute();
   }
}
Esempio n. 14
0
void CVSService::slotUpdateToTag(const QStringList &files)
{
  startService(); 
  if (m_repository && !m_appId.isEmpty() && m_updateToDlg->exec())
  {
    QString extraOpts;
    QString commandStr;
    if (m_updateToDlg->tagRadioButton->isChecked())
    {
      extraOpts = "-r " + m_updateToDlg->tagCombo->currentText();
      commandStr = i18n("Updating to revision %1 ...").arg(m_updateToDlg->tagCombo->currentText());
    } else
    {
      extraOpts = "-D " + m_updateToDlg->dateLineEdit->text();
      commandStr = i18n("Updating to the version from %1 ...").arg(+ m_updateToDlg->dateLineEdit->text());
    }
    emit clearMessages();
    emit showMessage(commandStr + "\n", false);
    m_files = files;
    m_job = m_cvsService->update(files, true, true, true, extraOpts);
    m_cvsCommand = "update";
    m_cvsJob = new CvsJob_stub(m_job.app(), m_job.obj());

    connectDCOPSignal(m_job.app(), m_job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true);
    connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStdout(QString)", "slotReceivedStdout(QString)", true);
    connectDCOPSignal(m_job.app(), m_job.obj(), "receivedStderr(QString)", "slotReceivedStderr(QString)", true);
    m_cvsJob->execute();
  }
}
void MIPSamplingRateConverter::cleanUp()
{
	if (!m_init)
		return;

	clearMessages();
	m_init = false;
}
void InspectorConsoleAgent::reset()
{
    ErrorString unused;
    clearMessages(unused);

    m_times.clear();
    m_counts.clear();
}
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
{
    if (type == ClearMessageType) {
        ErrorString error;
        clearMessages(&error);
    }

    addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type, level, message, callStack, requestIdentifier)));
}
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier)
{
    if (type == ClearMessageType) {
        ErrorString error;
        clearMessages(&error);
    }

    addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type, level, message, arguments, state, requestIdentifier)));
}
Esempio n. 19
0
void BaseResponse::addSuccessMessage()
{
	if (_messages.size() > 0)
	{
		clearMessages();
	}

	_messages.push_back("Success");
}
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, unsigned columnNumber, ScriptState* state, unsigned long requestIdentifier)
{
    if (type == ClearMessageType) {
        ErrorString error;
        clearMessages(&error);
    }

    bool canGenerateCallStack = !isWorkerAgent() && m_frontend;
    addConsoleMessage(adoptPtr(new ConsoleMessage(canGenerateCallStack, source, type, level, message, scriptId, lineNumber, columnNumber, state, requestIdentifier)));
}
Esempio n. 21
0
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
{
    if (!developerExtrasEnabled())
        return;

    if (type == ClearMessageType) {
        ErrorString error;
        clearMessages(&error);
    }

    addConsoleMessage(adoptPtr(new ConsoleMessage(source, type, level, message, 0, callStack, requestIdentifier)));
}
Esempio n. 22
0
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, unsigned long requestIdentifier)
{
    if (!developerExtrasEnabled())
        return;

    if (type == ClearMessageType) {
        ErrorString error;
        clearMessages(&error);
    }

    addConsoleMessage(adoptPtr(new ConsoleMessage(source, type, level, message, scriptId, lineNumber, requestIdentifier)));
}
Esempio n. 23
0
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, JSC::ExecState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier)
{
    if (!m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled())
        return;

    if (type == MessageType::Clear) {
        ErrorString error;
        clearMessages(&error);
    }

    addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type, level, message, arguments, state, requestIdentifier)));
}
void InspectorConsoleAgent::addMessageToConsole(std::unique_ptr<ConsoleMessage> message)
{
    if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())
        return;

    if (message->type() == MessageType::Clear) {
        ErrorString unused;
        clearMessages(unused);
    }

    addConsoleMessage(WTFMove(message));
}
Esempio n. 25
0
bool MIPRTPL16Encoder::push(const MIPComponentChain &chain, int64_t iteration, MIPMessage *pMsg)
{
	if (!m_init)
	{
		setErrorString(MIPRTPL16ENCODER_ERRSTR_NOTINIT);
		return false;
	}
	
	if (m_prevIteration != iteration)
	{
		m_prevIteration = iteration;
		clearMessages();
	}
	
	if (!(pMsg->getMessageType() == MIPMESSAGE_TYPE_AUDIO_RAW && pMsg->getMessageSubtype() == MIPRAWAUDIOMESSAGE_TYPE_S16BE))
	{
		setErrorString(MIPRTPL16ENCODER_ERRSTR_BADMESSAGE);
		return false;
	}
	
	MIPRaw16bitAudioMessage *pRawMsg = (MIPRaw16bitAudioMessage *)pMsg;
	int sampRate = pRawMsg->getSamplingRate();
	int channels = pRawMsg->getNumberOfChannels();
	
	if (sampRate != m_sampRate)
	{
		setErrorString(MIPRTPL16ENCODER_ERRSTR_BADSAMPLINGRATE);
		return false;
	}
	if (channels != m_channels)
	{
		setErrorString(MIPRTPL16ENCODER_ERRSTR_BADCHANNELS);
		return false;
	}
	
	const uint16_t *pFrames = pRawMsg->getFrames();
	bool marker = false;
	size_t length = pRawMsg->getNumberOfFrames() * m_channels * sizeof(uint16_t);
	uint8_t *pPayload = new uint8_t [length];

	memcpy(pPayload,pFrames,length);

	MIPRTPSendMessage *pNewMsg;

	pNewMsg = new MIPRTPSendMessage(pPayload,length,getPayloadType(),marker,pRawMsg->getNumberOfFrames());
	pNewMsg->setSamplingInstant(pRawMsg->getTime());
	
	m_messages.push_back(pNewMsg);
	m_msgIt = m_messages.begin();
		
	return true;
}
Esempio n. 26
0
File: MPF.cpp Progetto: aaly/MPF
int MPF::setGroup(pagesGroup* grp)
{
	if(groups.indexOf(grp) != -1 )
	{
		//if current group is set disconenct it....
		if(currentGroup != -1)
		{
			QObject::disconnect(groups.at(currentGroup), 0, 0, 0);
		}

		if(listGridLayout->itemAt(0))
		{

			//listGridLayout->removeItem(groups.at(currentGroup)->listGridLayout);
			//QLayoutItem * item = listGridLayout->takeAt(0);
			//delete item;
		}
		if(currentGroup != -1)
		{
			groups.at(currentGroup)->hideList();
			////groups.at(currentGroup)->listGridLayout->setParent(groups.at(currentGroup));
			//QLayoutItem* item =  listGridLayout->takeAt(0);
			//item->layout()->widget()->setHidden(true);

			//listGridLayout->itemAt(0)->layout()->widget()->setHidden(true);
			////groups.at(currentGroup)->setHidden(true);
			//listGridLayout->removeItem(listGridLayout->itemAt(0));
			//groups.at(currentGroup)->listGridLayout->setParent(groups.at(currentGroup));
			//groups.at(currentGroup)->setHidden(true);
			////listGridLayout->update();
			//groups.at(currentGroup)->setHidden(true);
			//groups.at(currentGroup)->listGridLayout->setParent(NULL);
			//groups.at(currentGroup)->setHidden(true);
		}
		currentGroup = groups.indexOf(grp);
		grp->showList();
		// set list and messages widgets ...
		grp->listGridLayout->setParent(NULL);
		listGridLayout->addLayout(grp->listGridLayout);


		// connect to groups signals
		connect(grp, SIGNAL(newMessage(QString,int, int, pagesGroup*)), this, SLOT(addMessage(QString,int)), Qt::QueuedConnection);
		connect(grp, SIGNAL(clearPageMessages()), this, SLOT(clearMessages()), Qt::QueuedConnection);
		connect(grp, SIGNAL(pageReady(bool, int, pagesGroup*)), nextPushButton, SLOT(setEnabled(bool)));
		connect(grp, SIGNAL(pageReady(bool, int, pagesGroup*)), nextPushButton, SLOT(setFocus()));
		//prevPage();
		changePage(0);
	}
	else
	{
		return 1;
    void LogViewerWidget::setupGUI() {
        setWindowTitle(tr("Log Viewer"));

        _mainLayout = new QVBoxLayout(this);

        _controls_layout = new QHBoxLayout();
        _mainLayout->addLayout(_controls_layout);

        _filter_label = new QLabel(tr("&Filter:"), this);
        _controls_layout->addWidget(_filter_label);

        _filter_line_edit = new QLineEdit(this);
        _filter_line_edit->setPlaceholderText(tr("Start typing here to filter log messages"));

        _filter_label->setBuddy(_filter_line_edit);
        _controls_layout->addWidget(_filter_line_edit);

        _cbLogLevel = new QComboBox(this);
        _cbLogLevel->addItem("Debug",   static_cast<int>(cgt::Debug));
        _cbLogLevel->addItem("Info",    static_cast<int>(cgt::Info));
        _cbLogLevel->addItem("Warning", static_cast<int>(cgt::Warning));
        _cbLogLevel->addItem("Error",   static_cast<int>(cgt::Error));
        _cbLogLevel->addItem("Fatal",   static_cast<int>(cgt::Fatal));
        _cbLogLevel->setCurrentIndex(1);

        QLabel* lblLogLevel = new QLabel("Minimum Log Level:");
        lblLogLevel->setBuddy(_cbLogLevel);

        _controls_layout->addWidget(lblLogLevel);
        _controls_layout->addWidget(_cbLogLevel);

        _controls_layout->addStretch();

        _clear_button = new QPushButton(tr("&Clear"), this);
        _controls_layout->addWidget(_clear_button);

        _logDisplay = new QTextEdit(this);
        _logDisplay->setReadOnly(true);
        _mainLayout->addWidget(_logDisplay);

        // Use the system's default monospace font at the default size in the log viewer
        QFont monoFont = QFont("Monospace");
        monoFont.setStyleHint(QFont::TypeWriter);
        monoFont.setPointSize(QFont().pointSize() + 1);

        _logDisplay->document()->setDefaultFont(monoFont);
        _logHighlighter = new LogHighlighter(_logDisplay);

        connect(_clear_button, SIGNAL(clicked()), this, SLOT(clearMessages()));
        connect(_filter_line_edit, SIGNAL(textEdited(const QString&)), this, SLOT(filterLogMessages(const QString&)));
        connect(_cbLogLevel, SIGNAL(currentIndexChanged(int)), this, SLOT(onLogLevelChanged(int)));
    }
Esempio n. 28
0
bool MIPRTPULawEncoder::push(const MIPComponentChain &chain, int64_t iteration, MIPMessage *pMsg)
{
	if (!m_init)
	{
		setErrorString(MIPRTPULAWENCODER_ERRSTR_NOTINIT);
		return false;
	}
	
	if (m_prevIteration != iteration)
	{
		m_prevIteration = iteration;
		clearMessages();
	}
	
	if (!(pMsg->getMessageType() == MIPMESSAGE_TYPE_AUDIO_ENCODED && pMsg->getMessageSubtype() == MIPENCODEDAUDIOMESSAGE_TYPE_ULAW))
	{
		setErrorString(MIPRTPULAWENCODER_ERRSTR_BADMESSAGE);
		return false;
	}
	
	MIPEncodedAudioMessage *pEncMsg = (MIPEncodedAudioMessage *)pMsg;
	int sampRate = pEncMsg->getSamplingRate();
	int channels = pEncMsg->getNumberOfChannels();
	
	if (sampRate != 8000)
	{
		setErrorString(MIPRTPULAWENCODER_ERRSTR_BADSAMPLINGRATE);
		return false;
	}
	if (channels != 1)
	{
		setErrorString(MIPRTPULAWENCODER_ERRSTR_BADCHANNELS);
		return false;
	}
	
	const void *pData = pEncMsg->getData();
	bool marker = false;
	size_t length = pEncMsg->getDataLength();
	uint8_t *pPayload = new uint8_t [length];

	memcpy(pPayload,pData,length);

	MIPRTPSendMessage *pNewMsg;

	pNewMsg = new MIPRTPSendMessage(pPayload,length,getPayloadType(),marker,pEncMsg->getNumberOfFrames());
	pNewMsg->setSamplingInstant(pEncMsg->getTime());
	
	m_messages.push_back(pNewMsg);
	m_msgIt = m_messages.begin();
		
	return true;
}
Esempio n. 29
0
void FullpipeEngine::cleanup() {
	//cleanRecorder();
	clearMessageHandlers();
	clearMessages();
	_globalMessageQueueList->compact();

	for (uint i = 0; i < _globalMessageQueueList->size(); i++)
		delete (*_globalMessageQueueList)[i];

	stopAllSoundStreams();

	delete _origFormat;
}
Esempio n. 30
0
void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* state, unsigned long requestIdentifier)
{
    if (!m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled())
        return;

    if (type == MessageType::Clear) {
        ErrorString error;
        clearMessages(&error);
    }

    bool canGenerateCallStack = !isWorkerAgent() && m_frontendDispatcher;
    addConsoleMessage(adoptPtr(new ConsoleMessage(canGenerateCallStack, source, type, level, message, scriptID, lineNumber, columnNumber, state, requestIdentifier)));
}