2011-11-27 16:04:10 -05:00
|
|
|
/****************************************************************
|
|
|
|
*
|
|
|
|
* 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>
|
2011-12-04 09:31:48 -05:00
|
|
|
#include <retroshare/rsstatus.h>
|
2011-11-27 16:04:10 -05:00
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
#include "ChatLobbyDialog.h"
|
|
|
|
|
|
|
|
/** Default constructor */
|
2011-12-04 09:31:48 -05:00
|
|
|
ChatLobbyDialog::ChatLobbyDialog(const std::string& dialog_id,const ChatLobbyId& lid, const QString &name, QWidget *parent, Qt::WFlags flags)
|
|
|
|
: PopupChatDialog(dialog_id,name,parent,flags),lobby_id(lid)
|
2011-11-27 16:04:10 -05:00
|
|
|
{
|
|
|
|
// remove the avatar widget. Replace it with a friends list.
|
|
|
|
|
|
|
|
ui.avatarWidget->hide() ;
|
2011-12-04 09:31:48 -05:00
|
|
|
PopupChatDialog::updateStatus(QString::fromStdString(getPeerId()),RS_STATUS_ONLINE) ;
|
2011-11-27 16:04:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Destructor. */
|
|
|
|
ChatLobbyDialog::~ChatLobbyDialog()
|
|
|
|
{
|
|
|
|
// announce leaving of lobby
|
|
|
|
|
|
|
|
rsMsgs->unsubscribeChatLobby(lobby_id) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ChatLobbyDialog::setNickName(const QString& nick)
|
|
|
|
{
|
|
|
|
rsMsgs->setNickNameForChatLobby(lobby_id,nick.toStdString()) ;
|
|
|
|
}
|
|
|
|
|
2011-12-04 09:31:48 -05:00
|
|
|
void ChatLobbyDialog::updateStatus(const QString &peer_id, int status)
|
2011-11-27 16:04:10 -05:00
|
|
|
{
|
2011-12-04 09:31:48 -05:00
|
|
|
// For now. We need something more efficient to tell when the lobby is disconnected.
|
|
|
|
//
|
2011-11-27 16:04:10 -05:00
|
|
|
}
|
|
|
|
|