mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
Change Lobby Send button tooltip.
This commit is contained in:
parent
718d6f9b19
commit
45f77def2b
1 changed files with 11 additions and 5 deletions
|
@ -1102,15 +1102,21 @@ void ChatWidget::updateLenOfChatTextEdit()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool msgToLarge = false;
|
int charRemains = 0;
|
||||||
if (maxMessageSize > 0) {
|
if (maxMessageSize > 0) {
|
||||||
msgToLarge = (msg.length() >= maxMessageSize);
|
charRemains = maxMessageSize - msg.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->sendButton->setEnabled(!msgToLarge);
|
ui->sendButton->setEnabled(charRemains>=0);
|
||||||
text = tr("%1This message consists of %2 characters.").arg(msgToLarge ? tr("Warning:")+" " : "").arg(msg.length());
|
if (charRemains>0)
|
||||||
|
text = tr("It remains %1 characters\nafter HTML conversion.").arg(charRemains);
|
||||||
|
else if(charRemains<0)
|
||||||
|
text = tr("Warning: This message is too big of %1 characters\nafter HTML conversion.").arg((0-charRemains));
|
||||||
|
else
|
||||||
|
text = "";
|
||||||
|
|
||||||
ui->sendButton->setToolTip(text);
|
ui->sendButton->setToolTip(text);
|
||||||
ui->chatTextEdit->setToolTip(msgToLarge?text:"");
|
ui->chatTextEdit->setToolTip(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWidget::sendChat()
|
void ChatWidget::sendChat()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue