mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix related cards menu in deck editor (#3649)
This commit is contained in:
parent
0326f0d4c9
commit
6f95556632
3 changed files with 8 additions and 16 deletions
|
|
@ -460,11 +460,12 @@ void TabDeckEditor::databaseCustomMenu(QPoint point)
|
|||
// filling out the related cards submenu
|
||||
auto *relatedMenu = new QMenu(tr("Show Related cards"));
|
||||
menu.addMenu(relatedMenu);
|
||||
if (info->getRelatedCards().isEmpty()) {
|
||||
auto relatedCards = info->getAllRelatedCards();
|
||||
if (relatedCards.isEmpty()) {
|
||||
relatedMenu->setDisabled(true);
|
||||
} else {
|
||||
auto *signalMapper = new QSignalMapper(this);
|
||||
for (const CardRelation *rel : info->getRelatedCards()) {
|
||||
for (const CardRelation *rel : relatedCards) {
|
||||
QAction *relatedCard;
|
||||
relatedCard = relatedMenu->addAction(rel->getName());
|
||||
connect(relatedCard, SIGNAL(triggered()), signalMapper, SLOT(map()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue