From 1e2307df47828339a47a8f492dd2e25c9c2b2d44 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 8 Aug 2013 15:09:20 +0000 Subject: [PATCH] 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 --- retroshare-gui/src/gui/feeds/SecurityItem.cpp | 45 +++++++++---------- retroshare-gui/src/gui/feeds/SecurityItem.ui | 6 +-- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index 8f3e18249..6f53f9e24 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -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! */ } diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.ui b/retroshare-gui/src/gui/feeds/SecurityItem.ui index 3109863c5..9edccd7f3 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.ui +++ b/retroshare-gui/src/gui/feeds/SecurityItem.ui @@ -6,8 +6,8 @@ 0 0 - 776 - 349 + 961 + 402 @@ -285,7 +285,7 @@ :/images/message-mail.png:/images/message-mail.png - QToolButton::MenuButtonPopup + QToolButton::DelayedPopup Qt::ToolButtonTextBesideIcon