![]() |
Cockatrice 2026-03-05-Development-2.11.0-beta.54
A virtual tabletop for multiplayer card games
|
Tab for browsing, searching, and filtering Archidekt decks. More...
#include <tab_archidekt.h>
Public Slots | |
| void | doSearch () |
| Trigger a debounced search using the current filters. | |
| void | doSearchImmediate () |
| Immediately trigger a search using the current filters. | |
| void | loadNextPage () |
| Load the next page of results for infinite scroll. | |
| 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. | |
| CardSizeWidget * | getCardSizeSlider () |
| Get the card size slider widget. | |
| Public Member Functions inherited from Tab | |
| Tab (TabSupervisor *_tabSupervisor) | |
| const QList< QMenu * > & | getTabMenus () const |
| TabSupervisor * | getTabSupervisor () const |
| bool | getContentsChanged () const |
| void | setContentsChanged (bool _contentsChanged) |
| virtual bool | closeRequest () |
| virtual void | tabActivated () |
Protected Member Functions | |
| bool | eventFilter (QObject *obj, QEvent *event) override |
| Event filter to catch wheel events for infinite scroll. | |
| Protected Member Functions inherited from Tab | |
| void | addTabMenu (QMenu *menu) |
Private Member Functions | |
| void | initializeUi () |
| Initialize the main UI layout and toolbars. | |
| void | setupFilterWidgets () |
| Set up all filter widgets. | |
| void | connectSignals () |
| Connect all signals and slots for UI interactions. | |
| void | updatePackageModeState (bool isPackageMode) |
| Update UI state when package mode is toggled. | |
Private Attributes | |
| QNetworkAccessManager * | networkManager |
| Network manager for handling API requests. | |
| QTimer * | searchDebounceTimer |
| Timer to debounce search requests. | |
| int | currentPage |
| Current page number for infinite scroll. | |
| bool | isLoadingMore |
| Flag to prevent multiple simultaneous page loads. | |
| bool | isListMode |
| ArchidektApiResponseDeckListingsDisplayWidget * | listingsWidget = nullptr |
| QWidget * | container |
| Root container for the entire tab. | |
| QVBoxLayout * | mainLayout |
| Outer vertical layout containing toolbars and results. | |
| QWidget * | primaryToolbar |
| Primary toolbar with most important filters. | |
| QHBoxLayout * | primaryToolbarLayout |
| Layout for primary toolbar. | |
| QWidget * | secondaryToolbar |
| Secondary toolbar with advanced filters. | |
| QHBoxLayout * | secondaryToolbarLayout |
| Layout for secondary toolbar. | |
| QScrollArea * | scrollArea |
| Scrollable area for results (enables infinite scroll) | |
| QWidget * | resultsContainer |
| Container widget inside scroll area. | |
| QVBoxLayout * | resultsLayout |
| Layout for results (decks appended here) | |
| QLabel * | sortByLabel |
| Label for sort controls. | |
| QComboBox * | orderByCombo |
| Dropdown for selecting the sort field. | |
| QPushButton * | orderDirButton |
| Toggle button for ascending/descending sort. | |
| QLabel * | filterByLabel |
| Label for filter controls. | |
| QList< ManaSymbolWidget * > | colorSymbols |
| Mana symbol toggle buttons. | |
| QSet< QChar > | activeColors |
| Set of currently active mana colors. | |
| QCheckBox * | logicalAndCheck |
| Require ALL selected colors instead of ANY. | |
| QLineEdit * | nameField |
| Input for deck name filter. | |
| QLineEdit * | ownerField |
| Input for owner name filter. | |
| QCheckBox * | packagesCheck |
| Toggle for searching card packages instead of full decks. | |
| QPushButton * | searchButton |
| Button to trigger search. | |
| QPushButton * | advancedFiltersButton |
| Button to show/hide advanced filters. | |
| SettingsButtonWidget * | settingsButton |
| Container for card size settings. | |
| CardSizeWidget * | cardSizeSlider |
| Slider to adjust card size in results. | |
| QLineEdit * | cardsField |
| Input for cards included in the deck. | |
| QLineEdit * | commandersField |
| Input for commander cards. | |
| QLineEdit * | deckTagNameField |
| Input for deck tag filtering. | |
| SettingsButtonWidget * | formatButton |
| Collapsible button for format filters. | |
| QVector< QCheckBox * > | formatChecks |
| Individual checkboxes for each format. | |
| QComboBox * | edhBracketCombo |
| Dropdown for EDH bracket selection. | |
| SettingsButtonWidget * | deckSizeButton |
| Collapsible button for deck size filter. | |
| QSpinBox * | minDeckSizeSpin |
| Spinner to select minimum deck size. | |
| QComboBox * | minDeckSizeLogicCombo |
| Combo box for size comparison logic. | |
| 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 Attributes inherited from Tab | |
| TabSupervisor * | tabSupervisor |
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 supports infinite scroll pagination for seamless browsing.
|
explicit |
Construct a new TabArchidekt object.
| _tabSupervisor | Parent 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.
|
slot |
Navigate to a specified page URL.
| url | The URL to request |
Typically called when a deck card is clicked in the listing.
| QString TabArchidekt::buildSearchUrl | ( | ) |
Construct the search URL from all current filters.
The search URL is dynamically built using the state of all filter widgets. Parameters included:
|
private |
Connect all signals and slots for UI interactions.
Links all widget signals to their appropriate handlers, including search triggers, filter changes, package mode toggling, and infinite scroll.
|
slot |
Trigger a debounced search using the current filters.
Resets to page 1 and starts the debounce timer. The actual search will execute after 300ms of inactivity.
|
slot |
Immediately trigger a search using the current filters.
Sends a network request to the Archidekt API using the URL generated by buildSearchUrl(). Updates the results display asynchronously.
|
overrideprotected |
Event filter to catch wheel events for infinite scroll.
| obj | The object that received the event |
| event | The event to filter |
|
inline |
Get the card size slider widget.
Allows external code to read or manipulate the current card size or hook up the sliders signals.
|
inlineoverridevirtual |
Retrieve the tab display text.
If a card is pre-selected (cardToQuery), its name is appended to the tab title.
Implements Tab.
|
slot |
Fetch top decks from the Archidekt API.
Called on initialization to populate the initial results display.
|
private |
Initialize the main UI layout and toolbars.
Creates the container, main layout, primary toolbar (sort, colors, name, owner, packages), secondary toolbar (advanced filters), and scrollable results area.
|
slot |
Load the next page of results for infinite scroll.
Increments the current page and fetches additional results, which are appended to the existing results display.
|
slot |
Pretty-print a QJsonValue for debugging.
| value | The JSON value to print |
| indentLevel | The indentation depth (number of levels) |
|
slot |
Process a network reply containing JSON data.
| reply | QNetworkReply object with the API response |
Determines whether the response corresponds to a deck listing or a single deck, and dispatches it to the appropriate handler.
|
slot |
Handle a JSON response for a single deck.
| reply | QJsonObject containing deck data |
Clears the results area and displays the single deck details.
|
slot |
Handle a JSON response containing multiple decks.
| reply | QJsonObject containing deck listings |
If this is page 1, clears previous results. Appends new results to the display.
|
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.
|
private |
Set up all filter widgets.
Creates filter widgets for:
|
private |
Update UI state when package mode is toggled.
| isPackageMode | Whether package mode is currently enabled |
Disables format-specific and commander-specific filters when searching for card packages instead of full decks.
|
private |
Set of currently active mana colors.
|
private |
Button to show/hide advanced filters.
|
private |
Input for cards included in the deck.
|
private |
Slider to adjust card size in results.
|
private |
Optional pre-selected card for initial filtering.
|
private |
Mana symbol toggle buttons.
|
private |
Input for commander cards.
|
private |
Root container for the entire tab.
|
private |
Current page number for infinite scroll.
|
private |
Collapsible button for deck size filter.
|
private |
Input for deck tag filtering.
|
private |
Dropdown for EDH bracket selection.
|
private |
Label for filter controls.
|
private |
Collapsible button for format filters.
|
private |
Individual checkboxes for each format.
|
private |
|
private |
Flag to prevent multiple simultaneous page loads.
|
private |
|
private |
Require ALL selected colors instead of ANY.
|
private |
Outer vertical layout containing toolbars and results.
|
private |
Combo box for size comparison logic.
|
private |
Spinner to select minimum deck size.
|
private |
Input for deck name filter.
|
private |
Network manager for handling API requests.
|
private |
Dropdown for selecting the sort field.
|
private |
Toggle button for ascending/descending sort.
|
private |
Input for owner name filter.
|
private |
Toggle for searching card packages instead of full decks.
|
private |
Primary toolbar with most important filters.
|
private |
Layout for primary toolbar.
|
private |
Container widget inside scroll area.
|
private |
Layout for results (decks appended here)
|
private |
Scrollable area for results (enables infinite scroll)
|
private |
Button to trigger search.
|
private |
Timer to debounce search requests.
|
private |
Secondary toolbar with advanced filters.
|
private |
Layout for secondary toolbar.
|
private |
Container for card size settings.
|
private |
Label for sort controls.