From fdf0cbb1e1b82f4f4327bb0a1d6d64da340ffadd Mon Sep 17 00:00:00 2001 From: a68366 Date: Fri, 3 Jun 2016 12:01:49 +0300 Subject: [PATCH] fix(widget): open a chat window instead of contacts list in multi-window mode Closes #3212 --- src/widget/widget.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 7903388b6..62ea574c9 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -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);