Skip to content

Commit

Permalink
Make star menu async
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed May 9, 2024
1 parent 41fde4c commit 7bdd283
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/groupchatdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,7 @@ void GCMainDlg::doBookmark()
ConferenceBookmark &b = confs[confInd];

QMenu *menu = new QMenu(this);
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->winId();
menu->windowHandle()->setTransientParent(window()->windowHandle());
auto wa = new QWidgetAction(menu);
Expand Down Expand Up @@ -1619,20 +1620,18 @@ void GCMainDlg::doBookmark()
if (getDisplayName() != txtName->text())
account()->actionRename(jid(), txtName->text());
}
menu->hide();
menu->close();
});
dlg->connect(deleteBtn, &QPushButton::clicked, this, [menu, this]() {
BookmarkManager *bm = account()->bookmarkManager();
if (bm->isAvailable()) {
bm->removeConference(jid());
}
menu->hide();
menu->close();
});

menu->addAction(wa);
menu->exec(ui_.le_topic->mapToGlobal(QPoint(ui_.le_topic->width() - dlg->width(), ui_.le_topic->height())));

delete menu;
menu->popup(ui_.le_topic->mapToGlobal(QPoint(ui_.le_topic->width() - dlg->width(), ui_.le_topic->height())));
}

void GCMainDlg::configureRoom()
Expand Down

0 comments on commit 7bdd283

Please sign in to comment.