MessageComposer: Set the color of the edittext back to standard on adding a new friend as recipient.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3556 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-09-28 23:16:50 +00:00
parent d3fc7f3982
commit 4c835472d6

View File

@ -1128,7 +1128,6 @@ void MessageComposer::setRecipientToRow(int row, enumType type, std::string id,
QString objectName = "lineEdit" + QString::number(row); QString objectName = "lineEdit" + QString::number(row);
lineEdit->setObjectName(objectName); lineEdit->setObjectName(objectName);
lineEdit->setStyleSheet(QString(STYLE_NORMAL).arg(objectName));
lineEdit->setCompleter(m_completer); lineEdit->setCompleter(m_completer);
@ -1149,6 +1148,7 @@ void MessageComposer::setRecipientToRow(int row, enumType type, std::string id,
name = GroupDefs::name(groupInfo); name = GroupDefs::name(groupInfo);
} else { } else {
name = tr("Unknown"); name = tr("Unknown");
id.clear();
} }
} else { } else {
RsPeerDetails details; RsPeerDetails details;
@ -1163,6 +1163,7 @@ void MessageComposer::setRecipientToRow(int row, enumType type, std::string id,
} else { } else {
icon = QIcon(StatusDefs::imageUser(RS_STATUS_OFFLINE)); icon = QIcon(StatusDefs::imageUser(RS_STATUS_OFFLINE));
name = tr("Unknown friend"); name = tr("Unknown friend");
id.clear();
} }
} }
} }
@ -1170,6 +1171,11 @@ void MessageComposer::setRecipientToRow(int row, enumType type, std::string id,
comboBox->setCurrentIndex(comboBox->findData(type, Qt::UserRole)); comboBox->setCurrentIndex(comboBox->findData(type, Qt::UserRole));
lineEdit->setText(name); lineEdit->setText(name);
if (id.empty()) {
lineEdit->setStyleSheet(QString(STYLE_FAIL).arg(lineEdit->objectName()));
} else {
lineEdit->setStyleSheet(QString(STYLE_NORMAL).arg(lineEdit->objectName()));
}
QTableWidgetItem *item = new QTableWidgetItem(icon, "", 0); QTableWidgetItem *item = new QTableWidgetItem(icon, "", 0);
item->setFlags(Qt::NoItemFlags); item->setFlags(Qt::NoItemFlags);