mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 03:49:21 -05:00
add "Set Banner Card" action to VDS right-click menu (#5692)
Some checks failed
Build Desktop / Configure (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, 12) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, skip, 11) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, 41) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, skip, 40) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, 24.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 20.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 22.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (yes, Arch, skip) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-14, Apple, 14, Release, 15.4) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-15, Apple, 15, Release, 16.2) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, macos-15, Apple, 15, Debug, 16.2) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (4, 1, macos-13, Intel, 13, Release, 14.3.1) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, 5.15.*, 7) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, qtimageformats qtmultimedia qtwebsockets, 6.6.*, 10) (push) Has been cancelled
Some checks failed
Build Desktop / Configure (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, 12) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, skip, 11) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, 41) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, skip, 40) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, 24.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 20.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 22.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (yes, Arch, skip) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-14, Apple, 14, Release, 15.4) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-15, Apple, 15, Release, 16.2) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, macos-15, Apple, 15, Debug, 16.2) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (4, 1, macos-13, Intel, 13, Release, 14.3.1) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, 5.15.*, 7) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, qtimageformats qtmultimedia qtwebsockets, 6.6.*, 10) (push) Has been cancelled
This commit is contained in:
@@ -288,6 +288,8 @@ QMenu *DeckPreviewWidget::createRightClickMenu()
|
||||
connect(menu->addAction(tr("Edit Tags")), &QAction::triggered, deckTagsDisplayWidget,
|
||||
&DeckPreviewDeckTagsDisplayWidget::openTagEditDlg);
|
||||
|
||||
addSetBannerCardMenu(menu);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
connect(menu->addAction(tr("Rename Deck")), &QAction::triggered, this, &DeckPreviewWidget::actRenameDeck);
|
||||
@@ -312,6 +314,28 @@ QMenu *DeckPreviewWidget::createRightClickMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the "Set Banner Card" submenu to the given menu. Does nothing if bannerCardComboBox is null.
|
||||
* @param menu The menu to add the submenu to
|
||||
*/
|
||||
void DeckPreviewWidget::addSetBannerCardMenu(QMenu *menu)
|
||||
{
|
||||
if (!bannerCardComboBox) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto bannerCardMenu = menu->addMenu(tr("Set Banner Card"));
|
||||
|
||||
for (int i = 0; i < bannerCardComboBox->count(); ++i) {
|
||||
auto action = bannerCardMenu->addAction(bannerCardComboBox->itemText(i));
|
||||
connect(action, &QAction::triggered, this, [this, i] { bannerCardComboBox->setCurrentIndex(i); });
|
||||
|
||||
// the checkability is purely for visuals
|
||||
action->setCheckable(true);
|
||||
action->setChecked(bannerCardComboBox->currentIndex() == i);
|
||||
}
|
||||
}
|
||||
|
||||
void DeckPreviewWidget::actRenameDeck()
|
||||
{
|
||||
// read input
|
||||
|
||||
@@ -59,6 +59,7 @@ public slots:
|
||||
|
||||
private:
|
||||
QMenu *createRightClickMenu();
|
||||
void addSetBannerCardMenu(QMenu *menu);
|
||||
|
||||
private slots:
|
||||
void actRenameDeck();
|
||||
|
||||
Reference in New Issue
Block a user