Clean up Peer and SecurityItem feeds

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7732 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-12-06 15:29:41 +00:00
parent b11459329b
commit 4cbc6c1cdb
4 changed files with 16 additions and 150 deletions

View file

@ -47,7 +47,6 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId,
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
messageframe->setVisible(false);
sendmsgButton->setEnabled(false);
/* general ones */
@ -56,20 +55,10 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId,
/* specific ones */
connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) );
connect( actionNew_Message, SIGNAL( triggered( ) ), this, SLOT( sendMsg ( void ) ) );
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem()));
QMenu *msgmenu = new QMenu();
msgmenu->addAction(actionNew_Message);
quickmsgButton->setMenu(msgmenu);
avatar->setId(RsPeerId(mPeerId));
expandFrame->hide();
@ -165,7 +154,7 @@ void PeerItem::updateItem()
if (!rsPeers->getPeerDetails(mPeerId, details))
{
chatButton->setEnabled(false);
quickmsgButton->setEnabled(false);
sendmsgButton->setEnabled(false);
return;
}
@ -192,11 +181,11 @@ void PeerItem::updateItem()
chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED);
if (details.state & RS_PEER_STATE_FRIEND)
{
quickmsgButton->setEnabled(true);
sendmsgButton->setEnabled(true);
}
else
{
quickmsgButton->setEnabled(false);
sendmsgButton->setEnabled(false);
}
}
@ -305,41 +294,3 @@ void PeerItem::openChat()
}
}
void PeerItem::togglequickmessage()
{
if (messageframe->isHidden())
{
messageframe->setVisible(true);
}
else
{
messageframe->setVisible(false);
}
}
void PeerItem::sendMessage()
{
/* construct a message */
MessageInfo mi;
mi.title = tr("Quick Message").toUtf8().constData();
mi.msg = quickmsgText->toHtml().toUtf8().constData();
mi.rspeerid_msgto.push_back(mPeerId);
rsMsgs->MessageSend(mi);
quickmsgText->clear();
messageframe->setVisible(false);
}
void PeerItem::on_quickmsgText_textChanged()
{
if (quickmsgText->toPlainText().isEmpty())
{
sendmsgButton->setEnabled(false);
}
else
{
sendmsgButton->setEnabled(true);
}
}