Changed some internals in the chat dialog handling (private chat and lobby).

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4855 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-01-27 14:49:48 +00:00
parent 44ff9fe4f7
commit 2aa1ede192
7 changed files with 62 additions and 8 deletions

View file

@ -21,6 +21,7 @@
****************************************************************/
#include <QMessageBox>
#include <QCloseEvent>
#include "ChatDialog.h"
#include "gui/common/PeerDefs.h"
@ -40,6 +41,7 @@ static std::map<std::string, ChatDialog*> chatDialogs;
ChatDialog::ChatDialog(QWidget *parent, Qt::WFlags flags) :
QWidget(parent, flags)
{
setAttribute(Qt::WA_DeleteOnClose, true);
}
ChatDialog::~ChatDialog()
@ -50,6 +52,15 @@ ChatDialog::~ChatDialog()
}
}
void ChatDialog::closeEvent(QCloseEvent *event)
{
if (!canClose()) {
event->ignore();
return;
}
emit dialogClose(this);
}
void ChatDialog::init(const std::string &peerId, const QString &title)
{
this->peerId = peerId;