Tab for browsing, searching, and filtering Archidekt decks. More...
#include <tab_archidekt.h>
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. | |
| 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 () |
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". | |
| SettingsButtonWidget * | formatSettingsWidget |
| 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. | |
| SettingsButtonWidget * | settingsButton |
| Container for additional UI settings. | |
| CardSizeWidget * | cardSizeSlider |
| 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 | |
| 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 also provides sorting and pagination, as well as a card size adjustment widget.
|
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 navigation button is clicked in a deck 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:
|
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.
|
slot |
|
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 page 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 top decks query 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 previous page display and creates a new display widget for the deck details.
|
slot |
Handle a JSON response containing multiple decks.
| reply | QJsonObject containing top deck listings |
Clears the previous page display and creates a new display widget for the results.
|
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 of currently active mana colors.
|
private |
Input for cards included in the deck (comma-separated)
|
private |
Slider to adjust card size in results.
|
private |
Optional pre-selected card for initial filtering.
|
private |
Input for commander cards (comma-separated)
|
private |
Root container for the entire tab.
|
private |
Widget containing the currently displayed deck(s)
|
private |
Layout for deck display widgets.
|
private |
Input for deck tag filtering.
|
private |
Dropdown for EDH bracket selection.
|
private |
Individual checkboxes for each format.
|
private |
Label displaying "Formats".
|
private |
Collapsible widget containing format checkboxes.
|
private |
Require ALL selected colors instead of ANY.
|
private |
Outer vertical layout containing navigation and page display.
|
private |
Label for minimum number of cards per deck.
|
private |
Combo box for the size logic to apply.
|
private |
Spinner to select minimum deck size.
|
private |
Input for deck name filter.
|
private |
Container for all navigation/filter controls.
|
private |
Layout for horizontal arrangement of filter widgets.
| QNetworkAccessManager* TabArchidekt::networkManager |
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 |
Label for current page selection.
|
private |
Spinner to select the page number for results.
|
private |
Timer to debounce search requests by spin-boxes etc.
|
private |
Button to trigger the search manually.
|
private |
Container for additional UI settings.