mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-18 14:00:35 -04:00
- derived new class of PopupChatDialog to handle chat lobbies
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ChatLobby@4694 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f4e41b3247
commit
6c93253050
11 changed files with 209 additions and 913 deletions
73
retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp
Normal file
73
retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp
Normal file
|
@ -0,0 +1,73 @@
|
|||
/****************************************************************
|
||||
*
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2011, csoler
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <QScrollBar>
|
||||
#include <QCloseEvent>
|
||||
#include <QColorDialog>
|
||||
#include <QDateTime>
|
||||
#include <QFontDialog>
|
||||
#include <QDir>
|
||||
#include <QBuffer>
|
||||
#include <QTextCodec>
|
||||
#include <QSound>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "util/misc.h"
|
||||
#include "rshare.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsmsgs.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "ChatLobbyDialog.h"
|
||||
|
||||
/** Default constructor */
|
||||
ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, const QString &name, QWidget *parent, Qt::WFlags flags)
|
||||
: PopupChatDialog(("Chat lobby 0x"+QString::number(lobby_id,16)).toStdString(),name,parent,flags),lobby_id(lid)
|
||||
{
|
||||
// remove the avatar widget. Replace it with a friends list.
|
||||
|
||||
ui.avatarWidget->hide() ;
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
ChatLobbyDialog::~ChatLobbyDialog()
|
||||
{
|
||||
// announce leaving of lobby
|
||||
|
||||
rsMsgs->unsubscribeChatLobby(lobby_id) ;
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::setNickName(const QString& nick)
|
||||
{
|
||||
rsMsgs->setNickNameForChatLobby(lobby_id,nick.toStdString()) ;
|
||||
}
|
||||
|
||||
bool ChatLobbyDialog::sendPrivateChat(const std::wstring& msg)
|
||||
{
|
||||
return rsMsgs->sendLobbyChat(msg,lobby_id) ;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue