void GetStartedDialog::inviteFriends() { if (RsAutoUpdatePage::eventsLocked() == true) { std::cerr << "GetStartedDialog::inviteFriends() EventsLocked... waiting"; std::cerr << std::endl; if (!mInviteTimer) { mInviteTimer = new QTimer(this); mInviteTimer->connect(mTimer, SIGNAL(timeout()), this, SLOT(inviteFriends())); mInviteTimer->setInterval(100); /* 1/10 second */ mInviteTimer->setSingleShot(true); } mInviteTimer->start(); return; } std::string cert; { RsAutoUpdatePage::lockAllEvents(); cert = rsPeers->GetRetroshareInvite(false); RsAutoUpdatePage::unlockAllEvents() ; } QString text = QString("%1\n%2\n\n%3\n").arg(GetInviteText()).arg(GetCutBelowText()).arg(QString::fromUtf8(cert.c_str())); sendMail("", tr("RetroShare Invitation"), text); }
/** Default constructor */ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WindowFlags flags) : ChatDialog(parent, flags), lobbyId(lid) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); connect(ui.participantsFrameButton, SIGNAL(toggled(bool)), this, SLOT(showParticipantsFrame(bool))); connect(ui.actionChangeNickname, SIGNAL(triggered()), this, SLOT(changeNickname())); connect(ui.participantsList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(participantsTreeWidgetCustomPopupMenu(QPoint))); connect(ui.participantsList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(participantsTreeWidgetDoubleClicked(QTreeWidgetItem*,int))); ui.participantsList->setColumnCount(COLUMN_COUNT); ui.participantsList->setColumnWidth(COLUMN_ICON, 20); ui.participantsList->setColumnHidden(COLUMN_ACTIVITY,true); muteAct = new QAction(QIcon(), tr("Mute participant"), this); connect(muteAct, SIGNAL(triggered()), this, SLOT(changePartipationState())); // Add a button to invite friends. // inviteFriendsButton = new QToolButton ; inviteFriendsButton->setMinimumSize(QSize(28,28)) ; inviteFriendsButton->setMaximumSize(QSize(28,28)) ; inviteFriendsButton->setText(QString()) ; inviteFriendsButton->setAutoRaise(true) ; inviteFriendsButton->setToolTip(tr("Invite friends to this lobby")); { QIcon icon ; icon.addPixmap(QPixmap(":/images/edit_add24.png")) ; inviteFriendsButton->setIcon(icon) ; inviteFriendsButton->setIconSize(QSize(22,22)) ; } connect(inviteFriendsButton, SIGNAL(clicked()), this , SLOT(inviteFriends())); getChatWidget()->addChatBarWidget(inviteFriendsButton) ; unsubscribeButton = new QToolButton ; unsubscribeButton->setMinimumSize(QSize(28,28)) ; unsubscribeButton->setMaximumSize(QSize(28,28)) ; unsubscribeButton->setText(QString()) ; unsubscribeButton->setAutoRaise(true) ; unsubscribeButton->setToolTip(tr("Leave this lobby (Unsubscribe)")); { QIcon icon ; icon.addPixmap(QPixmap(":/images/exit_32.png")) ; unsubscribeButton->setIcon(icon) ; unsubscribeButton->setIconSize(QSize(22,22)) ; } connect(unsubscribeButton, SIGNAL(clicked()), this , SLOT(leaveLobby())); getChatWidget()->addChatBarWidget(unsubscribeButton) ; }
void EziSocialObject::inviteFriends(const char* message, const std::vector<std::string> &selectedFriendIDs) { inviteFriends(message, selectedFriendIDs, ""); }
void EziSocialObject::inviteFriends(const char* message) { inviteFriends(message, std::vector<std::string>()); }
void EziSocialObject::inviteFriends(const char* message, cocos2d::CCArray *selectedFriendIDs) { inviteFriends(message, selectedFriendIDs, ""); }
void EziSocialObject::inviteFriends(const char* message) { inviteFriends(message, NULL); }
/** Default constructor */ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WindowFlags flags) : ChatDialog(parent, flags), lobbyId(lid) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); lastUpdateListTime = 0; //connect(ui.actionChangeNickname, SIGNAL(triggered()), this, SLOT(changeNickname())); connect(ui.participantsList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(participantsTreeWidgetCustomPopupMenu(QPoint))); connect(ui.participantsList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(participantsTreeWidgetDoubleClicked(QTreeWidgetItem*,int))); int S = QFontMetricsF(font()).height() ; ui.participantsList->setIconSize(QSize(1.3*S,1.3*S)); ui.participantsList->setColumnCount(COLUMN_COUNT); ui.participantsList->setColumnWidth(COLUMN_ICON, 1.4*S); ui.participantsList->setColumnHidden(COLUMN_ACTIVITY,true); ui.participantsList->setColumnHidden(COLUMN_ID,true); muteAct = new QAction(QIcon(), tr("Mute participant"), this); distantChatAct = new QAction(QIcon(":/images/chat_24.png"), tr("Start private chat"), this); sendMessageAct = new QAction(QIcon(":/images/mail_new.png"), tr("Send Message"), this); QActionGroup *sortgrp = new QActionGroup(this); actionSortByName = new QAction(QIcon(), tr("Sort by Name"), this); actionSortByName->setCheckable(true); actionSortByName->setChecked(true); actionSortByName->setActionGroup(sortgrp); actionSortByActivity = new QAction(QIcon(), tr("Sort by Activity"), this); actionSortByActivity->setCheckable(true); actionSortByActivity->setChecked(false); actionSortByActivity->setActionGroup(sortgrp); connect(muteAct, SIGNAL(triggered()), this, SLOT(changePartipationState())); connect(distantChatAct, SIGNAL(triggered()), this, SLOT(distantChatParticipant())); connect(sendMessageAct, SIGNAL(triggered()), this, SLOT(sendMessage())); connect(actionSortByName, SIGNAL(triggered()), this, SLOT(sortParcipants())); connect(actionSortByActivity, SIGNAL(triggered()), this, SLOT(sortParcipants())); // Add a button to invite friends. // inviteFriendsButton = new QToolButton ; inviteFriendsButton->setMinimumSize(QSize(2*S,2*S)) ; inviteFriendsButton->setMaximumSize(QSize(2*S,2*S)) ; inviteFriendsButton->setText(QString()) ; inviteFriendsButton->setAutoRaise(true) ; inviteFriendsButton->setToolTip(tr("Invite friends to this lobby")); mParticipantCompareRole = new RSTreeWidgetItemCompareRole; mParticipantCompareRole->setRole(COLUMN_ACTIVITY, ROLE_SORT); { QIcon icon ; icon.addPixmap(QPixmap(":/images/edit_add24.png")) ; inviteFriendsButton->setIcon(icon) ; inviteFriendsButton->setIconSize(QSize(2*S,2*S)) ; } connect(inviteFriendsButton, SIGNAL(clicked()), this , SLOT(inviteFriends())); getChatWidget()->addChatBarWidget(inviteFriendsButton) ; RsGxsId current_id; rsMsgs->getIdentityForChatLobby(lobbyId, current_id); ownIdChooser = new GxsIdChooser() ; ownIdChooser->loadIds(IDCHOOSER_ID_REQUIRED,current_id) ; QWidgetAction *checkableAction = new QWidgetAction(this); checkableAction->setDefaultWidget(ownIdChooser); ui.chatWidget->addToolsAction(checkableAction); //getChatWidget()->addChatBarWidget(ownIdChooser); connect(ownIdChooser,SIGNAL(currentIndexChanged(int)),this,SLOT(changeNickname())) ; unsubscribeButton = new QToolButton ; unsubscribeButton->setMinimumSize(QSize(2*S,2*S)) ; unsubscribeButton->setMaximumSize(QSize(2*S,2*S)) ; unsubscribeButton->setText(QString()) ; unsubscribeButton->setAutoRaise(true) ; unsubscribeButton->setToolTip(tr("Leave this lobby (Unsubscribe)")); { QIcon icon ; icon.addPixmap(QPixmap(":/images/door_in.png")) ; unsubscribeButton->setIcon(icon) ; unsubscribeButton->setIconSize(QSize(1.5*S,1.5*S)) ; } /* Initialize splitter */ ui.splitter->setStretchFactor(0, 1); ui.splitter->setStretchFactor(1, 0); connect(unsubscribeButton, SIGNAL(clicked()), this , SLOT(leaveLobby())); getChatWidget()->addChatBarWidget(unsubscribeButton) ; }