Added Cancel Buttons for Chat and Peer feed Items, and disable the Send Buttons by default, added for PeerItem to check if TextEdit is empty or not too.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3462 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-09-08 22:46:26 +00:00
parent a66816ff33
commit 87d2cec44c
5 changed files with 308 additions and 257 deletions

View file

@ -50,6 +50,8 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId
messageframe->setVisible(false);
sendButton->hide();
cancelButton->hide();
sendButton->setEnabled(false);
/* general ones */
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
@ -58,6 +60,7 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId
connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) );
connect( msgButton, SIGNAL( clicked( void ) ), this, SLOT( sendMsg ( void ) ) );
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
@ -251,11 +254,13 @@ void ChatMsgItem::togglequickmessage()
{
messageframe->setVisible(true);
sendButton->show();
cancelButton->show();
}
else
{
messageframe->setVisible(false);
sendButton->hide();
cancelButton->hide();
}
}
@ -274,6 +279,7 @@ void ChatMsgItem::sendMessage()
quickmsgText->clear();
messageframe->setVisible(false);
sendButton->hide();
cancelButton->hide();
}
void ChatMsgItem::on_quickmsgText_textChanged()