mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-09-20 04:44:49 -04:00
Added Friend Request Dialog for SecurityItem
Fixed the horizontal spacers git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5077 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
af48bb9555
commit
70a7d6ce40
8 changed files with 769 additions and 42 deletions
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>476</width>
|
||||
<height>332</height>
|
||||
<height>338</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -170,7 +170,7 @@ border-radius: 10px}</string>
|
|||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "gui/msgs/MessageComposer.h"
|
||||
#include "gui/common/StatusDefs.h"
|
||||
#include "gui/connect/ConfCertDialog.h"
|
||||
#include "gui/connect/FriendRequest.h"
|
||||
#include "gui/common/AvatarDefs.h"
|
||||
|
||||
#include "gui/notifyqt.h"
|
||||
|
@ -52,10 +53,10 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
|
|||
sendmsgButton->setEnabled(false);
|
||||
quickmsgButton->hide();
|
||||
chatButton->hide();
|
||||
addFriendButton->setEnabled(false);
|
||||
removeFriendButton->setEnabled(false);
|
||||
removeFriendButton->hide();
|
||||
peerDetailsButton->setEnabled(false);
|
||||
friendRequesttoolButton->hide();
|
||||
|
||||
/* general ones */
|
||||
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
||||
|
@ -69,9 +70,9 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
|
|||
connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
|
||||
|
||||
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
|
||||
connect(addFriendButton, SIGNAL(clicked()), this, SLOT(addFriend()));
|
||||
connect(removeFriendButton, SIGNAL(clicked()), this, SLOT(removeFriend()));
|
||||
connect(peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails()));
|
||||
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()));
|
||||
|
||||
|
@ -188,8 +189,7 @@ void SecurityItem::updateItem()
|
|||
chatButton->hide();
|
||||
quickmsgButton->hide();
|
||||
|
||||
addFriendButton->setEnabled(false);
|
||||
addFriendButton->show();
|
||||
friendRequesttoolButton->show();
|
||||
removeFriendButton->setEnabled(false);
|
||||
removeFriendButton->hide();
|
||||
peerDetailsButton->setEnabled(false);
|
||||
|
@ -239,15 +239,13 @@ void SecurityItem::updateItem()
|
|||
|
||||
if (details.accept_connection)
|
||||
{
|
||||
addFriendButton->setEnabled(false);
|
||||
addFriendButton->hide();
|
||||
friendRequesttoolButton->hide();
|
||||
removeFriendButton->setEnabled(true);
|
||||
removeFriendButton->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
addFriendButton->setEnabled(true);
|
||||
addFriendButton->show();
|
||||
friendRequesttoolButton->show();
|
||||
removeFriendButton->setEnabled(false);
|
||||
removeFriendButton->hide();
|
||||
}
|
||||
|
@ -305,16 +303,6 @@ void SecurityItem::removeItem()
|
|||
|
||||
/*********** SPECIFIC FUNCTIOSN ***********************/
|
||||
|
||||
void SecurityItem::addFriend()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "SecurityItem::addFriend()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
ConfCertDialog::showIt(mGpgId, ConfCertDialog::PageTrust);
|
||||
}
|
||||
|
||||
void SecurityItem::removeFriend()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
|
@ -328,6 +316,17 @@ void SecurityItem::removeFriend()
|
|||
}
|
||||
}
|
||||
|
||||
void SecurityItem::friendRequest()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "SecurityItem::friendReguest()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
FriendRequest *frDlg = new FriendRequest(mGpgId);
|
||||
frDlg->show();
|
||||
}
|
||||
|
||||
void SecurityItem::peerDetails()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
|
|
|
@ -50,7 +50,7 @@ private slots:
|
|||
void removeItem();
|
||||
void toggle();
|
||||
|
||||
void addFriend();
|
||||
void friendRequest();
|
||||
void removeFriend();
|
||||
void peerDetails();
|
||||
void sendMsg();
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>709</width>
|
||||
<height>338</height>
|
||||
<width>776</width>
|
||||
<height>340</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
|
@ -159,6 +159,29 @@ border-radius: 10px}</string>
|
|||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QToolButton" name="friendRequesttoolButton">
|
||||
<property name="text">
|
||||
<string>Accept Friend Request</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/user/user_request48.png</normaloff>:/images/user/user_request48.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="peerDetailsButton">
|
||||
<property name="text">
|
||||
|
@ -193,23 +216,6 @@ border-radius: 10px}</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="addFriendButton">
|
||||
<property name="text">
|
||||
<string>Make friend</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/user/add_user16.png</normaloff>:/images/user/add_user16.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
|
@ -272,6 +278,19 @@ border-radius: 10px}</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="expandButton">
|
||||
<property name="sizePolicy">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue