| 1626 | } |
| 1627 | |
| 1628 | void LibraryWindow::setupAddToSubmenu(QMenu &menu) |
| 1629 | { |
| 1630 | menu.addAction(actions.addToFavoritesAction); |
| 1631 | actions.addToMenuAction->setMenu(&menu); |
| 1632 | |
| 1633 | const QList<LabelItem *> labels = listsModel->getLabels(); |
| 1634 | if (labels.count() > 0) |
| 1635 | menu.addSeparator(); |
| 1636 | for (auto *label : labels) { |
| 1637 | auto action = new QAction(this); |
| 1638 | action->setIcon(label->getIcon()); |
| 1639 | action->setText(label->name()); |
| 1640 | |
| 1641 | action->setData(label->getId()); |
| 1642 | |
| 1643 | menu.addAction(action); |
| 1644 | |
| 1645 | connect(action, &QAction::triggered, this, &LibraryWindow::onAddComicsToLabel); |
| 1646 | } |
| 1647 | } |
| 1648 | |
| 1649 | void LibraryWindow::onAddComicsToLabel() |
| 1650 | { |