Example #1
0
/** Constructor */
SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, std::string gpgId, std::string sslId, uint32_t type, bool isHome)
:QWidget(NULL), mParent(parent), mFeedId(feedId),
	mSslId(sslId), mGpgId(gpgId), mType(type), mIsHome(isHome)
{
    /* Invoke the Qt Designer generated object setup routine */
    setupUi(this);
  
    messageframe->setVisible(false);
    sendmsgButton->setEnabled(false);
    quickmsgButton->setEnabled(false);
    chatButton->setEnabled(false);
    addFriendButton->setEnabled(false);
    removeFriendButton->setEnabled(false);
    removeFriendButton->hide();
    peerDetailsButton->setEnabled(false);

    /* general ones */
    connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
    connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );

    /* 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(addFriendButton, SIGNAL(clicked()), this, SLOT(addFriend()));
    connect(removeFriendButton, SIGNAL(clicked()), this, SLOT(removeFriend()));
    connect(peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails()));

    connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem()));

    QMenu *msgmenu = new QMenu();
    msgmenu->addAction(actionNew_Message);

    quickmsgButton->setMenu(msgmenu);

    avatar->setId(mSslId, false);

    small();
    updateItemStatic();
    updateItem();
}
Example #2
0
/** Constructor */
SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const RsPgpId &gpgId, const RsPeerId &sslId, const std::string &sslCn, const std::string& ip_address,uint32_t type, bool isHome) :
    FeedItem(NULL), mParent(parent), mFeedId(feedId),
    mGpgId(gpgId), mSslId(sslId), mSslCn(sslCn), mIP(ip_address), mType(type), mIsHome(isHome)
{
	/* Invoke the Qt Designer generated object setup routine */
	setupUi(this);

	//quickmsgButton->hide();
	chatButton->hide();
	removeFriendButton->setEnabled(false);
	removeFriendButton->hide();
	peerDetailsButton->setEnabled(false);
	friendRequesttoolButton->hide();
	requestLabel->hide();

	/* general ones */
	connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
	connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );

	/* specific ones */
	connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) );

	//connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );

	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()));

    avatar->setId(ChatId(mSslId));

	expandFrame->hide();

	updateItemStatic();
	updateItem();
}
Example #3
0
void SecurityIpItem::setup()
{
	/* Invoke the Qt Designer generated object setup routine */
	ui->setupUi(this);

	ui->peerDetailsButton->setEnabled(false);

	/* general ones */
	connect(ui->expandButton, SIGNAL(clicked(void)), this, SLOT(toggle(void)));
	connect(ui->clearButton, SIGNAL(clicked(void)), this, SLOT(removeItem(void)));

	/* specific ones */
	connect(ui->peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails()));
	connect(ui->rsBanListButton, SIGNAL(banListChanged(QString)), this, SLOT(banIpListChanged(QString)));

	ui->avatar->setId(ChatId(mSslId));
	ui->rsBanListButton->setMode(RsBanListToolButton::LIST_WHITELIST, RsBanListToolButton::MODE_ADD);
	ui->rsBanListChangedLabel->hide();

	ui->expandFrame->hide();

	updateItemStatic();
	updateItem();
}