diff --git a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp index 9fae48e6c..5bff6fdbe 100644 --- a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp +++ b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp @@ -346,6 +346,20 @@ void DeckEditorDeckDockWidget::updateShowTagsWidget(const bool visible) deckTagsDisplayWidget->setHidden(!visible); } +void DeckEditorDeckDockWidget::syncBannerCardComboBoxSelectionWithDeck() +{ + if (deckModel->getDeckList()->getBannerCard().name == "") { + if (bannerCardComboBox->findText("-") != -1) { + bannerCardComboBox->setCurrentIndex(bannerCardComboBox->findText("-")); + } else { + bannerCardComboBox->insertItem(0, "-"); + bannerCardComboBox->setCurrentIndex(0); + } + } else { + bannerCardComboBox->setCurrentText(deckModel->getDeckList()->getBannerCard().name); + } +} + /** * Sets the currently active deck for this tab * @param _deck The deck. Takes ownership of the object @@ -356,7 +370,8 @@ void DeckEditorDeckDockWidget::setDeck(DeckLoader *_deck) nameEdit->setText(deckModel->getDeckList()->getName()); commentsEdit->setText(deckModel->getDeckList()->getComments()); - bannerCardComboBox->setCurrentText(deckModel->getDeckList()->getBannerCard().name); + + syncBannerCardComboBoxSelectionWithDeck(); updateBannerCardComboBox(); updateHash(); deckModel->sort(deckView->header()->sortIndicatorSection(), deckView->header()->sortIndicatorOrder()); diff --git a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h index b81bf6096..1da78e3c7 100644 --- a/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h +++ b/cockatrice/src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.h @@ -88,6 +88,7 @@ private slots: void refreshShortcuts(); void updateShowBannerCardComboBox(bool visible); void updateShowTagsWidget(bool visible); + void syncBannerCardComboBoxSelectionWithDeck(); }; #endif // DECK_EDITOR_DECK_DOCK_WIDGET_H