Visual deck storage v2 (#5427)

* Restore some button states (ready/sideboard locked) to sensible defaults when unloading a deck.

* Update last loaded timestamp in decklist file and then restore original last modified timestamp if a user requests a deck load.

* Add some todos.

* Loading a deck from local file dialog should swap out scenes, enable unload button.

* Lint.

* Shuffle some classes and signals around.

* More sort options, sort widgets directly.

* Banner cards should respect providerIds.

* Properly updateSortOrder on load.

* Add the color identity to the Deck Preview Widget.

* Properly set sort indices.

* Change replace visualDeckStorageWidget with deckView to be in deckSelectFinished so that it also works on remote deck load.

* Include settings for unused color identities display.

* Change opacity scaling.

* Overload for Qt.

* Lint.

* Lint.

* Include QMouseEvent

* Template because MacOs.

* Include a quick filter for color identities.

* Include a quick filter for color identities.

* Save some space.

* Refactor DeckPreviewWidgets to reside in their own folder.

* Add Deck Loader logging category.

* Introduce a tagging system.

* Add some more default tags.

* Even more default tags.

* Lint.

* Lint a comma.

* Remove extra set of braces.

* Lint some stuff.

* Refresh banner cards when tags are added.

* Lint.

* Wrestle with Qt Checkboxes.

* Lint.

* Adjust some sizes, relayout.

* Address comments.

* Lint.

* Reorder kindred types.

* Add a search bar for tags.

* Remove close button (for now) and change "Add tags ..." to "Edit tags ..."

* Retranslate window title for Deck Tag Manager Dialog.

* Style tag addition widget to be consistent.

* Lint.

* Override paintEvent.

* Override sizeHint

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-01-12 23:46:22 +01:00 committed by GitHub
parent 9bd024d39f
commit dd8ac14f99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 1899 additions and 153 deletions

View file

@ -250,8 +250,11 @@ class DeckList : public QObject
{
Q_OBJECT
private:
QString name, comments, bannerCard;
QString name, comments;
QPair<QString, QString> bannerCard;
QString deckHash;
QString lastLoadedTimestamp;
QStringList tags;
QMap<QString, SideboardPlan *> sideboardPlans;
InnerDecklistNode *root;
void getCardListHelper(InnerDecklistNode *node, QSet<QString> &result) const;
@ -279,10 +282,26 @@ public slots:
{
comments = _comments;
}
void setBannerCard(const QString &_bannerCard = QString())
void setTags(const QStringList &_tags = QStringList())
{
tags = _tags;
}
void addTag(const QString &_tag)
{
tags.append(_tag);
}
void clearTags()
{
tags.clear();
}
void setBannerCard(const QPair<QString, QString> &_bannerCard = QPair<QString, QString>())
{
bannerCard = _bannerCard;
}
void setLastLoadedTimestamp(const QString &_lastLoadedTimestamp = QString())
{
lastLoadedTimestamp = _lastLoadedTimestamp;
}
public:
explicit DeckList();
@ -297,10 +316,18 @@ public:
{
return comments;
}
QString getBannerCard() const
QStringList getTags() const
{
return tags;
}
QPair<QString, QString> getBannerCard() const
{
return bannerCard;
}
QString getLastLoadedTimestamp() const
{
return lastLoadedTimestamp;
}
QList<MoveCard_ToZone> getCurrentSideboardPlan();
void setCurrentSideboardPlan(const QList<MoveCard_ToZone> &plan);
const QMap<QString, SideboardPlan *> &getSideboardPlans() const