removed quick message menu and replaced message writing so that it runs a distant message. This is most likely to be needed if the peer is not a friend or can not be connected anyway

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6566 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-08-08 15:09:20 +00:00
parent 9cd2f19d6e
commit 1e2307df47
2 changed files with 24 additions and 27 deletions

View File

@ -66,22 +66,22 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
/* specific ones */
connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) );
connect( actionNew_Message, SIGNAL( triggered( ) ), this, SLOT( sendMsg ( 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( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
// connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect( removeFriendButton, SIGNAL(clicked()), this, SLOT(removeFriend()));
connect( peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails()));
connect( friendRequesttoolButton, SIGNAL(clicked()), this, SLOT(friendRequest()));
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem()));
QMenu *msgmenu = new QMenu();
msgmenu->addAction(actionNew_Message);
quickmsgButton->setMenu(msgmenu);
//QMenu *msgmenu = new QMenu();
//msgmenu->addAction(actionNew_Message);
//quickmsgButton->setMenu(msgmenu);
avatar->setId(mSslId, false);
@ -173,7 +173,7 @@ void SecurityItem::updateItem()
if (!rsPeers->getPeerDetails(mSslId, details))
{
/* then gpgid */
if (!rsPeers->getPeerDetails(mGpgId, details))
if(!rsPeers->getPeerDetails(mGpgId, details))
{
/* it is very likely that we will end up here for some of the
* Unknown peer cases.... so allow them here
@ -195,10 +195,9 @@ void SecurityItem::updateItem()
quickmsgButton->hide();
requestLabel->hide();
removeFriendButton->setEnabled(false);
removeFriendButton->hide();
peerDetailsButton->setEnabled(false);
removeFriendButton->setEnabled(false);
removeFriendButton->hide();
peerDetailsButton->setEnabled(false);
return;
}
@ -258,14 +257,7 @@ void SecurityItem::updateItem()
removeFriendButton->hide();
}
if (details.state & RS_PEER_STATE_FRIEND)
{
quickmsgButton->show();
}
else
{
quickmsgButton->hide();
}
quickmsgButton->show();
}
/* slow Tick */
@ -374,9 +366,14 @@ void SecurityItem::sendMsg()
return;
}
nMsgDialog->addRecipient(MessageComposer::TO, mGpgId, false);
nMsgDialog->show();
nMsgDialog->activateWindow();
std::string hash ;
if(rsMsgs->getDistantMessageHash(mGpgId,hash))
{
nMsgDialog->addRecipient(MessageComposer::TO, hash, mGpgId);
nMsgDialog->show();
nMsgDialog->activateWindow();
}
/* window will destroy itself! */
}

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>776</width>
<height>349</height>
<width>961</width>
<height>402</height>
</rect>
</property>
<layout class="QGridLayout">
@ -285,7 +285,7 @@
<normaloff>:/images/message-mail.png</normaloff>:/images/message-mail.png</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
<enum>QToolButton::DelayedPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>