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

@ -50,6 +50,7 @@ void ChatTabWidget::addDialog(ChatDialog *dialog)
dialog->addToParent(this);
QObject::connect(dialog, SIGNAL(infoChanged(ChatDialog*)), this, SLOT(tabInfoChanged(ChatDialog*)));
QObject::connect(dialog, SIGNAL(dialogClose(ChatDialog*)), this, SLOT(dialogClose(ChatDialog*)));
tabInfoChanged(dialog);
}
@ -57,11 +58,13 @@ void ChatTabWidget::addDialog(ChatDialog *dialog)
void ChatTabWidget::removeDialog(ChatDialog *dialog)
{
QObject::disconnect(dialog, SIGNAL(infoChanged(ChatDialog*)), this, SLOT(tabInfoChanged(ChatDialog*)));
QObject::disconnect(dialog, SIGNAL(dialogClose(ChatDialog*)), this, SLOT(dialogClose(ChatDialog*)));
int tab = indexOf(dialog);
if (tab >= 0) {
dialog->removeFromParent(this);
removeTab(tab);
emit tabClosed(dialog);
}
}
@ -70,11 +73,7 @@ void ChatTabWidget::tabClose(int tab)
ChatDialog *dialog = dynamic_cast<ChatDialog*>(widget(tab));
if (dialog) {
if (dialog->canClose()) {
removeDialog(dialog);
emit tabClosed(dialog);
dialog->deleteLater();
}
dialog->close();
}
}
@ -105,6 +104,11 @@ void ChatTabWidget::tabInfoChanged(ChatDialog *dialog)
emit infoChanged();
}
void ChatTabWidget::dialogClose(ChatDialog *dialog)
{
removeDialog(dialog);
}
void ChatTabWidget::getInfo(bool &isTyping, bool &hasNewMessage, QIcon *icon)
{
isTyping = false;