1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(widget): open a chat window instead of contacts list in multi-window mode

Closes #3212
This commit is contained in:
a68366 2016-06-03 12:01:49 +03:00
parent 431a10f82b
commit fdf0cbb1e1

View File

@ -1188,8 +1188,28 @@ bool Widget::newFriendMessageAlert(int friendId, bool sound)
}
else
{
currentWindow = window();
hasActive = f->getFriendWidget() == activeChatroomWidget;
if (Settings::getInstance().getSeparateWindow())
{
if (Settings::getInstance().getDontGroupWindows())
{
contentDialog = createContentDialog();
}
else
{
contentDialog = ContentDialog::current();
if (!contentDialog)
contentDialog = createContentDialog();
}
addFriendDialog(f, contentDialog);
currentWindow = contentDialog->window();
hasActive = ContentDialog::isFriendWidgetActive(friendId);
}
else
{
currentWindow = window();
hasActive = f->getFriendWidget() == activeChatroomWidget;
}
}
if (newMessageAlert(currentWindow, hasActive, sound))
@ -1390,7 +1410,6 @@ void Widget::updateScroll(GenericChatroomWidget *widget) {
ContentDialog* Widget::createContentDialog() const
{
ContentDialog* contentDialog = new ContentDialog(settingsWidget);
contentDialog->show();
#ifdef Q_OS_MAC
connect(contentDialog, &ContentDialog::destroyed, &Nexus::getInstance(), &Nexus::updateWindowsClosed);
connect(contentDialog, &ContentDialog::windowStateChanged, &Nexus::getInstance(), &Nexus::onWindowStateChanged);