Bidding round control communicating with the server.

This commit is contained in:
2026-02-13 20:24:48 +01:00
parent ba4f95eb2d
commit cfd3031cf9
8 changed files with 149 additions and 11 deletions

View File

@ -574,6 +574,13 @@ void MainWindow::setupEventTab() {
m_biddingRoundControl = make_unique<BiddingRoundControl>();
containerLayout->addWidget(m_biddingRoundControl.get());
/// requests
connect(m_biddingRoundControl.get(), &BiddingRoundControl::sendGetRequest, m_core.get(),
&GenericCore::sendGetRequest);
/// responses
connect(m_core.get(), &GenericCore::currentBiddingRoundChanged, m_biddingRoundControl.get(),
&BiddingRoundControl::onCurrentBiddingRoundChanged);
ui->tabWidget->insertTab(0, containerWidget, "Event (&1)");
}

View File

@ -27,11 +27,11 @@ BiddingRoundControl::BiddingRoundControl(QWidget* parent)
m_layout->addWidget(m_refreshRoundButton);
connect(m_newRoundButton, &QPushButton::clicked, this,
&BiddingRoundControl::triggerStartNewRound);
&BiddingRoundControl::onStartNewRoundTriggered);
connect(m_restartRoundButton, &QPushButton::clicked, this,
&BiddingRoundControl::triggerRestartLastRound);
&BiddingRoundControl::onRestartLastRoundTriggered);
connect(m_stopRoundButton, &QPushButton::clicked, this,
&BiddingRoundControl::triggerStopCurrentRound);
&BiddingRoundControl::onStopCurrentRoundTriggered);
connect(m_refreshRoundButton, &QPushButton::clicked, this,
&BiddingRoundControl::onRefreshCurrentRoundTriggered);
}
@ -40,6 +40,16 @@ void BiddingRoundControl::onRefreshCurrentRoundTriggered() {
emit sendGetRequest(GetCurrentBiddingRound);
}
void BiddingRoundControl::onStartNewRoundTriggered() { emit sendGetRequest(StartNewBiddingRound); }
void BiddingRoundControl::onRestartLastRoundTriggered() {
emit sendGetRequest(RestartLastBiddingRound);
}
void BiddingRoundControl::onStopCurrentRoundTriggered() {
emit sendGetRequest(StopCurrentBiddingRound);
}
void BiddingRoundControl::onCurrentBiddingRoundChanged(int roundNumber, bool isActive) {
QString text = QString::number(roundNumber);
if (isActive) {

View File

@ -23,6 +23,9 @@ class BiddingRoundControl : public QWidget {
public slots:
/// button slots
void onRefreshCurrentRoundTriggered();
void onStartNewRoundTriggered();
void onRestartLastRoundTriggered();
void onStopCurrentRoundTriggered();
/// event slots
void onCurrentBiddingRoundChanged(int roundNumber, bool isActive);