mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 17:44:01 -07:00
Let's not lambda it and slot it instead.
This commit is contained in:
parent
af2502905e
commit
ea6fbd09f4
2 changed files with 16 additions and 17 deletions
|
|
@ -67,7 +67,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
|||
orderDirButton->setCheckable(true); // checked = DESC, unchecked = ASC
|
||||
orderDirButton->setChecked(true);
|
||||
|
||||
connect(orderByCombo, &QComboBox::currentTextChanged, this, [this]() { doSearch(); });
|
||||
connect(orderByCombo, &QComboBox::currentTextChanged, this, &TabArchidekt::doSearch);
|
||||
connect(orderDirButton, &QPushButton::clicked, this, [this](bool checked) {
|
||||
orderDirButton->setText(checked ? tr("Desc.") : tr("Asc."));
|
||||
doSearch();
|
||||
|
|
@ -106,7 +106,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
|||
|
||||
for (int i = 0; i < formatNames.size(); ++i) {
|
||||
QCheckBox *formatCheckBox = new QCheckBox(formatNames[i], navigationContainer);
|
||||
connect(formatCheckBox, &QCheckBox::clicked, this, [this]() { doSearch(); });
|
||||
connect(formatCheckBox, &QCheckBox::clicked, this, &TabArchidekt::doSearch);
|
||||
formatChecks << formatCheckBox;
|
||||
formatSettingsWidget->addSettingsWidget(formatCheckBox);
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
|||
edhBracketCombo->addItem(tr("Any Bracket"));
|
||||
edhBracketCombo->addItems({"1", "2", "3", "4", "5"});
|
||||
|
||||
connect(edhBracketCombo, &QComboBox::currentTextChanged, this, [this]() { doSearch(); });
|
||||
connect(edhBracketCombo, &QComboBox::currentTextChanged, this, &TabArchidekt::doSearch);
|
||||
|
||||
// Search for Card Packages instead of Decks
|
||||
packagesCheck = new QCheckBox("Packages", navigationContainer);
|
||||
|
|
@ -191,13 +191,13 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
|||
deckTagNameField = new QLineEdit(navigationContainer);
|
||||
deckTagNameField->setPlaceholderText("Deck tag");
|
||||
|
||||
connect(deckTagNameField, &QLineEdit::textChanged, this, [this]() { doSearch(); });
|
||||
connect(deckTagNameField, &QLineEdit::textChanged, this, &TabArchidekt::doSearch);
|
||||
|
||||
// Search button
|
||||
searchPushButton = new QPushButton(navigationContainer);
|
||||
searchPushButton->setText("Search");
|
||||
|
||||
connect(searchPushButton, &QPushButton::clicked, this, [this]() { doSearch(); });
|
||||
connect(searchPushButton, &QPushButton::clicked, this, &TabArchidekt::doSearch);
|
||||
|
||||
// Card Size settings
|
||||
settingsButton = new SettingsButtonWidget(this);
|
||||
|
|
@ -217,8 +217,8 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
|||
minDeckSizeLogicCombo->addItems({"Exact", "≥", "≤"}); // Exact = unset, ≥ = GTE, ≤ = LTE
|
||||
minDeckSizeLogicCombo->setCurrentIndex(1); // default GTE
|
||||
|
||||
connect(minDeckSizeSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, [this]() { doSearch(); });
|
||||
connect(minDeckSizeLogicCombo, &QComboBox::currentTextChanged, this, [this]() { doSearch(); });
|
||||
connect(minDeckSizeSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &TabArchidekt::doSearch);
|
||||
connect(minDeckSizeLogicCombo, &QComboBox::currentTextChanged, this, &TabArchidekt::doSearch);
|
||||
|
||||
// Page number
|
||||
pageLabel = new QLabel(navigationContainer);
|
||||
|
|
@ -227,7 +227,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
|||
pageSpin->setRange(1, 9999);
|
||||
pageSpin->setValue(1);
|
||||
|
||||
connect(pageSpin, &QSpinBox::valueChanged, this, [this]() { doSearch(); });
|
||||
connect(pageSpin, &QSpinBox::valueChanged, this, &TabArchidekt::doSearch);
|
||||
|
||||
// Page display
|
||||
currentPageDisplay = new QWidget(container);
|
||||
|
|
|
|||
|
|
@ -67,15 +67,6 @@ public:
|
|||
*/
|
||||
QString buildSearchUrl();
|
||||
|
||||
/**
|
||||
* @brief 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.
|
||||
*/
|
||||
void doSearch();
|
||||
void doSearchImmediate();
|
||||
|
||||
/**
|
||||
* @brief Retrieve the tab display text
|
||||
* @return QString Human-readable title for the tab
|
||||
|
|
@ -103,6 +94,14 @@ public:
|
|||
QNetworkAccessManager *networkManager;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief 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.
|
||||
*/
|
||||
void doSearch();
|
||||
void doSearchImmediate();
|
||||
/**
|
||||
* @brief Process a network reply containing JSON data
|
||||
* @param reply QNetworkReply object with the API response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue