Enable/disable the send button for quick message in the ChatMsgItem with textChanged signal of the QTextBrowser and not with updateItem.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3460 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-09-08 19:04:24 +00:00
parent 2fa6afd36d
commit cb1bee3318
2 changed files with 21 additions and 19 deletions

View File

@ -60,7 +60,6 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
updateItemStatic();
@ -129,15 +128,6 @@ void ChatMsgItem::updateItem()
}
}
/*if (quickmsgText->toPlainText().isEmpty())
{
sendButton->setEnabled(false);
}
else
{
sendButton->setEnabled(true);
}*/
/* slow Tick */
int msec_rate = 10129;
@ -285,3 +275,15 @@ void ChatMsgItem::sendMessage()
messageframe->setVisible(false);
sendButton->hide();
}
void ChatMsgItem::on_quickmsgText_textChanged()
{
if (quickmsgText->toPlainText().isEmpty())
{
sendButton->setEnabled(false);
}
else
{
sendButton->setEnabled(true);
}
}

View File

@ -43,8 +43,8 @@ public:
private slots:
/* default stuff */
void gotoHome();
void removeItem();
void gotoHome();
void removeItem();
void sendMsg();
void openChat();
@ -55,10 +55,12 @@ private slots:
void togglequickmessage();
void sendMessage();
private:
void insertChat(std::string &message);
void on_quickmsgText_textChanged();
FeedHolder *mParent;
private:
void insertChat(std::string &message);
FeedHolder *mParent;
uint32_t mFeedId;
std::string mPeerId;
@ -66,7 +68,5 @@ private:
bool mIsHome;
};
#endif