コード例 #1
0
void AuthorizationDialog::on_okButton_clicked()
{
	addMessage(getMessageText());

	if (mode == Request)
		currentRequest = new AuthorizationRequest(this, userInfo, getMessageText());

	if (mode == Response)
		currentRequest = new AuthorizationRequest(this, contactInfo.getUserId(), true);

	formBlocker->block(true);
}
コード例 #2
0
void AuthorizationDialog::checkMessages()
{
	if (isInternalChanges)
		return;

	QString messageText = getMessageText();
	if (previousMessage == messageText)
		return;

	isInternalChanges = true;
	isMessageExists = false;
	if (messageText.length() >= 2)
	{
		QHash<int, QString>::const_iterator messageIterator = requestMessages.begin();
		while (messageIterator != requestMessages.end())
		{
			if (messageIterator.value().startsWith(messageText))
			{
				messageEdit->setPlainText(messageIterator.value());
				QTextCursor textCursor = messageEdit->textCursor();
				textCursor.movePosition(QTextCursor::End);
				textCursor.setPosition(messageText.length(), QTextCursor::KeepAnchor);
				messageEdit->setTextCursor(textCursor);

				isMessageExists = true;
				break;
			}
			++messageIterator;
		}
	}
	previousMessage = messageText;
	isInternalChanges = false;
}
コード例 #3
0
void
DtMailEnv::getErrorMessageText()
{
    if (_message == NULL)
    {
        if (_error_minor_code >= DTME_MAXDTME)
          _error_minor_code = DTME_InvalidError;

	_message = getMessageText(
			MailErrorSet, _error_minor_code + 1,
			(char*) error_strings[_error_minor_code]);
    }
    if (_message == NULL)
    {
	_error = DTME_NoMemory;
	_message = strdup(error_strings[_error_minor_code]);
    }
    else
      _message = strdup(_message);
}