async chat disabled by default in GUI

Chat GUI is not ready to show properly GxsTrans async messages
This commit is contained in:
Gioacchino Mazzurco 2017-05-30 15:43:43 +02:00
parent bd1edbcd25
commit 5c71d520fa
3 changed files with 30 additions and 6 deletions

View file

@ -73,7 +73,7 @@
*****/
ChatWidget::ChatWidget(QWidget *parent) :
QWidget(parent), ui(new Ui::ChatWidget)
QWidget(parent), sendingBlocked(false), ui(new Ui::ChatWidget)
{
ui->setupUi(this);
@ -416,9 +416,20 @@ ChatWidget::ChatType ChatWidget::chatType()
return CHATTYPE_UNKNOWN;
}
void ChatWidget::blockSending(QString msg) { ui->sendButton->setToolTip(msg); }
void ChatWidget::blockSending(QString msg)
{
#ifndef RS_ASYNC_CHAT
sendingBlocked = true;
ui->sendButton->setEnabled(false);
#endif
ui->sendButton->setToolTip(msg);
}
void ChatWidget::unblockSending() { updateLenOfChatTextEdit(); }
void ChatWidget::unblockSending()
{
sendingBlocked = false;
updateLenOfChatTextEdit();
}
void ChatWidget::processSettings(bool load)
{
@ -1130,6 +1141,8 @@ void ChatWidget::updateStatusTyping()
void ChatWidget::updateLenOfChatTextEdit()
{
if(sendingBlocked) return;
QTextEdit *chatWidget = ui->chatTextEdit;
QString text;
RsHtml::optimizeHtml(chatWidget, text);