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) : ChatWidget::ChatWidget(QWidget *parent) :
QWidget(parent), ui(new Ui::ChatWidget) QWidget(parent), sendingBlocked(false), ui(new Ui::ChatWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -416,9 +416,20 @@ ChatWidget::ChatType ChatWidget::chatType()
return CHATTYPE_UNKNOWN; 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) void ChatWidget::processSettings(bool load)
{ {
@ -1130,6 +1141,8 @@ void ChatWidget::updateStatusTyping()
void ChatWidget::updateLenOfChatTextEdit() void ChatWidget::updateLenOfChatTextEdit()
{ {
if(sendingBlocked) return;
QTextEdit *chatWidget = ui->chatTextEdit; QTextEdit *chatWidget = ui->chatTextEdit;
QString text; QString text;
RsHtml::optimizeHtml(chatWidget, text); RsHtml::optimizeHtml(chatWidget, text);

View File

@ -36,7 +36,6 @@
#include <retroshare/rsmsgs.h> #include <retroshare/rsmsgs.h>
#include <retroshare/rsfiles.h> #include <retroshare/rsfiles.h>
#include <util/rsdeprecate.h>
class QAction; class QAction;
class QTextEdit; class QTextEdit;
@ -79,8 +78,9 @@ public:
ChatId getChatId(); ChatId getChatId();
ChatType chatType(); ChatType chatType();
RS_DEPRECATED void blockSending(QString msg); // allow/disallow sendng of messages
RS_DEPRECATED void unblockSending(); void blockSending(QString msg);
void unblockSending();
bool hasNewMessages() { return newMessages; } bool hasNewMessages() { return newMessages; }
bool isTyping() { return typing; } bool isTyping() { return typing; }
@ -216,6 +216,8 @@ private:
bool typing; bool typing;
int peerStatus; int peerStatus;
bool sendingBlocked;
time_t lastStatusSendTime; time_t lastStatusSendTime;
ChatStyle chatStyle; ChatStyle chatStyle;

View File

@ -70,6 +70,12 @@ rs_nocppwarning:CONFIG -= no_rs_nocppwarning
CONFIG *= rs_gxs_trans CONFIG *= rs_gxs_trans
#no_rs_gxs_trans:CONFIG -= rs_gxs_trans ## Disabing not supported ATM #no_rs_gxs_trans:CONFIG -= rs_gxs_trans ## Disabing not supported ATM
# To enable GXS based async chat append the following assignation to qmake
# command line "CONFIG+=rs_async_chat"
CONFIG *= no_rs_async_chat
rs_async_chat:CONFIG -= no_rs_async_chat
unix { unix {
isEmpty(PREFIX) { PREFIX = "/usr" } isEmpty(PREFIX) { PREFIX = "/usr" }
@ -197,3 +203,6 @@ rs_gxs_trans {
} }
} }
rs_async_chat {
DEFINES *= RS_ASYNC_CHAT
}