mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 23:55:35 -04:00
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:
parent
44ff9fe4f7
commit
2aa1ede192
7 changed files with 62 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue