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

View File

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