Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
TabArchidekt Class Reference

Tab for browsing, searching, and filtering Archidekt decks. More...

#include <tab_archidekt.h>

Inheritance diagram for TabArchidekt:
[legend]
Collaboration diagram for TabArchidekt:
[legend]

Public Slots

void doSearch ()
 Trigger a search using the current filters.
void doSearchImmediate ()
void processApiJson (QNetworkReply *reply)
 Process a network reply containing JSON data.
void processTopDecksResponse (QJsonObject reply)
 Handle a JSON response containing multiple decks.
void processDeckResponse (QJsonObject reply)
 Handle a JSON response for a single deck.
void prettyPrintJson (const QJsonValue &value, int indentLevel)
 Pretty-print a QJsonValue for debugging.
void actNavigatePage (QString url)
 Navigate to a specified page URL.
void getTopDecks ()
 Fetch top decks from the Archidekt API.

Public Member Functions

 TabArchidekt (TabSupervisor *_tabSupervisor)
 Construct a new TabArchidekt object.
void retranslateUi () override
 Update all UI text to reflect the current language or translation.
QString buildSearchUrl ()
 Construct the search URL from all current filters.
QString getTabText () const override
 Retrieve the tab display text.
CardSizeWidgetgetCardSizeSlider ()
 Get the card size slider widget.
Public Member Functions inherited from Tab
 Tab (TabSupervisor *_tabSupervisor)
const QList< QMenu * > & getTabMenus () const
TabSupervisorgetTabSupervisor () const
bool getContentsChanged () const
void setContentsChanged (bool _contentsChanged)
virtual bool closeRequest ()
virtual void tabActivated ()

Public Attributes

QNetworkAccessManager * networkManager
 Network manager for handling API requests.

Private Attributes

QTimer * searchDebounceTimer
 Timer to debounce search requests by spin-boxes etc.
QWidget * container
 Root container for the entire tab.
QVBoxLayout * mainLayout
 Outer vertical layout containing navigation and page display.
QWidget * navigationContainer
 Container for all navigation/filter controls.
QHBoxLayout * navigationLayout
 Layout for horizontal arrangement of filter widgets.
QWidget * currentPageDisplay
 Widget containing the currently displayed deck(s)
QVBoxLayout * currentPageLayout
 Layout for deck display widgets.
QComboBox * orderByCombo
 Dropdown for selecting the sort field.
QPushButton * orderDirButton
 Toggle button for ascending/descending sort.
QSet< QChar > activeColors
 Set of currently active mana colors.
QCheckBox * logicalAndCheck
 Require ALL selected colors instead of ANY.
QLabel * formatLabel
 Label displaying "Formats".
SettingsButtonWidgetformatSettingsWidget
 Collapsible widget containing format checkboxes.
QVector< QCheckBox * > formatChecks
 Individual checkboxes for each format.
QComboBox * edhBracketCombo
 Dropdown for EDH bracket selection.
QCheckBox * packagesCheck
 Toggle for searching card packages instead of full decks.
QLineEdit * nameField
 Input for deck name filter.
QLineEdit * ownerField
 Input for owner name filter.
QLineEdit * cardsField
 Input for cards included in the deck (comma-separated)
QLineEdit * commandersField
 Input for commander cards (comma-separated)
QLineEdit * deckTagNameField
 Input for deck tag filtering.
QPushButton * searchPushButton
 Button to trigger the search manually.
SettingsButtonWidgetsettingsButton
 Container for additional UI settings.
CardSizeWidgetcardSizeSlider
 Slider to adjust card size in results.
QLabel * minDeckSizeLabel
 Label for minimum number of cards per deck.
QSpinBox * minDeckSizeSpin
 Spinner to select minimum deck size.
QComboBox * minDeckSizeLogicCombo
 Combo box for the size logic to apply.
QLabel * pageLabel
 Label for current page selection.
QSpinBox * pageSpin
 Spinner to select the page number for results.
CardInfoPtr cardToQuery
 Optional pre-selected card for initial filtering.

Additional Inherited Members

Signals inherited from Tab
void userEvent (bool globalEvent=true)
void tabTextChanged (Tab *tab, const QString &newTabText)
Protected Slots inherited from Tab
void showCardInfoPopup (const QPoint &pos, const CardRef &cardRef)
void deleteCardInfoPopup (const QString &cardName)
Protected Member Functions inherited from Tab
void addTabMenu (QMenu *menu)
Protected Attributes inherited from Tab
TabSupervisortabSupervisor

Detailed Description

Tab for browsing, searching, and filtering Archidekt decks.

This class provides a comprehensive interface for querying decks from the Archidekt API. Users can filter decks by name, owner, included cards, commanders, deck tags, colors, EDH bracket, and formats. It also provides sorting and pagination, as well as a card size adjustment widget.

Constructor & Destructor Documentation

◆ TabArchidekt()

TabArchidekt::TabArchidekt ( TabSupervisor * _tabSupervisor)
explicit

Construct a new TabArchidekt object.

Parameters
_tabSupervisorParent tab supervisor responsible for tab management and callbacks

Initializes the network manager, creates all UI components, sets up layouts, connects signals and slots, and triggers an initial fetch of top decks.

Here is the call graph for this function:

Member Function Documentation

◆ actNavigatePage

void TabArchidekt::actNavigatePage ( QString url)
slot

Navigate to a specified page URL.

Parameters
urlThe URL to request

Typically called when a navigation button is clicked in a deck listing.

Here is the caller graph for this function:

◆ buildSearchUrl()

QString TabArchidekt::buildSearchUrl ( )

Construct the search URL from all current filters.

Returns
QString Fully constructed URL including all query parameters

The search URL is dynamically built using the state of all filter widgets. Parameters included:

  • Deck name
  • Owner
  • Included cards
  • Commander cards
  • Deck tag
  • Colors and logical AND requirement
  • Formats
  • EDH bracket
  • Packages toggle
  • Sorting field and direction
  • Minimum amount of cards in the deck
  • Pagination (page)
Here is the caller graph for this function:

◆ doSearch

void TabArchidekt::doSearch ( )
slot

Trigger a search using the current filters.

Sends a network request to the Archidekt API using the URL generated by buildSearchUrl(). Updates the current page display with results asynchronously.

Here is the caller graph for this function:

◆ doSearchImmediate

void TabArchidekt::doSearchImmediate ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCardSizeSlider()

CardSizeWidget * TabArchidekt::getCardSizeSlider ( )
inline

Get the card size slider widget.

Returns
CardSizeWidget* Pointer to the card size adjustment slider

Allows external code to read or manipulate the current card size or hook up the sliders signals.

◆ getTabText()

QString TabArchidekt::getTabText ( ) const
inlineoverridevirtual

Retrieve the tab display text.

Returns
QString Human-readable title for the tab

If a card is pre-selected (cardToQuery), its name is appended to the tab title.

Implements Tab.

◆ getTopDecks

void TabArchidekt::getTopDecks ( )
slot

Fetch top decks from the Archidekt API.

Called on initialization to populate the initial page display.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prettyPrintJson

void TabArchidekt::prettyPrintJson ( const QJsonValue & value,
int indentLevel )
slot

Pretty-print a QJsonValue for debugging.

Parameters
valueThe JSON value to print
indentLevelThe indentation depth (number of levels)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processApiJson

void TabArchidekt::processApiJson ( QNetworkReply * reply)
slot

Process a network reply containing JSON data.

Parameters
replyQNetworkReply object with the API response

Determines whether the response corresponds to a top decks query or a single deck, and dispatches it to the appropriate handler.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processDeckResponse

void TabArchidekt::processDeckResponse ( QJsonObject reply)
slot

Handle a JSON response for a single deck.

Parameters
replyQJsonObject containing deck data

Clears the previous page display and creates a new display widget for the deck details.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processTopDecksResponse

void TabArchidekt::processTopDecksResponse ( QJsonObject reply)
slot

Handle a JSON response containing multiple decks.

Parameters
replyQJsonObject containing top deck listings

Clears the previous page display and creates a new display widget for the results.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ retranslateUi()

void TabArchidekt::retranslateUi ( )
overridevirtual

Update all UI text to reflect the current language or translation.

This function re-applies translations to all labels, buttons, and placeholders. It should be called after a language change.

Implements Tab.

Here is the caller graph for this function:

Member Data Documentation

◆ activeColors

QSet<QChar> TabArchidekt::activeColors
private

Set of currently active mana colors.

◆ cardsField

QLineEdit* TabArchidekt::cardsField
private

Input for cards included in the deck (comma-separated)

◆ cardSizeSlider

CardSizeWidget* TabArchidekt::cardSizeSlider
private

Slider to adjust card size in results.

◆ cardToQuery

CardInfoPtr TabArchidekt::cardToQuery
private

Optional pre-selected card for initial filtering.

◆ commandersField

QLineEdit* TabArchidekt::commandersField
private

Input for commander cards (comma-separated)

◆ container

QWidget* TabArchidekt::container
private

Root container for the entire tab.

◆ currentPageDisplay

QWidget* TabArchidekt::currentPageDisplay
private

Widget containing the currently displayed deck(s)

◆ currentPageLayout

QVBoxLayout* TabArchidekt::currentPageLayout
private

Layout for deck display widgets.

◆ deckTagNameField

QLineEdit* TabArchidekt::deckTagNameField
private

Input for deck tag filtering.

◆ edhBracketCombo

QComboBox* TabArchidekt::edhBracketCombo
private

Dropdown for EDH bracket selection.

◆ formatChecks

QVector<QCheckBox *> TabArchidekt::formatChecks
private

Individual checkboxes for each format.

◆ formatLabel

QLabel* TabArchidekt::formatLabel
private

Label displaying "Formats".

◆ formatSettingsWidget

SettingsButtonWidget* TabArchidekt::formatSettingsWidget
private

Collapsible widget containing format checkboxes.

◆ logicalAndCheck

QCheckBox* TabArchidekt::logicalAndCheck
private

Require ALL selected colors instead of ANY.

◆ mainLayout

QVBoxLayout* TabArchidekt::mainLayout
private

Outer vertical layout containing navigation and page display.

◆ minDeckSizeLabel

QLabel* TabArchidekt::minDeckSizeLabel
private

Label for minimum number of cards per deck.

◆ minDeckSizeLogicCombo

QComboBox* TabArchidekt::minDeckSizeLogicCombo
private

Combo box for the size logic to apply.

◆ minDeckSizeSpin

QSpinBox* TabArchidekt::minDeckSizeSpin
private

Spinner to select minimum deck size.

◆ nameField

QLineEdit* TabArchidekt::nameField
private

Input for deck name filter.

◆ navigationContainer

QWidget* TabArchidekt::navigationContainer
private

Container for all navigation/filter controls.

◆ navigationLayout

QHBoxLayout* TabArchidekt::navigationLayout
private

Layout for horizontal arrangement of filter widgets.

◆ networkManager

QNetworkAccessManager* TabArchidekt::networkManager

Network manager for handling API requests.

◆ orderByCombo

QComboBox* TabArchidekt::orderByCombo
private

Dropdown for selecting the sort field.

◆ orderDirButton

QPushButton* TabArchidekt::orderDirButton
private

Toggle button for ascending/descending sort.

◆ ownerField

QLineEdit* TabArchidekt::ownerField
private

Input for owner name filter.

◆ packagesCheck

QCheckBox* TabArchidekt::packagesCheck
private

Toggle for searching card packages instead of full decks.

◆ pageLabel

QLabel* TabArchidekt::pageLabel
private

Label for current page selection.

◆ pageSpin

QSpinBox* TabArchidekt::pageSpin
private

Spinner to select the page number for results.

◆ searchDebounceTimer

QTimer* TabArchidekt::searchDebounceTimer
private

Timer to debounce search requests by spin-boxes etc.

◆ searchPushButton

QPushButton* TabArchidekt::searchPushButton
private

Button to trigger the search manually.

◆ settingsButton

SettingsButtonWidget* TabArchidekt::settingsButton
private

Container for additional UI settings.


The documentation for this class was generated from the following files: