예제 #1
0
void ChatLobbyWidget::lobbyTreeWidgetCostumPopupMenu()
{
	QTreeWidgetItem *item = lobbyTreeWidget->currentItem();

	QMenu contextMnu(this);

	if (item && item->type() == TYPE_FOLDER) {
		QAction *action = contextMnu.addAction(QIcon(IMAGE_CREATE), tr("Create chat lobby"), this, SLOT(createChatLobby()));
		action->setData(item->data(COLUMN_DATA, ROLE_PRIVACYLEVEL).toInt());
	}

	if (item && item->type() == TYPE_LOBBY) {
		if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool()) {
			contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe"), this, SLOT(unsubscribeItem()));
		} else {
			contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe"), this, SLOT(subscribeItem()));
		}
	}

	if (contextMnu.children().count() == 0) {
		return;
	}

	contextMnu.exec(QCursor::pos());
}
예제 #2
0
void ProfileView::fileCustomPopupMenu( QPoint /*point*/ )
{
      QMenu contextMnu( this );

      QAction *downloadAct = NULL;
      QAction *downloadAllAct = NULL;
      QAction *removeAct = NULL;
      QAction *clearAct = NULL;

      if (mIsOwnId)
      {
        removeAct = new QAction( tr( "Remove Favourite" ), this );
      	clearAct = new QAction( tr( "Clear Favourites" ), this );
      	connect( removeAct , SIGNAL( triggered() ), this, SLOT( fileRemove() ) );
      	connect( clearAct , SIGNAL( triggered() ), this, SLOT( filesClear() ) );

        contextMnu.addAction( clearAct );
        contextMnu.addAction( removeAct );
      }
      else
      {
      	downloadAct = new QAction( tr( "Download File" ), this );
      	downloadAllAct = new QAction( tr( "Download All" ), this );
      	connect( downloadAct , SIGNAL( triggered() ), this, SLOT( fileDownload() ) );
      	connect( downloadAllAct , SIGNAL( triggered() ), this, SLOT( filesDownloadAll() ) );

        contextMnu.addAction( downloadAct );
        contextMnu.addAction( downloadAllAct );
      }

      contextMnu.exec(QCursor::pos());
}
예제 #3
0
void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
{
	QList<QTreeWidgetItem*> selectedItems = ui.participantsList->selectedItems();

	QMenu contextMnu(this);

	contextMnu.addAction(muteAct);
	muteAct->setCheckable(true);
	muteAct->setEnabled(false);
	muteAct->setChecked(false);
	if (selectedItems.size()) {

        std::string nickName;
        rsMsgs->getNickNameForChatLobby(lobbyId, nickName);
        if(selectedItems.count()>1 || (selectedItems.at(0)->text(COLUMN_NAME).toStdString()!=nickName))
        {
		muteAct->setEnabled(true);

		QList<QTreeWidgetItem*>::iterator item;
		for (item = selectedItems.begin(); item != selectedItems.end(); ++item) {
			if (isParticipantMuted((*item)->text(COLUMN_NAME))) {
				muteAct->setChecked(true);
				break;
			}
		}
	}
    }

	contextMnu.exec(QCursor::pos());
}
예제 #4
0
void WikiDialog::groupListCustomPopupMenu(QPoint /*point*/)
{

	int subscribeFlags = ui.groupTreeWidget->subscribeFlags(QString::fromStdString(mGroupId));

	QMenu contextMnu(this);

	std::cerr << "WikiDialog::groupListCustomPopupMenu()";
	std::cerr << std::endl;
	std::cerr << "    mGroupId: " << mGroupId;
	std::cerr << std::endl;
	std::cerr << "    subscribeFlags: " << subscribeFlags;
	std::cerr << std::endl;
	std::cerr << "    IS_GROUP_SUBSCRIBED(): " << IS_GROUP_SUBSCRIBED(subscribeFlags);
	std::cerr << std::endl;
	std::cerr << "    IS_GROUP_ADMIN(): " << IS_GROUP_ADMIN(subscribeFlags);
	std::cerr << std::endl;
	std::cerr << std::endl;

	QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe to Group"), this, SLOT(subscribeToGroup()));
	action->setDisabled (mGroupId.empty() || IS_GROUP_SUBSCRIBED(subscribeFlags));

	action = contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe to Group"), this, SLOT(unsubscribeToGroup()));
	action->setEnabled (!mGroupId.empty() && IS_GROUP_SUBSCRIBED(subscribeFlags));

	contextMnu.addSeparator();

	action = contextMnu.addAction(QIcon(IMAGE_INFO), tr("Show Wiki Group"), this, SLOT(showGroupDetails()));
	action->setEnabled (!mGroupId.empty ());

	action = contextMnu.addAction(QIcon(IMAGE_EDIT), tr("Edit Wiki Group"), this, SLOT(editGroupDetails()));
	action->setEnabled (!mGroupId.empty() && IS_GROUP_ADMIN(subscribeFlags));

	/************** NOT ENABLED YET *****************/

	//if (!Settings->getForumOpenAllInNewTab()) {
	//	action = contextMnu.addAction(QIcon(""), tr("Open in new tab"), this, SLOT(openInNewTab()));
	//	if (mForumId.empty() || forumThreadWidget(mForumId)) {
	//		action->setEnabled(false);
	//	}
	//}

	//QAction *shareKeyAct = new QAction(QIcon(":/images/gpgp_key_generate.png"), tr("Share Forum"), &contextMnu);
	//connect( shareKeyAct, SIGNAL( triggered() ), this, SLOT( shareKey() ) );
	//shareKeyAct->setEnabled(!mForumId.empty() && IS_GROUP_ADMIN(subscribeFlags));
	//contextMnu.addAction( shareKeyAct);

	//QAction *restoreKeysAct = new QAction(QIcon(":/images/settings16.png"), tr("Restore Publish Rights for Forum" ), &contextMnu);
	//connect( restoreKeysAct , SIGNAL( triggered() ), this, SLOT( restoreForumKeys() ) );
	//restoreKeysAct->setEnabled(!mForumId.empty() && !IS_GROUP_ADMIN(subscribeFlags));
	//contextMnu.addAction( restoreKeysAct);

	//action = contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyForumLink()));
	//action->setEnabled(!mForumId.empty());

	//contextMnu.addSeparator();

	contextMnu.exec(QCursor::pos());
}
예제 #5
0
void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
{
	if (!rsPeers) return; /* not ready yet! */

	QModelIndex idx = ui.dirTreeView->indexAt(point) ;
	if (!idx.isValid()) return ;

	QModelIndex midx = proxyModel->mapToSource(idx) ;
	if (!midx.isValid()) return ;


	currentFile = model->data(midx, RetroshareDirModel::FileNameRole).toString() ;
	int type = model->getType(midx) ;
	if (type != DIR_TYPE_DIR && type != DIR_TYPE_FILE) return;

	QMenu contextMnu(this) ;

	bool bIsRsColl = currentFile.endsWith(RsCollectionFile::ExtensionString);
	collCreateAct->setEnabled(true);
	collModifAct->setEnabled(bIsRsColl);
	collViewAct->setEnabled(bIsRsColl);
	collOpenAct->setEnabled(true);

	QMenu collectionMenu(tr("Collection"), this);
	collectionMenu.setIcon(QIcon(IMAGE_LIBRARY));
	collectionMenu.addAction(collCreateAct);
	collectionMenu.addAction(collModifAct);
	collectionMenu.addAction(collViewAct);
	collectionMenu.addAction(collOpenAct);

	switch (type) {
		case DIR_TYPE_DIR :
			contextMnu.addAction(openfolderAct) ;
			contextMnu.addSeparator() ;//------------------------------------
			contextMnu.addMenu(&collectionMenu) ;
		break ;

		case DIR_TYPE_FILE :
			contextMnu.addAction(openfileAct) ;
			contextMnu.addSeparator() ;//------------------------------------
			contextMnu.addAction(copylinkAct) ;
			contextMnu.addAction(sendlinkAct) ;
			contextMnu.addSeparator() ;//------------------------------------
			contextMnu.addMenu(&collectionMenu) ;
			contextMnu.addSeparator() ;//------------------------------------
#ifdef RS_USE_LINKS
			contextMnu.addAction(sendlinkCloudAct) ;
			contextMnu.addAction(addlinkCloudAct) ;
			contextMnu.addSeparator() ;//------------------------------------
#endif
			contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg())) ;
		break ;

		default :
		return ;
	}//switch (type)

	contextMnu.exec(QCursor::pos()) ;
}
예제 #6
0
void MessageWidget::msgfilelistWidgetCostumPopupMenu( QPoint /*point*/ )
{
	QMenu contextMnu(this);

	contextMnu.addAction(QIcon(IMAGE_DOWNLOAD), tr("Download"), this, SLOT(getcurrentrecommended()));
	contextMnu.addAction(QIcon(IMAGE_DOWNLOADALL), tr("Download all"), this, SLOT(getallrecommended()));

	contextMnu.exec(QCursor::pos());
}
예제 #7
0
void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint /*point*/ )
{
    //std::cerr << "NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point ) called" << std::endl;
    QTreeWidgetItem *wi = getCurrentNeighbour();
    if (!wi)
    	return;

	QMenu contextMnu( this );

	std::string peer_id = wi->text(COLUMN_PEERID).toStdString() ;

    // That's what context menus are made for
		RsPeerDetails detail;
        if(!rsPeers->getGPGDetails(peer_id, detail))		// that is not suppose to fail.
			return ;

		if(peer_id != rsPeers->getGPGOwnId())
		{
			if(detail.accept_connection)
			{
				QAction* denyFriendAct = new QAction(QIcon(IMAGE_DENIED), tr( "Deny friend" ), &contextMnu );

				connect( denyFriendAct , SIGNAL( triggered() ), this, SLOT( denyFriend() ) );
				contextMnu.addAction( denyFriendAct);
			}
			else	// not a friend
			{
				QAction* makefriendAct = new QAction(QIcon(IMAGE_MAKEFRIEND), tr( "Make friend" ), &contextMnu );

				connect( makefriendAct , SIGNAL( triggered() ), this, SLOT( makeFriend() ) );
				contextMnu.addAction( makefriendAct);
#ifdef TODO
				if(detail.validLvl > RS_TRUST_LVL_MARGINAL)		// it's a denied old friend.
				{
					QAction* deleteCertAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Delete certificate" ), &contextMnu );
					connect( deleteCertAct, SIGNAL( triggered() ), this, SLOT( deleteCert() ) );
					contextMnu.addAction( deleteCertAct );
				}

#endif
			}
		}
		if(peer_id == rsPeers->getGPGOwnId())
		{
			QAction* exportcertAct = new QAction(QIcon(IMAGE_EXPORT), tr( "Export my Cert" ), &contextMnu );
		    connect( exportcertAct , SIGNAL( triggered() ), this, SLOT( on_actionExportKey_activated() ) );
		    contextMnu.addAction( exportcertAct);
		}

		QAction* peerdetailsAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Peer details..." ), &contextMnu );
		connect( peerdetailsAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) );
		contextMnu.addAction( peerdetailsAct);

		contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyLink()));

		contextMnu.exec(QCursor::pos());
}
예제 #8
0
void CreateCircleDialog::MembershipListCustomPopupMenu( QPoint )
{
	QMenu contextMnu( this );

	QTreeWidgetItem *item = ui.treeWidget_membership->currentItem();
	if (item && !mReadOnly)
			contextMnu.addAction(QIcon(":/images/delete.png"), tr("Remove Member"), this, SLOT(removeMember()));

	contextMnu.exec(QCursor::pos());
}
예제 #9
0
void IdDialog::IdListCustomPopupMenu( QPoint )
{
	QMenu contextMnu( this );


	std::list<RsGxsId> own_identities ;
	rsIdentity->getOwnIds(own_identities) ;

	QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
	if (item) {
		uint32_t item_flags = item->data(RSID_COL_KEYID,Qt::UserRole).toUInt() ;

		if(!(item_flags & RSID_FILTER_OWNED_BY_YOU))
		{
			if(own_identities.size() <= 1)
			{
				QAction *action = contextMnu.addAction(QIcon(":/images/chat_24.png"), tr("Chat with this person"), this, SLOT(chatIdentity()));

				if(own_identities.empty())
					action->setEnabled(false) ;
				else
					action->setData(QString::fromStdString((own_identities.front()).toStdString())) ;
			}
			else
			{
				QMenu *mnu = contextMnu.addMenu(QIcon(":/images/chat_24.png"),tr("Chat with this person as...")) ;

				for(std::list<RsGxsId>::const_iterator it=own_identities.begin();it!=own_identities.end();++it)
				{
					RsIdentityDetails idd ;
					rsIdentity->getIdDetails(*it,idd) ;

					QPixmap pixmap ;

					if(idd.mAvatar.mSize == 0 || !pixmap.loadFromData(idd.mAvatar.mData, idd.mAvatar.mSize, "PNG"))
						pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(*it)) ;

					QAction *action = mnu->addAction(QIcon(pixmap), QString("%1 (%2)").arg(QString::fromUtf8(idd.mNickname.c_str()), QString::fromStdString((*it).toStdString())), this, SLOT(chatIdentity()));
					action->setData(QString::fromStdString((*it).toStdString())) ;
				}
			}

			contextMnu.addAction(QIcon(":/images/mail_new.png"), tr("Send message to this person"), this, SLOT(sendMsg()));
		}
	}

	contextMnu.addSeparator();

	contextMnu.addAction(ui->editIdentity);
	contextMnu.addAction(ui->removeIdentity);
	
	contextMnu.addSeparator();

	contextMnu.exec(QCursor::pos());
}
예제 #10
0
void PhotoDialog::photoTreeWidgetCustomPopupMenu( QPoint point )
{

      QMenu contextMnu( this );
      QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
      
      QAction *openphotoAct = new QAction(QIcon(":/images/openimage.png"), tr( "Open" ), this );
      openphotoAct->setShortcut(Qt::CTRL + Qt::Key_O);
      connect( openphotoAct , SIGNAL( triggered(QTreeWidgetItem * , int) ), this, SLOT( showPhoto( QTreeWidgetItem *, int ) ) );

      QAction *removephotoAct = new QAction(QIcon(IMAGE_REMOVE), tr( "Remove" ), this );
      removephotoAct->setShortcut(Qt::Key_Delete);
      connect( removephotoAct , SIGNAL( triggered() ), this, SLOT( removePhoto() ) );
      
      rateExcellenAct = new QAction(QIcon(":/images/rate-5.png"), tr("Excellent"), this);
      rateExcellenAct->setShortcut(Qt::CTRL + Qt::Key_5);
      connect(rateExcellenAct, SIGNAL(triggered()), this, SLOT(rateExcellent()));
      
      rateGoodAct = new QAction(QIcon(":/images/rate-4.png"), tr("Good"), this);
      rateGoodAct->setShortcut(Qt::CTRL + Qt::Key_4);
      connect(rateGoodAct, SIGNAL(triggered()), this, SLOT(rateGood()));
      
      rateAverageAct = new QAction(QIcon(":/images/rate-3.png"), tr("Average"), this);
      rateAverageAct->setShortcut(Qt::CTRL + Qt::Key_3);
      connect(rateAverageAct, SIGNAL(triggered()), this, SLOT(rateAvarge()));
      
      rateBelowAvarageAct = new QAction(QIcon(":/images/rate-2.png"), tr("Below avarage"), this);
      rateBelowAvarageAct->setShortcut(Qt::CTRL + Qt::Key_2);
      connect(rateBelowAvarageAct, SIGNAL(triggered()), this, SLOT(rateBelowAverage()));      
      
      rateBadAct = new QAction(QIcon(":/images/rate-1.png"), tr("Bad"), this);
      rateBadAct->setShortcut(Qt::CTRL + Qt::Key_1);
      connect(rateBadAct, SIGNAL(triggered()), this, SLOT(rateBad()));
      
      rateUnratedAct = new QAction(tr("Unrated"), this);
      rateUnratedAct->setShortcut(Qt::CTRL + Qt::Key_0);
      connect(rateUnratedAct, SIGNAL(triggered()), this, SLOT(rateUnrated()));
      
      QMenu *ratingMenu = new QMenu(tr("Rating"), this);
      ratingMenu->setIcon(QIcon(":/images/rating.png"));
      ratingMenu->addAction(rateExcellenAct);
      ratingMenu->addAction(rateGoodAct);
      ratingMenu->addAction(rateAverageAct);
      ratingMenu->addAction(rateBelowAvarageAct);
      ratingMenu->addAction(rateBadAct);
      ratingMenu->addAction(rateUnratedAct);

      contextMnu.clear();
      contextMnu.addAction(openphotoAct);
      contextMnu.addSeparator();
      contextMnu.addMenu( ratingMenu);
      contextMnu.addSeparator();
      contextMnu.addAction(removephotoAct); 
      contextMnu.exec( mevent->globalPos() );
}
예제 #11
0
void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
{

      QMenu contextMnu( this );
      QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );

      //showdowninfoAct = new QAction(QIcon(IMAGE_INFO), tr( "Details..." ), this );
      //connect( showdowninfoAct , SIGNAL( triggered() ), this, SLOT( showDownInfoWindow() ) );

      /* check which item is selected 
       * - if it is completed - play should appear in menu 
       */
	std::cerr << "TransfersDialog::downloadListCostumPopupMenu()" << std::endl;

      	bool addPlayOption = false;
	for(int i = 0; i <= DLListModel->rowCount(); i++) {
		std::cerr << "Row Status :" << getStatus(i, DLListModel).toStdString() << ":" << std::endl;
		if(selection->isRowSelected(i, QModelIndex())) {
			std::cerr << "Selected Row Status :" << getStatus(i, DLListModel).toStdString() << ":" << std::endl;
			QString qstatus = getStatus(i, DLListModel);
			std::string status = (qstatus.trimmed()).toStdString();
			if (status == "Complete")
			{
				std::cerr << "Add Play Option" << std::endl;
				addPlayOption = true;
			}
		}
	}

      	QAction *playAct = NULL;
	if (addPlayOption)
	{
      		playAct = new QAction(QIcon(IMAGE_PLAY), tr( "Play" ), this );
      		connect( playAct , SIGNAL( triggered() ), this, SLOT( playSelectedTransfer() ) );
	}

	  cancelAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Cancel" ), this );
      connect( cancelAct , SIGNAL( triggered() ), this, SLOT( cancel() ) );
      
//      clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
//      connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );

      contextMnu.clear();
      if (addPlayOption)
      {
      	contextMnu.addAction(playAct);
      }
      contextMnu.addSeparator();     

      contextMnu.addAction( cancelAct);
      contextMnu.addSeparator();
//      contextMnu.addAction( clearcompletedAct);
      contextMnu.exec( mevent->globalPos() );
}
예제 #12
0
void ProfileManager::identityTreeWidgetCostumPopupMenu(QPoint)
{
	QTreeWidgetItem *item = getCurrentIdentity();

	QMenu contextMnu(this);

	QAction *action = contextMnu.addAction(QIcon(IMAGE_EXPORT), tr("Export Identity"), this, SLOT(exportIdentity()));
	action->setEnabled(item != NULL);

	contextMnu.exec(QCursor::pos());
}
예제 #13
0
void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
{

    QTreeWidgetItem *wi = getCurrentNeighbour();
    if (!wi)
    	return;

//		 return ;

      QMenu contextMnu( this );
      QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
      contextMnu.clear();

		std::string peer_id = wi->text(9).toStdString() ;

			// That's what context menus are made for
		RsPeerDetails detail;
		if(!rsPeers->getPeerDetails(peer_id, detail))		// that is not suppose to fail.
			return ;

		if(peer_id != rsPeers->getOwnId())
			if(detail.state & RS_PEER_STATE_FRIEND)
			{
				denyFriendAct = new QAction(QIcon(IMAGE_DENIED), tr( "Deny friend" ), this );

				connect( denyFriendAct , SIGNAL( triggered() ), this, SLOT( denyFriend() ) );
				contextMnu.addAction( denyFriendAct);
			}
			else	// not a friend
			{
				if(detail.trustLvl > RS_TRUST_LVL_MARGINAL)		// it's a denied old friend.
					makefriendAct = new QAction(QIcon(IMAGE_MAKEFRIEND), tr( "Accept friend" ), this );
				else
					makefriendAct = new QAction(QIcon(IMAGE_MAKEFRIEND), tr( "Make friend" ), this );

				connect( makefriendAct , SIGNAL( triggered() ), this, SLOT( makeFriend() ) );
				contextMnu.addAction( makefriendAct);
#ifdef TODO
				if(detail.trustLvl > RS_TRUST_LVL_MARGINAL)		// it's a denied old friend.
				{
					deleteCertAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Delete certificate" ), this );
					connect( deleteCertAct, SIGNAL( triggered() ), this, SLOT( deleteCert() ) );
					contextMnu.addAction( deleteCertAct );
				}
#endif
			}

		peerdetailsAct = new QAction(QIcon(IMAGE_PEERDETAILS), tr( "Peer details..." ), this );
		connect( peerdetailsAct , SIGNAL( triggered() ), this, SLOT( peerdetails() ) );
		contextMnu.addAction( peerdetailsAct);

		contextMnu.exec( mevent->globalPos() );
}
예제 #14
0
void GlobalRouterStatistics::CustomPopupMenu( QPoint )
{
	QMenu contextMnu( this );
	
	QTreeWidgetItem *item = treeWidget->currentItem();
	if (item) {
	contextMnu.addAction(QIcon(":/images/info16.png"), tr("Details"), this, SLOT(personDetails()));

  }

	contextMnu.exec(QCursor::pos());
}
예제 #15
0
void RemoteSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
{
	if (!rsPeers) return; /* not ready yet! */

	QModelIndex idx = ui.dirTreeView->indexAt(point) ;
	if (!idx.isValid()) return;

	QModelIndex midx = proxyModel->mapToSource(idx) ;
	if (!midx.isValid()) return;

	currentFile = model->data(midx, RetroshareDirModel::FileNameRole).toString() ;
	int type = model->getType(midx) ;
	if (type != DIR_TYPE_DIR && type != DIR_TYPE_FILE) return;


	QMenu contextMnu( this ) ;

	//bool bIsRsColl = currentFile.endsWith(RsCollectionFile::ExtensionString);
	collCreateAct->setEnabled(true);
	//collModifAct->setEnabled(bIsRsColl);
	//collViewAct->setEnabled(bIsRsColl);
	collOpenAct->setEnabled(true);

	QMenu collectionMenu(tr("Collection"), this);
	collectionMenu.setIcon(QIcon(IMAGE_LIBRARY));
	collectionMenu.addAction(collCreateAct);
	//collectionMenu.addAction(collModifAct);
	//collectionMenu.addAction(collViewAct);
	collectionMenu.addAction(collOpenAct);

	QAction *downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), &contextMnu ) ;
	connect( downloadAct , SIGNAL( triggered() ), this, SLOT( downloadRemoteSelected() ) ) ;
	contextMnu.addAction( downloadAct) ;

	if ( type == DIR_TYPE_FILE ) {
		//QAction *copyremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), &contextMnu ) ;
		//connect( copyremotelinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) ) ;

		//QAction *sendremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), &contextMnu ) ;
		//connect( sendremotelinkAct , SIGNAL( triggered() ), this, SLOT( sendremoteLinkTo(  ) ) ) ;

		contextMnu.addSeparator() ;//------------------------------------
		contextMnu.addAction( copylinkAct) ;
		contextMnu.addAction( sendlinkAct) ;
		contextMnu.addSeparator() ;//------------------------------------
		contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg())) ;
	}//if (type == DIR_TYPE_FILE)

	contextMnu.addSeparator() ;//------------------------------------
	contextMnu.addMenu(&collectionMenu) ;

	contextMnu.exec(QCursor::pos()) ;
}
예제 #16
0
void NetworkView::peerCustomPopupMenu( QPoint point )
{

      QMenu contextMnu( this );
      QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );

      //QAction * voteupAct = new QAction(QIcon(IMAGE_EXPIORTFRIEND), tr( "Vote Link Up" ), this );
      //connect( voteupAct , SIGNAL( triggered() ), this, SLOT( voteup() ) );

      contextMnu.clear();
      //contextMnu.addAction(voteupAct);
      contextMnu.exec( mevent->globalPos() );
}
예제 #17
0
void CreateCircleDialog::IdListCustomPopupMenu( QPoint )
{
	QMenu contextMnu( this );

	QTreeWidgetItem *item = ui.treeWidget_IdList->currentItem();
	if (item) {

			contextMnu.addAction(QIcon(":/images/edit_add24.png"), tr("Add Member"), this, SLOT(addMember()));
	
	}

	contextMnu.exec(QCursor::pos());
}
예제 #18
0
void PhotoDialog::peerTreeWidgetCustomPopupMenu( QPoint point )
{

      QMenu contextMnu( this );
      QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );

      QAction *ins = new QAction(QIcon(IMAGE_EXPIORTFRIEND), tr( "Insert Show Lists" ), this );
      connect( ins , SIGNAL( triggered() ), this, SLOT( insertShowLists() ) );

      contextMnu.clear();
      contextMnu.addAction(ins);
      contextMnu.exec( mevent->globalPos() );
}
예제 #19
0
void ShareManager::shareddirListCostumPopupMenu( QPoint point )
{

      QMenu contextMnu( this );
      QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );

      removeAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Remove" ), this );
      connect( removeAct , SIGNAL( triggered() ), this, SLOT( removeShareDirectory() ) );


      contextMnu.clear();
      contextMnu.addAction( removeAct );
      contextMnu.exec( mevent->globalPos() );
}
예제 #20
0
void DhtWindow::DHTCustomPopupMenu( QPoint )
{
	QMenu contextMnu( this );
	
	QTreeWidgetItem *item = ui.dhtTreeWidget->currentItem();
	if (item) {
	
	QString Ip = item->text(DTW_COL_IPADDR);

	contextMnu.addAction(QIcon(), tr("Copy %1 to clipboard").arg(Ip), this, SLOT(copyIP()));

  }

	contextMnu.exec(QCursor::pos());
}
예제 #21
0
void ShareManager::shareddirListCostumPopupMenu( QPoint /*point*/ )
{
    QMenu contextMnu( this );

    QAction *editAct = new QAction(QIcon(IMAGE_EDIT), tr( "Edit" ), &contextMnu );
    connect( editAct , SIGNAL( triggered() ), this, SLOT( editShareDirectory() ) );

    QAction *removeAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Remove" ), &contextMnu );
    connect( removeAct , SIGNAL( triggered() ), this, SLOT( removeShareDirectory() ) );

    contextMnu.addAction( editAct );
    contextMnu.addAction( removeAct );

    contextMnu.exec(QCursor::pos());
}
예제 #22
0
void ImHistoryBrowser::customContextMenuRequested(QPoint /*pos*/)
{
    std::list<uint32_t> msgIds;
    getSelectedItems(msgIds);

    QListWidgetItem *currentItem = ui.listWidget->currentItem();

    QMenu contextMnu(this);

    QAction *selectAll = new QAction(tr("Mark all"), &contextMnu);
    QAction *copyMessage = new QAction(tr("Copy"), &contextMnu);
    QAction *removeMessages = new QAction(tr("Delete"), &contextMnu);
    QAction *clearHistory = new QAction(tr("Clear history"), &contextMnu);

    QAction *sendItem = NULL;
    if (textEdit) {
        sendItem = new QAction(tr("Send"), &contextMnu);
        if (currentItem) {
            connect(sendItem, SIGNAL(triggered()), this, SLOT(sendMessage()));
        } else {
            sendItem->setDisabled(true);
        }
    }

    if (msgIds.size()) {
        connect(selectAll, SIGNAL(triggered()), ui.listWidget, SLOT(selectAll()));
        connect(copyMessage, SIGNAL(triggered()), this, SLOT(copyMessage()));
        connect(removeMessages, SIGNAL(triggered()), this, SLOT(removeMessages()));
        connect(clearHistory, SIGNAL(triggered()), this, SLOT(clearHistory()));
    } else {
        selectAll->setDisabled(true);
        copyMessage->setDisabled(true);
        removeMessages->setDisabled(true);
        clearHistory->setDisabled(true);
    }

    contextMnu.addAction(selectAll);
    contextMnu.addSeparator();
    contextMnu.addAction(copyMessage);
    contextMnu.addAction(removeMessages);
    contextMnu.addAction(clearHistory);
    if (sendItem) {
        contextMnu.addSeparator();
        contextMnu.addAction(sendItem);
    }

    contextMnu.exec(QCursor::pos());
}
예제 #23
0
void ProfileView::profileCustomPopupMenu( QPoint /*point*/ )
{
      if (!mIsOwnId)
      {
      	return;
      }

      QMenu contextMnu( this );

      QAction *editAct = new QAction( tr( "Edit Profile" ), this );
      connect( editAct , SIGNAL( triggered() ), this, SLOT( profileEdit() ) );

      contextMnu.addAction( editAct );

      contextMnu.exec(QCursor::pos());
}
예제 #24
0
void BlogsDialog::blogListCustomPopupMenu( QPoint point )
{
      BlogInfo bi;
      if (!rsBlogs->getBlogInfo(mBlogId, bi))
      {
      return;
      }

      QMenu contextMnu( this );
      
      QAction *createblogpostAct = new QAction(QIcon(":/images/mail_reply.png"), tr( "Post to Blog" ), this );
      connect( createblogpostAct , SIGNAL( triggered() ), this, SLOT( createMsg() ) );
      
      QAction *subscribeblogAct = new QAction(QIcon(":/images/edit_add24.png"), tr( "Subscribe to Blog" ), this );
      connect( subscribeblogAct , SIGNAL( triggered() ), this, SLOT( subscribeBlog() ) );

      QAction *unsubscribeblogAct = new QAction(QIcon(":/images/cancel.png"), tr( "Unsubscribe to Blog" ), this );
      connect( unsubscribeblogAct , SIGNAL( triggered() ), this, SLOT( unsubscribeBlog() ) );
      
      QAction *blogdetailsAct = new QAction(QIcon(":/images/info16.png"), tr( "Show Blog Details" ), this );
      connect( blogdetailsAct , SIGNAL( triggered() ), this, SLOT( showBlogDetails() ) );
      
      contextMnu.clear();

      if (bi.blogFlags & RS_DISTRIB_PUBLISH)
      {
        contextMnu.addAction( createblogpostAct );
        contextMnu.addSeparator();
        contextMnu.addAction( blogdetailsAct );
      }
      else if (bi.blogFlags & RS_DISTRIB_SUBSCRIBED)
      {
        contextMnu.addAction( unsubscribeblogAct );
        contextMnu.addSeparator();
        contextMnu.addAction( blogdetailsAct );;
      }
      else
      {      
        contextMnu.addAction( subscribeblogAct );
        contextMnu.addSeparator();
        contextMnu.addAction( blogdetailsAct );
      }

      contextMnu.exec(QCursor::pos());
}
예제 #25
0
void MessagesDialog::msgfilelistWidgetCostumPopupMenu( QPoint point )
{

      QMenu contextMnu( this );
      QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );

//      getRecAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this );
//      connect( getRecAct , SIGNAL( triggered() ), this, SLOT( getcurrentrecommended() ) );
      
      getAllRecAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "Download All" ), this );
      connect( getAllRecAct , SIGNAL( triggered() ), this, SLOT( getallrecommended() ) );


      contextMnu.clear();
//      contextMnu.addAction( getRecAct);
      contextMnu.addAction( getAllRecAct);
      contextMnu.exec( mevent->globalPos() );
}
예제 #26
0
void ProfileEdit::profileCustomPopupMenu( QPoint /*point*/ )
{
      QMenu contextMnu( this );

      QAction *removeAct = new QAction( tr( "Remove Profile Entry" ), this );
      QAction *moveupAct = new QAction( tr( "Move Profile Entry Up" ), this );
      QAction *movedownAct = new QAction( tr( "Move Profile Entry Down" ), this );

      connect( removeAct , SIGNAL( triggered() ), this, SLOT( profileEntryRemove() ) );
      connect( moveupAct , SIGNAL( triggered() ), this, SLOT( profileEntryMoveUp() ) );
      connect( movedownAct , SIGNAL( triggered() ), this, SLOT( profileEntryMoveDown() ) );

      contextMnu.addAction( removeAct );
      contextMnu.addAction( moveupAct );
      contextMnu.addAction( movedownAct );

      contextMnu.exec(QCursor::pos());
}
예제 #27
0
void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
{
    QList<QTreeWidgetItem*> selectedItems = ui.participantsList->selectedItems();

    QMenu contextMnu(this);

    contextMnu.addAction(distantChatAct);
    contextMnu.addAction(sendMessageAct);
    contextMnu.addSeparator();
    contextMnu.addAction(muteAct);
    contextMnu.addSeparator();
    contextMnu.addAction(actionSortByActivity);
    contextMnu.addAction(actionSortByName);


    muteAct->setCheckable(true);
    muteAct->setEnabled(false);
    muteAct->setChecked(false);

    if (selectedItems.size())
    {
        RsGxsId nickName;
        rsMsgs->getIdentityForChatLobby(lobbyId, nickName);

        if(selectedItems.count()>1 || (RsGxsId(selectedItems.at(0)->text(COLUMN_ID).toStdString())!=nickName))
        {
            muteAct->setEnabled(true);

            QList<QTreeWidgetItem*>::iterator item;
            for (item = selectedItems.begin(); item != selectedItems.end(); ++item) {

                RsGxsId gxsid ;
                if ( dynamic_cast<GxsIdRSTreeWidgetItem*>(*item)->getId(gxsid) && isParticipantMuted(gxsid))
                {
                    muteAct->setChecked(true);
                    break;
                }
            }
        }
        distantChatAct->setEnabled(selectedItems.count()==1 && RsGxsId(selectedItems.front()->text(COLUMN_ID).toStdString())!=nickName) ;
    }

    contextMnu.exec(QCursor::pos());
}
예제 #28
0
void ChatPage::personalInvites_customPopupMenu(QPoint p)
{
	// items: create invite, copy to clipboard, delete
	std::cerr << "In custom popup menu" << std::endl;

	QList<QListWidgetItem*> selected = ui._personal_invites_LW->selectedItems() ;

	QMenu contextMnu( this );

	contextMnu.addAction( QIcon(IMAGE_CHAT_CREATE), tr("Create a chat invitation"), this, SLOT(personalInvites_create()) ) ;

	if(!selected.empty())
	{
		contextMnu.addAction( QIcon(IMAGE_CHAT_COPY), tr("Copy link to clipboard"), this, SLOT(personalInvites_copyLink()) ) ;
		contextMnu.addAction( QIcon(IMAGE_CHAT_DELETE), tr("Delete this invite"), this, SLOT(personalInvites_delete()) ) ;
	}

	contextMnu.exec(QCursor::pos());
}
예제 #29
0
/** context popup menus */
void ProfileView::imageCustomPopupMenu( QPoint /*point*/ )
{
      if (!mIsOwnId)
      {
      	return;
      }

      QMenu contextMnu( this );

      QAction *clearImageAct = new QAction( tr( "Clear Photo" ), this );
      QAction *changeImageAct = new QAction( tr( "Change Photo" ), this );

      connect( clearImageAct , SIGNAL( triggered() ), this, SLOT( clearimage() ) );
      connect( changeImageAct , SIGNAL( triggered() ), this, SLOT( selectimagefile() ) );

      contextMnu.addAction( clearImageAct );
      contextMnu.addAction( changeImageAct );

      contextMnu.exec(QCursor::pos());
}
예제 #30
0
void ChatPage::collectedContacts_customPopupMenu(QPoint p)
{
	// items: chat with this person, copy to clipboard, delete
	std::cerr << "In custom popup menu" << std::endl;

	QListWidgetItem *item = ui._collected_contacts_LW->itemAt(p) ;

	if(item == NULL)
		return  ;

	QList<QListWidgetItem*> selected = ui._collected_contacts_LW->selectedItems() ;

	QMenu contextMnu( this );

	if(selected.size() == 1)
		contextMnu.addAction( QIcon(IMAGE_CHAT_OPEN), tr("Open secured chat tunnel"), this, SLOT(collectedInvite_openDistantChat()) ) ;

	contextMnu.addAction( QIcon(IMAGE_CHAT_DELETE), tr("Delete this invite"), this, SLOT(collectedInvite_delete()) ) ;

	contextMnu.exec(QCursor::pos());
}