mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-20 23:10:39 -04:00
Added welcome message to the chat lobby.
Fixed german language. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5043 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9f627783aa
commit
bbdb3b9614
5 changed files with 117 additions and 27 deletions
|
@ -48,6 +48,24 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WF
|
|||
|
||||
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;
|
||||
|
|
|
@ -291,6 +291,11 @@ void ChatWidget::focusDialog()
|
|||
ui->chattextEdit->setFocus();
|
||||
}
|
||||
|
||||
void ChatWidget::setWelcomeMessage(QString &text)
|
||||
{
|
||||
ui->textBrowser->setText(text);
|
||||
}
|
||||
|
||||
void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType)
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
void addToParent(QWidget *newParent);
|
||||
void removeFromParent(QWidget *oldParent);
|
||||
|
||||
void setWelcomeMessage(QString &text);
|
||||
void addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType);
|
||||
void updateStatusString(const QString &statusMask, const QString &statusString);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue