mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Multi-window: Fix circle modified from dialog window, fix groupchat leave warnings, flip dialog window title
This commit is contained in:
parent
aa9a10fa8b
commit
4e5c4cb678
|
@ -92,6 +92,8 @@ void CircleWidget::contextMenuEvent(QContextMenuEvent* event)
|
|||
|
||||
QAction* selectedItem = menu.exec(mapToGlobal(event->pos()));
|
||||
|
||||
if (selectedItem)
|
||||
{
|
||||
if (selectedItem == renameAction)
|
||||
{
|
||||
editName();
|
||||
|
@ -141,6 +143,7 @@ void CircleWidget::contextMenuEvent(QContextMenuEvent* event)
|
|||
dialog->show();
|
||||
dialog->ensureSplitterVisible();
|
||||
}
|
||||
}
|
||||
|
||||
setContainerAttribute(Qt::WA_UnderMouse, false);
|
||||
}
|
||||
|
|
|
@ -241,8 +241,12 @@ void ContentDialog::removeFriend(int friendId)
|
|||
void ContentDialog::removeGroup(int groupId)
|
||||
{
|
||||
Group* group = GroupList::findGroup(groupId);
|
||||
|
||||
if (group)
|
||||
{
|
||||
disconnect(group, &Group::titleChanged, this, &ContentDialog::updateGroupWidget);
|
||||
disconnect(group, &Group::userListChanged, this, &ContentDialog::updateGroupWidget);
|
||||
}
|
||||
|
||||
auto iter = groupList.find(groupId);
|
||||
|
||||
|
@ -424,7 +428,7 @@ ContentDialog* ContentDialog::getGroupDialog(int groupId)
|
|||
void ContentDialog::updateTitleUsername(const QString& username)
|
||||
{
|
||||
if (displayWidget != nullptr)
|
||||
setWindowTitle(username + QStringLiteral(" - ") + displayWidget->getTitle());
|
||||
setWindowTitle(displayWidget->getTitle() + QStringLiteral(" - ") + username);
|
||||
else
|
||||
setWindowTitle(username);
|
||||
}
|
||||
|
|
|
@ -389,8 +389,11 @@ void FriendListWidget::addCircleWidget(FriendWidget* friendWidget)
|
|||
}
|
||||
|
||||
Widget::getInstance()->searchCircle(circleWidget);
|
||||
|
||||
if (window()->isActiveWindow())
|
||||
circleWidget->editName();
|
||||
}
|
||||
reDraw();
|
||||
}
|
||||
|
||||
void FriendListWidget::removeCircleWidget(CircleWidget* widget)
|
||||
|
|
|
@ -105,7 +105,7 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
FriendListWidget *friendList;
|
||||
|
||||
if (circleWidget == nullptr)
|
||||
friendList = dynamic_cast<FriendListWidget*>(parentWidget());
|
||||
friendList = dynamic_cast<FriendListWidget*>(FriendList::findFriend(friendId)->getFriendWidget()->parentWidget());
|
||||
else
|
||||
friendList = dynamic_cast<FriendListWidget*>(circleWidget->parentWidget());
|
||||
|
||||
|
@ -214,7 +214,7 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
circleWidget->updateStatus();
|
||||
|
||||
if (friendList != nullptr)
|
||||
friendList->addCircleWidget(this);
|
||||
friendList->addCircleWidget(FriendList::findFriend(friendId)->getFriendWidget());
|
||||
else
|
||||
Settings::getInstance().setFriendCircleID(id, Settings::getInstance().addCircle());
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
else if (removeCircleAction != nullptr && selectedItem == removeCircleAction)
|
||||
{
|
||||
if (friendList != nullptr)
|
||||
friendList->moveWidget(this, FriendList::findFriend(friendId)->getStatus(), true);
|
||||
friendList->moveWidget(FriendList::findFriend(friendId)->getFriendWidget(), FriendList::findFriend(friendId)->getStatus(), true);
|
||||
else
|
||||
Settings::getInstance().setFriendCircleID(id, -1);
|
||||
|
||||
|
@ -242,7 +242,7 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
|
||||
if (circle != nullptr)
|
||||
{
|
||||
circle->addFriendWidget(this, FriendList::findFriend(friendId)->getStatus());
|
||||
circle->addFriendWidget(FriendList::findFriend(friendId)->getFriendWidget(), FriendList::findFriend(friendId)->getStatus());
|
||||
circle->setExpanded(true);
|
||||
Widget::getInstance()->searchCircle(circle);
|
||||
Settings::getInstance().savePersonal();
|
||||
|
|
Loading…
Reference in New Issue
Block a user