Ejemplo n.º 1
0
void ChatLobbyDialog::showDialog(uint chatflags)
{
	if (chatflags & RS_CHAT_FOCUS) {
		ChatTabWidget *tabWidget = FriendsDialog::getTabWidget();
		if (tabWidget) {
			tabWidget->setCurrentWidget(this);
		}
	}
}
Ejemplo n.º 2
0
void ChatLobbyDialog::init(const std::string &peerId, const QString &title)
{
	std::list<ChatLobbyInfo> lobbies;
	rsMsgs->getChatLobbyList(lobbies);

	std::list<ChatLobbyInfo>::const_iterator lobbyIt;
	for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) {
		std::string vpid;
		if (rsMsgs->getVirtualPeerId(lobbyIt->lobby_id, vpid)) {
			if (vpid == peerId) {
				QString msg = tr("Welcome to lobby %1").arg(QString::fromUtf8(lobbyIt->lobby_name.c_str()));
				if (!lobbyIt->lobby_topic.empty()) {
					msg += "\n" + tr("Topic: %1").arg(QString::fromUtf8(lobbyIt->lobby_topic.c_str()));
				}
				ui.chatWidget->setWelcomeMessage(msg);
				break;
			}
		}
	}

	ChatDialog::init(peerId, title);

	std::string nickName;
	rsMsgs->getNickNameForChatLobby(lobbyId, nickName);
	ui.chatWidget->setName(QString::fromUtf8(nickName.c_str()));

	ui.chatWidget->addToolsAction(ui.actionChangeNickname);

	lastUpdateListTime = 0;

	/* Hide or show the participants frames */
	showParticipantsFrame(PeerSettings->getShowParticipantsFrame(peerId));

	// add to window
	ChatTabWidget *tabWidget = FriendsDialog::getTabWidget();
	if (tabWidget) {
		tabWidget->addDialog(this);
	}

	/** List of muted Participants */
	mutedParticipants = new QStringList;
	
	// load settings
	processSettings(true);
}
Ejemplo n.º 3
0
void ChatLobbyDialog::init(const std::string &peerId, const QString &title)
{
	ChatDialog::init(peerId, title);

	std::string nickName;
	rsMsgs->getNickNameForChatLobby(lobbyId, nickName);
	ui.chatWidget->setName(QString::fromUtf8(nickName.c_str()));

	ui.chatWidget->addToolsAction(ui.actionChangeNickname);

	lastUpdateListTime = 0;

	/* Hide or show the participants frames */
	showParticipantsFrame(PeerSettings->getShowParticipantsFrame(peerId));

	// add to window
	ChatTabWidget *tabWidget = FriendsDialog::getTabWidget();
	if (tabWidget) {
		tabWidget->addDialog(this);
	}

	// load settings
	processSettings(true);
}