From a4d2815947d2f1d971e9ea2659396074de441f98 Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Fri, 13 Feb 2026 16:12:03 +0100 Subject: [PATCH 1/7] Added an "Event" tab with a BiddingRoundControl class in it. No connections of signals and slots yet. --- UIs/BeetRoundWidgets/CMakeLists.txt | 1 + UIs/BeetRoundWidgets/mainwindow.cpp | 18 ++++-- UIs/BeetRoundWidgets/mainwindow.h | 7 ++- UIs/BeetRoundWidgets/mainwindow.ui | 30 +++++----- .../widgets/biddingroundcontrol.cpp | 57 +++++++++++++++++++ .../widgets/biddingroundcontrol.h | 41 +++++++++++++ libs/BeetRoundCore/model/metadata.h | 3 + 7 files changed, 134 insertions(+), 23 deletions(-) create mode 100644 UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp create mode 100644 UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h diff --git a/UIs/BeetRoundWidgets/CMakeLists.txt b/UIs/BeetRoundWidgets/CMakeLists.txt index 8c97104..1e558a0 100644 --- a/UIs/BeetRoundWidgets/CMakeLists.txt +++ b/UIs/BeetRoundWidgets/CMakeLists.txt @@ -36,6 +36,7 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) views/itemdetailmapper.h views/itemdetailmapper.cpp widgets/comboboxdelegate.h widgets/comboboxdelegate.cpp widgets/spinboxdelegate.h widgets/spinboxdelegate.cpp + widgets/biddingroundcontrol.h widgets/biddingroundcontrol.cpp ) # Define target properties for Android with Qt 6 as: # set_property(TARGET ${TARGET_APP} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR diff --git a/UIs/BeetRoundWidgets/mainwindow.cpp b/UIs/BeetRoundWidgets/mainwindow.cpp index 5b3985f..d783106 100644 --- a/UIs/BeetRoundWidgets/mainwindow.cpp +++ b/UIs/BeetRoundWidgets/mainwindow.cpp @@ -17,6 +17,7 @@ #include "model/generalsortfiltermodel.h" #include "model/metadata.h" #include "model/tablemodel.h" +#include "widgets/biddingroundcontrol.h" #include "widgets/comboboxdelegate.h" #include "widgets/spinboxdelegate.h" @@ -70,6 +71,8 @@ MainWindow::MainWindow(QWidget* parent) onSelectionChanged(QItemSelection(), QItemSelection()); onCurrentChanged(QModelIndex(), QModelIndex()); + + setupEventTab(); } MainWindow::~MainWindow() { delete ui; } @@ -176,11 +179,6 @@ void MainWindow::on_actionCheck_for_update_triggered() { } } -void MainWindow::on_pushButton_clicked() { - const QString prefix("Backend provided by: "); - ui->label->setText(prefix + m_core->toString()); -} - void MainWindow::openNewItemDialog() { showStatusMessage(tr("Invoked 'Edit|New Item'")); m_newItemDialog->show(); @@ -569,3 +567,13 @@ void MainWindow::createGuiDialogs() { m_editItemDialog = make_unique(ui->tableView, this); m_editItemDialog->createContent(); } + +void MainWindow::setupEventTab() { + QWidget* containerWidget = new QWidget(); + QVBoxLayout* containerLayout = new QVBoxLayout(containerWidget); + m_biddingRoundControl = make_unique(); + containerLayout->addWidget(m_biddingRoundControl.get()); + + + ui->tabWidget->insertTab(0, containerWidget, "Event (&1)"); +} diff --git a/UIs/BeetRoundWidgets/mainwindow.h b/UIs/BeetRoundWidgets/mainwindow.h index b8f9949..6ad35e4 100644 --- a/UIs/BeetRoundWidgets/mainwindow.h +++ b/UIs/BeetRoundWidgets/mainwindow.h @@ -19,6 +19,7 @@ class TableModel; class GeneralSortFilterModel; class NewItemDialog; class EditItemDialog; +class BiddingRoundControl; using namespace std; @@ -44,8 +45,6 @@ class MainWindow : public QMainWindow { void onAboutClicked(); void on_actionCheck_for_update_triggered(); - void on_pushButton_clicked(); - /// slots for menu actions void openNewItemDialog(); void openEditItemDialog(); @@ -78,7 +77,7 @@ class MainWindow : public QMainWindow { shared_ptr m_proxyModel; QUndoStack* m_modelUndoStack; unique_ptr m_modelUndoView; - + unique_ptr m_biddingRoundControl; /// File actions unique_ptr m_newFileAct; unique_ptr m_openAct; @@ -119,5 +118,7 @@ class MainWindow : public QMainWindow { void createToolsActions(); void createHelpMenu(); void createGuiDialogs(); + + void setupEventTab(); }; #endif // MAINWINDOW_H diff --git a/UIs/BeetRoundWidgets/mainwindow.ui b/UIs/BeetRoundWidgets/mainwindow.ui index d32d7f5..86e34b6 100644 --- a/UIs/BeetRoundWidgets/mainwindow.ui +++ b/UIs/BeetRoundWidgets/mainwindow.ui @@ -14,22 +14,22 @@ GenericQtClient - - - - - - - - Push the button! - - - - - - - Button + + + + + 0 + + + Mitglieder (&2) + + + + + + + diff --git a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp new file mode 100644 index 0000000..9c4bffc --- /dev/null +++ b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp @@ -0,0 +1,57 @@ +#include "biddingroundcontrol.h" + +#include +#include +#include + +BiddingRoundControl::BiddingRoundControl(QWidget* parent) + : QWidget{parent} { + m_layout = new QHBoxLayout(this); + m_title = new QLabel("Bidding round control:"); + m_status = new QLabel("(No round started yet.)"); + + m_newRoundButton = new QPushButton("Start new round"); + m_restartRoundButton = new QPushButton("Restart last round"); + m_stopRoundButton = new QPushButton("Stop round"); + m_refreshRoundButton = new QPushButton("Refresh"); + + m_newRoundButton->setEnabled(false); + m_restartRoundButton->setEnabled(false); + m_stopRoundButton->setEnabled(false); + + m_layout->addWidget(m_title); + m_layout->addWidget(m_status); + m_layout->addWidget(m_newRoundButton); + m_layout->addWidget(m_restartRoundButton); + m_layout->addWidget(m_stopRoundButton); + m_layout->addWidget(m_refreshRoundButton); + + connect(m_newRoundButton, &QPushButton::clicked, this, + &BiddingRoundControl::triggerStartNewRound); + connect(m_restartRoundButton, &QPushButton::clicked, this, + &BiddingRoundControl::triggerRestartLastRound); + connect(m_stopRoundButton, &QPushButton::clicked, this, + &BiddingRoundControl::triggerStopCurrentRound); + connect(m_refreshRoundButton, &QPushButton::clicked, this, + &BiddingRoundControl::onRefreshCurrentRoundTriggered); +} + +void BiddingRoundControl::onRefreshCurrentRoundTriggered() { + emit sendGetRequest(GetCurrentBiddingRound); +} + +void BiddingRoundControl::onCurrentBiddingRoundChanged(int roundNumber, bool isActive) { + QString text = QString::number(roundNumber); + if (isActive) { + text.append(" (active)"); + m_newRoundButton->setEnabled(false); + m_restartRoundButton->setEnabled(false); + m_stopRoundButton->setEnabled(true); + } else { + text.append(" (stopped)"); + m_newRoundButton->setEnabled(true); + m_restartRoundButton->setEnabled(roundNumber > 0); + m_stopRoundButton->setEnabled(false); + } + m_status->setText(text); +} diff --git a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h new file mode 100644 index 0000000..3b54c74 --- /dev/null +++ b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h @@ -0,0 +1,41 @@ +#ifndef BIDDINGROUNDCONTROL_H +#define BIDDINGROUNDCONTROL_H + +#include +#include "model/metadata.h" + +class QPushButton; +class QLabel; +class QHBoxLayout; +class BiddingRoundControl : public QWidget { + Q_OBJECT + public: + explicit BiddingRoundControl(QWidget* parent = nullptr); + + signals: + void sendGetRequest(GetRequestTypes type); + + void triggerStartNewRound(); + void triggerRestartLastRound(); + void triggerStopCurrentRound(); + // void refreshCurrentRound(); + + public slots: + /// button slots + void onRefreshCurrentRoundTriggered(); + + /// event slots + void onCurrentBiddingRoundChanged(int roundNumber, bool isActive); + + private: + QHBoxLayout* m_layout = nullptr; + QLabel* m_title = nullptr; + QLabel* m_status = nullptr; + + QPushButton* m_newRoundButton = nullptr; + QPushButton* m_restartRoundButton = nullptr; + QPushButton* m_stopRoundButton = nullptr; + QPushButton* m_refreshRoundButton = nullptr; +}; + +#endif // BIDDINGROUNDCONTROL_H diff --git a/libs/BeetRoundCore/model/metadata.h b/libs/BeetRoundCore/model/metadata.h index 435511b..0e8dd84 100644 --- a/libs/BeetRoundCore/model/metadata.h +++ b/libs/BeetRoundCore/model/metadata.h @@ -82,6 +82,9 @@ static const QString ITEM_KEY_STRING = "item"; /// file naming static const QString ITEMS_FILE_NAME = ITEMS_KEY_STRING + ".json"; +/// server communication +enum GetRequestTypes { GetCurrentBiddingRound }; + /// functions static UserRoles GET_ROLE_FOR_COLUMN(const int column) { switch (column) { From ba4f95eb2d80396e2fbf4cc4a365544e6a1c3814 Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Fri, 13 Feb 2026 17:56:05 +0100 Subject: [PATCH 2/7] Added two minor refactoring todos. --- UIs/BeetRoundWidgets/widgets/comboboxdelegate.h | 3 ++- UIs/BeetRoundWidgets/widgets/spinboxdelegate.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/UIs/BeetRoundWidgets/widgets/comboboxdelegate.h b/UIs/BeetRoundWidgets/widgets/comboboxdelegate.h index 59a03c3..a79b5d8 100644 --- a/UIs/BeetRoundWidgets/widgets/comboboxdelegate.h +++ b/UIs/BeetRoundWidgets/widgets/comboboxdelegate.h @@ -2,9 +2,10 @@ #define COMBOBOXDELEGATE_H #include - class QStringListModel; + class ComboboxDelegate : public QStyledItemDelegate { + // TODO move source code files into subfolder "widgets/delegate" Q_OBJECT public: explicit ComboboxDelegate(const QStringList items, QObject* parent = nullptr); diff --git a/UIs/BeetRoundWidgets/widgets/spinboxdelegate.h b/UIs/BeetRoundWidgets/widgets/spinboxdelegate.h index 1016640..a5e9920 100644 --- a/UIs/BeetRoundWidgets/widgets/spinboxdelegate.h +++ b/UIs/BeetRoundWidgets/widgets/spinboxdelegate.h @@ -4,6 +4,7 @@ #include class SpinboxDelegate : public QStyledItemDelegate { + // TODO move source code files into subfolder "widgets/delegate" Q_OBJECT public: explicit SpinboxDelegate(QObject* parent = nullptr); From cfd3031cf9f36123df713c4e6046cc45114a8e8b Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Fri, 13 Feb 2026 20:24:48 +0100 Subject: [PATCH 3/7] Bidding round control communicating with the server. --- UIs/BeetRoundWidgets/mainwindow.cpp | 7 ++ .../widgets/biddingroundcontrol.cpp | 16 +++- .../widgets/biddingroundcontrol.h | 3 + libs/BeetRoundCore/genericcore.h | 10 ++ libs/BeetRoundCore/model/metadata.h | 7 +- libs/BeetRoundCore/network/apiroutes.h | 6 ++ .../network/servercommunicator.cpp | 93 ++++++++++++++++++- .../network/servercommunicator.h | 18 +++- 8 files changed, 149 insertions(+), 11 deletions(-) diff --git a/UIs/BeetRoundWidgets/mainwindow.cpp b/UIs/BeetRoundWidgets/mainwindow.cpp index d783106..5487c98 100644 --- a/UIs/BeetRoundWidgets/mainwindow.cpp +++ b/UIs/BeetRoundWidgets/mainwindow.cpp @@ -574,6 +574,13 @@ void MainWindow::setupEventTab() { m_biddingRoundControl = make_unique(); 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)"); } diff --git a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp index 9c4bffc..71dfbe1 100644 --- a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp +++ b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.cpp @@ -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) { diff --git a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h index 3b54c74..ef03c47 100644 --- a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h +++ b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h @@ -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); diff --git a/libs/BeetRoundCore/genericcore.h b/libs/BeetRoundCore/genericcore.h index 4bf30ea..87cc867 100644 --- a/libs/BeetRoundCore/genericcore.h +++ b/libs/BeetRoundCore/genericcore.h @@ -3,6 +3,8 @@ #include +#include "model/metadata.h" + class QUndoStack; class QAbstractItemModel; class QAbstractItemModelTester; @@ -48,6 +50,14 @@ class GenericCore : public QObject { signals: void displayStatusMessage(QString message); + + /// *** server communication *** + /// request signals + void sendGetRequest(GetRequestTypes type); + /// response signals + void currentBiddingRoundChanged(int round, bool isRunning); + + /// deprecated signals void fetchItemsFromServer(); void postItemToServer(const QByteArray& jsonData); void deleteItemFromServer(const QString& id); diff --git a/libs/BeetRoundCore/model/metadata.h b/libs/BeetRoundCore/model/metadata.h index 0e8dd84..5b8c471 100644 --- a/libs/BeetRoundCore/model/metadata.h +++ b/libs/BeetRoundCore/model/metadata.h @@ -83,7 +83,12 @@ static const QString ITEM_KEY_STRING = "item"; static const QString ITEMS_FILE_NAME = ITEMS_KEY_STRING + ".json"; /// server communication -enum GetRequestTypes { GetCurrentBiddingRound }; +enum GetRequestTypes { + GetCurrentBiddingRound, + StartNewBiddingRound, + RestartLastBiddingRound, + StopCurrentBiddingRound +}; /// functions static UserRoles GET_ROLE_FOR_COLUMN(const int column) { diff --git a/libs/BeetRoundCore/network/apiroutes.h b/libs/BeetRoundCore/network/apiroutes.h index e89da3a..1f54111 100644 --- a/libs/BeetRoundCore/network/apiroutes.h +++ b/libs/BeetRoundCore/network/apiroutes.h @@ -9,4 +9,10 @@ static const QString apiPrefix = "/api/"; static const QString ROUTE_ITEMS = apiPrefix + "items"; +static const QString ROUTE_BIDDINGROUNDS = apiPrefix + "bidding_rounds"; +static const QString ROUTE_CURRENT_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/get_current"; +static const QString ROUTE_START_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/start_new"; +static const QString ROUTE_RESTART_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/restart"; +static const QString ROUTE_STOP_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/stop"; + #endif // APIROUTES_H diff --git a/libs/BeetRoundCore/network/servercommunicator.cpp b/libs/BeetRoundCore/network/servercommunicator.cpp index 7545e2e..4ff6237 100644 --- a/libs/BeetRoundCore/network/servercommunicator.cpp +++ b/libs/BeetRoundCore/network/servercommunicator.cpp @@ -1,21 +1,27 @@ #include "servercommunicator.h" -#include "apiroutes.h" #include -#include #include +#include #include +#include "../genericcore.h" +#include "apiroutes.h" + using namespace Qt::StringLiterals; -ServerCommunicator::ServerCommunicator(QObject* parent) - : QObject{parent} { +ServerCommunicator::ServerCommunicator(GenericCore* core) + : m_core(core) + , QObject{core} { m_netManager.setAutoDeleteReplies(true); m_restManager = std::make_shared(&m_netManager); m_serviceApi = std::make_shared(); + + connect(m_core, &GenericCore::sendGetRequest, this, + &ServerCommunicator::onSendGetRequestTriggered); } -bool ServerCommunicator::sslSupported() { +bool ServerCommunicator::sslSupported() const { #if QT_CONFIG(ssl) return QSslSocket::supportsSsl(); #else @@ -104,3 +110,80 @@ void ServerCommunicator::setServerConfiguration(const QString url, m_email = email; m_password = password; } + +void ServerCommunicator::onSendGetRequestTriggered(const GetRequestTypes type) { + QString path; + switch (type) { + case GetCurrentBiddingRound: + path = ROUTE_CURRENT_BIDDINGROUND; + break; + case StartNewBiddingRound: + path = ROUTE_START_BIDDINGROUND; + break; + case RestartLastBiddingRound: + path = ROUTE_RESTART_BIDDINGROUND; + break; + case StopCurrentBiddingRound: + path = ROUTE_STOP_BIDDINGROUND; + break; + default: + qWarning() << "No route found for GetRequestType:" << type; + break; + } + + // TODO move into default case of switch statement? + if (path.isEmpty()) { + qDebug() << "Empty path -> Not sending a request."; + return; + } + + const QNetworkRequest request = m_serviceApi->createRequest(path); + + m_restManager->get(request, this, [this, type](QRestReply& reply) { + if (reply.isSuccess()) { + qInfo() << "Request successful."; + const QJsonDocument doc = reply.readJson().value(); + onGetReplySuccessful(type, doc); + } else { + if (reply.hasError()) { + const QString errorString = reply.errorString(); + qWarning() << "Network error:" << errorString; + onGetReplyFailure(type, errorString); + } else { + int statusCode = reply.httpStatus(); + qWarning() << "Request not successful:" << statusCode; + onGetReplyFailure(type, QString("HTTP status code: %1").arg(statusCode)); + } + } + }); +} + +void ServerCommunicator::onGetReplySuccessful(const GetRequestTypes type, const QJsonDocument doc) { + switch (type) { + case GetCurrentBiddingRound: + case StartNewBiddingRound: + case RestartLastBiddingRound: + case StopCurrentBiddingRound: + currentBiddingRoundChangedReply(doc); + break; + default: + qWarning() << "Can't match request type:" << type; + break; + } +} + +void ServerCommunicator::onGetReplyFailure(const GetRequestTypes type, const QString errorString) { + const QString message = + QString("Request of type %1 returned: %2").arg(QString::number(type), errorString); + m_core->displayStatusMessage(message); +} + +void ServerCommunicator::currentBiddingRoundChangedReply(const QJsonDocument jsonDoc) { + qInfo() << "Current bidding round received."; + const QJsonObject rootObject = jsonDoc["data"].toObject(); + const int roundNumber = rootObject["round_number"].toInt(); + const bool stopped = rootObject["stopped"].toBool(); + const bool isActive = !stopped; + + emit m_core->currentBiddingRoundChanged(roundNumber, isActive); +} diff --git a/libs/BeetRoundCore/network/servercommunicator.h b/libs/BeetRoundCore/network/servercommunicator.h index 3107604..30b971e 100644 --- a/libs/BeetRoundCore/network/servercommunicator.h +++ b/libs/BeetRoundCore/network/servercommunicator.h @@ -1,17 +1,22 @@ #ifndef SERVERCOMMUNICATOR_H #define SERVERCOMMUNICATOR_H +#include #include #include #include #include +#include "../model/metadata.h" + +class GenericCore; + class ServerCommunicator : public QObject { Q_OBJECT public: - explicit ServerCommunicator(QObject* parent = nullptr); + explicit ServerCommunicator(GenericCore* core); - bool sslSupported(); + bool sslSupported() const; QUrl url() const; void setUrl(const QUrl& url); @@ -19,6 +24,10 @@ class ServerCommunicator : public QObject { void setServerConfiguration(const QString url, const QString email, const QString password); public slots: + void onSendGetRequestTriggered(const GetRequestTypes type); + void onGetReplySuccessful(const GetRequestTypes type, const QJsonDocument doc); + void onGetReplyFailure(const GetRequestTypes type, const QString errorString); + void fetchItems(); void postItems(const QByteArray& jsonData); void deleteItem(const QString& id); @@ -34,6 +43,8 @@ class ServerCommunicator : public QObject { void deleteRequestFailure(const QString errorString); private: + GenericCore* m_core = nullptr; + QNetworkAccessManager m_netManager; std::shared_ptr m_restManager; std::shared_ptr m_serviceApi; @@ -41,6 +52,9 @@ class ServerCommunicator : public QObject { QString m_email; QString m_password; // QString m_authToken; + + /// reply parser + void currentBiddingRoundChangedReply(const QJsonDocument jsonDoc); }; #endif // SERVERCOMMUNICATOR_H From 6e51aee3a5692adf05ac098d0a6ad731cc04e73e Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Sat, 14 Feb 2026 10:02:00 +0100 Subject: [PATCH 4/7] Fetching current biddings from server menu. No extracting biddings from the response and merging into the model yet. --- UIs/BeetRoundWidgets/mainwindow.cpp | 46 ++++------------ UIs/BeetRoundWidgets/mainwindow.h | 8 +-- libs/BeetRoundCore/CMakeLists.txt | 1 + libs/BeetRoundCore/genericcore.cpp | 53 +------------------ libs/BeetRoundCore/genericcore.h | 9 +--- libs/BeetRoundCore/model/metadata.h | 4 +- libs/BeetRoundCore/network/apiroutes.h | 2 + .../network/servercommunicator.cpp | 26 +++++++++ .../network/servercommunicator.h | 7 ++- libs/BeetRoundCore/structs.h | 14 +++++ 10 files changed, 67 insertions(+), 103 deletions(-) create mode 100644 libs/BeetRoundCore/structs.h diff --git a/UIs/BeetRoundWidgets/mainwindow.cpp b/UIs/BeetRoundWidgets/mainwindow.cpp index 5487c98..1fb23d4 100644 --- a/UIs/BeetRoundWidgets/mainwindow.cpp +++ b/UIs/BeetRoundWidgets/mainwindow.cpp @@ -298,24 +298,9 @@ void MainWindow::findItems() { } } -void MainWindow::fetchItems() { - showStatusMessage(tr("Invoked 'Server|Fetch items'")); - emit m_core->fetchItemsFromServer(); -} - -void MainWindow::postItems() { - showStatusMessage(tr("Invoked 'Server|Post items'")); - const QModelIndex currentIndex = ui->tableView->currentIndex(); - const QByteArray jsonData = m_proxyModel->jsonDataForServer(currentIndex); - emit m_core->postItemToServer(jsonData); -} - -void MainWindow::deleteItem() { - showStatusMessage(tr("Invoked 'Server|Delete items'")); - const QModelIndex currentIndex = ui->tableView->currentIndex(); - // const QByteArray jsonData = m_proxyModel->jsonDataForServer(currentIndex); - const QString currentId = m_proxyModel->getUuid(currentIndex); - emit m_core->deleteItemFromServer(currentId); +void MainWindow::fetchCurrentBiddings() { + showStatusMessage(tr("Invoked 'Server|Fetch current biddings'")); + emit m_core->sendGetRequest(GetBiddingsOfHighestRound); } void MainWindow::execSettingsDialog() { @@ -520,25 +505,12 @@ void MainWindow::createEditActions() { } void MainWindow::createServerActions() { - m_fetchItemsAct = make_unique(tr("&Fetch item(s)"), this); - m_fetchItemsAct->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_Down)); - m_fetchItemsAct->setStatusTip(tr("Fetches all item on configured server")); - connect(m_fetchItemsAct.get(), &QAction::triggered, this, &MainWindow::fetchItems); - ui->menu_Server->addAction(m_fetchItemsAct.get()); - - m_postItemsAct = make_unique(tr("&Post item(s)"), this); - m_postItemsAct->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_Up)); - // m_postItemsAct->setStatusTip(tr("Posts the selected items on configured server")); - m_postItemsAct->setStatusTip(tr("Posts the current item on configured server")); - connect(m_postItemsAct.get(), &QAction::triggered, this, &MainWindow::postItems); - ui->menu_Server->addAction(m_postItemsAct.get()); - - m_deleteItemsAct = make_unique(tr("&Delete item"), this); - m_deleteItemsAct->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_Backspace)); - // m_deleteItemsAct->setStatusTip(tr("Deletes the selected items on configured server")); - m_deleteItemsAct->setStatusTip(tr("Deletes the current item on configured server")); - connect(m_deleteItemsAct.get(), &QAction::triggered, this, &MainWindow::deleteItem); - ui->menu_Server->addAction(m_deleteItemsAct.get()); + m_fetchCurrentBiddingsAct = make_unique(tr("&Fetch biddings"), this); + m_fetchCurrentBiddingsAct->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_Down)); + m_fetchCurrentBiddingsAct->setStatusTip(tr("Fetches all biddings of the current round")); + connect(m_fetchCurrentBiddingsAct.get(), &QAction::triggered, this, + &MainWindow::fetchCurrentBiddings); + ui->menu_Server->addAction(m_fetchCurrentBiddingsAct.get()); } void MainWindow::createToolsActions() { diff --git a/UIs/BeetRoundWidgets/mainwindow.h b/UIs/BeetRoundWidgets/mainwindow.h index 6ad35e4..75f610d 100644 --- a/UIs/BeetRoundWidgets/mainwindow.h +++ b/UIs/BeetRoundWidgets/mainwindow.h @@ -63,9 +63,7 @@ class MainWindow : public QMainWindow { void findItems(); /// 'Server' slots - void fetchItems(); - void postItems(); - void deleteItem(); + void fetchCurrentBiddings(); /// 'Tools' slots void execSettingsDialog(); @@ -97,9 +95,7 @@ class MainWindow : public QMainWindow { unique_ptr m_deleteItemAct; unique_ptr m_findItemAct; /// Server actions - unique_ptr m_fetchItemsAct; - unique_ptr m_postItemsAct; - unique_ptr m_deleteItemsAct; + unique_ptr m_fetchCurrentBiddingsAct; /// View actions unique_ptr m_showModelUndoViewAct; diff --git a/libs/BeetRoundCore/CMakeLists.txt b/libs/BeetRoundCore/CMakeLists.txt index 11492df..a028257 100644 --- a/libs/BeetRoundCore/CMakeLists.txt +++ b/libs/BeetRoundCore/CMakeLists.txt @@ -36,6 +36,7 @@ add_library(${TARGET_APP} STATIC model/generalsortfiltermodel.h model/generalsortfiltermodel.cpp network/servercommunicator.h network/servercommunicator.cpp network/apiroutes.h + structs.h # 3rd party libraries ../3rdParty/rapidcsv/src/rapidcsv.h ) diff --git a/libs/BeetRoundCore/genericcore.cpp b/libs/BeetRoundCore/genericcore.cpp index 6403ea5..bc57d80 100644 --- a/libs/BeetRoundCore/genericcore.cpp +++ b/libs/BeetRoundCore/genericcore.cpp @@ -155,36 +155,8 @@ bool GenericCore::isSyncServerSetup() const { } } -void GenericCore::onSendItemTriggered(const QByteArray& jsonData) { - m_serverCommunicator->postItems(jsonData); -} - -void GenericCore::onItemsFetched(const QByteArray jsonData) { - emit displayStatusMessage("New items fetched."); - // TODO ? check compability of JSON structure beforehand? - // NEXT check if item already exists and apply changes (UUID,...) ? ; - m_mainModel->appendItems(jsonData); -} - -void GenericCore::onItemsFetchFailure(const QString errorString) { - emit displayStatusMessage(QString("Error: %1").arg(errorString)); -} - -void GenericCore::onPostRequestSuccessful(const QByteArray responseData) { - const QString message = m_mainModel->updateItemsFromJson(responseData); - emit displayStatusMessage(message); -} - -void GenericCore::onPostRequestFailure(const QString errorString) { - emit displayStatusMessage(QString("Error: %1").arg(errorString)); -} - -void GenericCore::onDeleteRequestSuccessful(const QByteArray responseData) { - qWarning() << "TODO: Process success response!!!"; -} - -void GenericCore::onDeleteRequestFailure(const QString errorString) { - qWarning() << "TODO: Process error response!!!"; +void GenericCore::onBiddingsChanged(int round, QList biddings) { + qInfo() << "onBiddingsChanged: round:" << round << "- biddings:" << biddings.count(); } void GenericCore::setupModels() { @@ -246,27 +218,6 @@ QString GenericCore::getMaintenanceToolFilePath() const { void GenericCore::setupServerConfiguration() { m_serverCommunicator = make_unique(this); - /// request connections - connect(this, &GenericCore::fetchItemsFromServer, m_serverCommunicator.get(), - &ServerCommunicator::fetchItems); - connect(this, &GenericCore::postItemToServer, this, &GenericCore::onSendItemTriggered); - connect(this, &GenericCore::deleteItemFromServer, m_serverCommunicator.get(), - &ServerCommunicator::deleteItem); - - /// response connections - connect(m_serverCommunicator.get(), &ServerCommunicator::itemsFetched, this, - &GenericCore::onItemsFetched); - connect(m_serverCommunicator.get(), &ServerCommunicator::itemsFetchFailure, this, - &GenericCore::onItemsFetchFailure); - connect(m_serverCommunicator.get(), &ServerCommunicator::postRequestSuccessful, this, - &GenericCore::onPostRequestSuccessful); - connect(m_serverCommunicator.get(), &ServerCommunicator::postRequestFailure, this, - &GenericCore::onPostRequestFailure); - connect(m_serverCommunicator.get(), &ServerCommunicator::deleteRequestSuccessful, this, - &GenericCore::onDeleteRequestSuccessful); - connect(m_serverCommunicator.get(), &ServerCommunicator::deleteRequestFailure, this, - &GenericCore::onDeleteRequestFailure); - applyServerConfiguration(); } diff --git a/libs/BeetRoundCore/genericcore.h b/libs/BeetRoundCore/genericcore.h index 87cc867..afc069c 100644 --- a/libs/BeetRoundCore/genericcore.h +++ b/libs/BeetRoundCore/genericcore.h @@ -4,6 +4,7 @@ #include #include "model/metadata.h" +#include "structs.h" class QUndoStack; class QAbstractItemModel; @@ -40,13 +41,7 @@ class GenericCore : public QObject { bool isSyncServerSetup() const; public slots: - void onSendItemTriggered(const QByteArray& jsonData); - void onItemsFetched(const QByteArray jsonData); - void onItemsFetchFailure(const QString errorString); - void onPostRequestSuccessful(const QByteArray responseData); - void onPostRequestFailure(const QString errorString); - void onDeleteRequestSuccessful(const QByteArray responseData); - void onDeleteRequestFailure(const QString errorString); + void onBiddingsChanged(int round, QList biddings); signals: void displayStatusMessage(QString message); diff --git a/libs/BeetRoundCore/model/metadata.h b/libs/BeetRoundCore/model/metadata.h index 5b8c471..dbbe9c0 100644 --- a/libs/BeetRoundCore/model/metadata.h +++ b/libs/BeetRoundCore/model/metadata.h @@ -87,7 +87,9 @@ enum GetRequestTypes { GetCurrentBiddingRound, StartNewBiddingRound, RestartLastBiddingRound, - StopCurrentBiddingRound + StopCurrentBiddingRound, + GetBiddingsOfSpecificRound, + GetBiddingsOfHighestRound }; /// functions diff --git a/libs/BeetRoundCore/network/apiroutes.h b/libs/BeetRoundCore/network/apiroutes.h index 1f54111..7e024aa 100644 --- a/libs/BeetRoundCore/network/apiroutes.h +++ b/libs/BeetRoundCore/network/apiroutes.h @@ -15,4 +15,6 @@ static const QString ROUTE_START_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/start_ static const QString ROUTE_RESTART_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/restart"; static const QString ROUTE_STOP_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/stop"; +static const QString ROUTE_GET_BIDDINGS = apiPrefix + "biddings_of_round"; +static const QString ROUTE_GET_BIDDINGS_OF_HIGHEST_ROUND = apiPrefix + "biddings_of_highest_round"; #endif // APIROUTES_H diff --git a/libs/BeetRoundCore/network/servercommunicator.cpp b/libs/BeetRoundCore/network/servercommunicator.cpp index 4ff6237..45e4a35 100644 --- a/libs/BeetRoundCore/network/servercommunicator.cpp +++ b/libs/BeetRoundCore/network/servercommunicator.cpp @@ -6,6 +6,7 @@ #include #include "../genericcore.h" +#include "../structs.h" #include "apiroutes.h" using namespace Qt::StringLiterals; @@ -19,6 +20,7 @@ ServerCommunicator::ServerCommunicator(GenericCore* core) connect(m_core, &GenericCore::sendGetRequest, this, &ServerCommunicator::onSendGetRequestTriggered); + connect(this, &ServerCommunicator::biddingsChanged, m_core, &GenericCore::onBiddingsChanged); } bool ServerCommunicator::sslSupported() const { @@ -126,6 +128,10 @@ void ServerCommunicator::onSendGetRequestTriggered(const GetRequestTypes type) { case StopCurrentBiddingRound: path = ROUTE_STOP_BIDDINGROUND; break; + // case GetBiddingsOfSpecificRound: + case GetBiddingsOfHighestRound: + path = ROUTE_GET_BIDDINGS_OF_HIGHEST_ROUND; + break; default: qWarning() << "No route found for GetRequestType:" << type; break; @@ -166,6 +172,9 @@ void ServerCommunicator::onGetReplySuccessful(const GetRequestTypes type, const case StopCurrentBiddingRound: currentBiddingRoundChangedReply(doc); break; + case GetBiddingsOfHighestRound: + currentBiddingsReply(doc); + break; default: qWarning() << "Can't match request type:" << type; break; @@ -185,5 +194,22 @@ void ServerCommunicator::currentBiddingRoundChangedReply(const QJsonDocument jso const bool stopped = rootObject["stopped"].toBool(); const bool isActive = !stopped; + // NOTE ?use ServerCommunicator::currentBiddingRoundChanged signal instead of emiting a signal of + // the core directly? emit m_core->currentBiddingRoundChanged(roundNumber, isActive); } + +void ServerCommunicator::currentBiddingsReply(const QJsonDocument jsonDoc) { + qCritical() << "currentBiddingsReply:" << jsonDoc; + + // NEXT extract biddings from jsonDoc + const int roundNumber = 0; + const bidding dummyBidding{.userId = QUuid(), + .biddingRound = 0, + .amount = 123, + .depotWishOne = "one", + .depotWishTwo = "two"}; + const QList biddings{dummyBidding}; + + emit biddingsChanged(roundNumber, biddings); +} diff --git a/libs/BeetRoundCore/network/servercommunicator.h b/libs/BeetRoundCore/network/servercommunicator.h index 30b971e..0f6b3df 100644 --- a/libs/BeetRoundCore/network/servercommunicator.h +++ b/libs/BeetRoundCore/network/servercommunicator.h @@ -9,6 +9,7 @@ #include "../model/metadata.h" +class bidding; class GenericCore; class ServerCommunicator : public QObject { @@ -24,7 +25,7 @@ class ServerCommunicator : public QObject { void setServerConfiguration(const QString url, const QString email, const QString password); public slots: - void onSendGetRequestTriggered(const GetRequestTypes type); + void onSendGetRequestTriggered(const GetRequestTypes type, QVariant data); void onGetReplySuccessful(const GetRequestTypes type, const QJsonDocument doc); void onGetReplyFailure(const GetRequestTypes type, const QString errorString); @@ -42,6 +43,9 @@ class ServerCommunicator : public QObject { void deleteRequestSuccessful(const QByteArray responseData); void deleteRequestFailure(const QString errorString); + void currentBiddingRoundChanged(int round, bool isRunning); + void biddingsChanged(int round, QList biddings); + private: GenericCore* m_core = nullptr; @@ -55,6 +59,7 @@ class ServerCommunicator : public QObject { /// reply parser void currentBiddingRoundChangedReply(const QJsonDocument jsonDoc); + void currentBiddingsReply(const QJsonDocument jsonDoc); }; #endif // SERVERCOMMUNICATOR_H diff --git a/libs/BeetRoundCore/structs.h b/libs/BeetRoundCore/structs.h new file mode 100644 index 0000000..c32bb93 --- /dev/null +++ b/libs/BeetRoundCore/structs.h @@ -0,0 +1,14 @@ +#ifndef STRUCTS_H +#define STRUCTS_H + +#include + +struct bidding { + QUuid userId; + int biddingRound; + int amount; + QString depotWishOne; + QString depotWishTwo; +}; + +#endif // STRUCTS_H From bb5e8945572f43bf5d289dc1f88ad652b2e48c6d Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Sat, 14 Feb 2026 10:17:31 +0100 Subject: [PATCH 5/7] Adding optional QVariant data argument to sendGetRequest to pass it to the server. Using hard coded sendGetRequest(GetBiddingsOfSpecificRound, 2) in fetchCurrentBiddings action to test this. --- UIs/BeetRoundWidgets/mainwindow.cpp | 3 ++- UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h | 7 +------ libs/BeetRoundCore/genericcore.h | 3 ++- libs/BeetRoundCore/network/apiroutes.h | 4 ++-- libs/BeetRoundCore/network/servercommunicator.cpp | 8 ++++++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/UIs/BeetRoundWidgets/mainwindow.cpp b/UIs/BeetRoundWidgets/mainwindow.cpp index 1fb23d4..d93c0f1 100644 --- a/UIs/BeetRoundWidgets/mainwindow.cpp +++ b/UIs/BeetRoundWidgets/mainwindow.cpp @@ -300,7 +300,8 @@ void MainWindow::findItems() { void MainWindow::fetchCurrentBiddings() { showStatusMessage(tr("Invoked 'Server|Fetch current biddings'")); - emit m_core->sendGetRequest(GetBiddingsOfHighestRound); + // emit m_core->sendGetRequest(GetBiddingsOfHighestRound); + emit m_core->sendGetRequest(GetBiddingsOfSpecificRound, 2); } void MainWindow::execSettingsDialog() { diff --git a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h index ef03c47..ee64bf1 100644 --- a/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h +++ b/UIs/BeetRoundWidgets/widgets/biddingroundcontrol.h @@ -13,12 +13,7 @@ class BiddingRoundControl : public QWidget { explicit BiddingRoundControl(QWidget* parent = nullptr); signals: - void sendGetRequest(GetRequestTypes type); - - void triggerStartNewRound(); - void triggerRestartLastRound(); - void triggerStopCurrentRound(); - // void refreshCurrentRound(); + void sendGetRequest(GetRequestTypes type, QVariant data = QVariant()); public slots: /// button slots diff --git a/libs/BeetRoundCore/genericcore.h b/libs/BeetRoundCore/genericcore.h index afc069c..9df744b 100644 --- a/libs/BeetRoundCore/genericcore.h +++ b/libs/BeetRoundCore/genericcore.h @@ -2,6 +2,7 @@ #define GENERICCORE_H #include +#include #include "model/metadata.h" #include "structs.h" @@ -48,7 +49,7 @@ class GenericCore : public QObject { /// *** server communication *** /// request signals - void sendGetRequest(GetRequestTypes type); + void sendGetRequest(GetRequestTypes type, QVariant data = QVariant()); /// response signals void currentBiddingRoundChanged(int round, bool isRunning); diff --git a/libs/BeetRoundCore/network/apiroutes.h b/libs/BeetRoundCore/network/apiroutes.h index 7e024aa..5422772 100644 --- a/libs/BeetRoundCore/network/apiroutes.h +++ b/libs/BeetRoundCore/network/apiroutes.h @@ -15,6 +15,6 @@ static const QString ROUTE_START_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/start_ static const QString ROUTE_RESTART_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/restart"; static const QString ROUTE_STOP_BIDDINGROUND = ROUTE_BIDDINGROUNDS + "/stop"; -static const QString ROUTE_GET_BIDDINGS = apiPrefix + "biddings_of_round"; -static const QString ROUTE_GET_BIDDINGS_OF_HIGHEST_ROUND = apiPrefix + "biddings_of_highest_round"; +static const QString ROUTE_GET_BIDDINGS_OF_SPECIFIC_ROUND = apiPrefix + "biddings_of_round"; +static const QString ROUTE_GET_BIDDINGS_OF_HIGHEST_ROUND = apiPrefix + "biddings_of_highest_round"; #endif // APIROUTES_H diff --git a/libs/BeetRoundCore/network/servercommunicator.cpp b/libs/BeetRoundCore/network/servercommunicator.cpp index 45e4a35..0c42fb6 100644 --- a/libs/BeetRoundCore/network/servercommunicator.cpp +++ b/libs/BeetRoundCore/network/servercommunicator.cpp @@ -113,7 +113,8 @@ void ServerCommunicator::setServerConfiguration(const QString url, m_password = password; } -void ServerCommunicator::onSendGetRequestTriggered(const GetRequestTypes type) { +void ServerCommunicator::onSendGetRequestTriggered(const GetRequestTypes type, + QVariant data = QVariant()) { QString path; switch (type) { case GetCurrentBiddingRound: @@ -128,7 +129,9 @@ void ServerCommunicator::onSendGetRequestTriggered(const GetRequestTypes type) { case StopCurrentBiddingRound: path = ROUTE_STOP_BIDDINGROUND; break; - // case GetBiddingsOfSpecificRound: + case GetBiddingsOfSpecificRound: + path = ROUTE_GET_BIDDINGS_OF_SPECIFIC_ROUND + "/" + data.toString(); + break; case GetBiddingsOfHighestRound: path = ROUTE_GET_BIDDINGS_OF_HIGHEST_ROUND; break; @@ -172,6 +175,7 @@ void ServerCommunicator::onGetReplySuccessful(const GetRequestTypes type, const case StopCurrentBiddingRound: currentBiddingRoundChangedReply(doc); break; + case GetBiddingsOfSpecificRound: case GetBiddingsOfHighestRound: currentBiddingsReply(doc); break; From 29f913c532993f8c03d70e0364c2358823602476 Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Sat, 14 Feb 2026 10:18:37 +0100 Subject: [PATCH 6/7] Using the proper GetBiddingsOfHighestRound request on fetchCurrentBiddings again. --- UIs/BeetRoundWidgets/mainwindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UIs/BeetRoundWidgets/mainwindow.cpp b/UIs/BeetRoundWidgets/mainwindow.cpp index d93c0f1..1fb23d4 100644 --- a/UIs/BeetRoundWidgets/mainwindow.cpp +++ b/UIs/BeetRoundWidgets/mainwindow.cpp @@ -300,8 +300,7 @@ void MainWindow::findItems() { void MainWindow::fetchCurrentBiddings() { showStatusMessage(tr("Invoked 'Server|Fetch current biddings'")); - // emit m_core->sendGetRequest(GetBiddingsOfHighestRound); - emit m_core->sendGetRequest(GetBiddingsOfSpecificRound, 2); + emit m_core->sendGetRequest(GetBiddingsOfHighestRound); } void MainWindow::execSettingsDialog() { From 5afdbd6dd92cf891879234022c1784440169b72c Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Sat, 14 Feb 2026 10:19:53 +0100 Subject: [PATCH 7/7] Cosmetic source code refactoring. --- libs/BeetRoundCore/CMakeLists.txt | 14 +++++++------- libs/BeetRoundCore/genericcore.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/BeetRoundCore/CMakeLists.txt b/libs/BeetRoundCore/CMakeLists.txt index a028257..fcda6a6 100644 --- a/libs/BeetRoundCore/CMakeLists.txt +++ b/libs/BeetRoundCore/CMakeLists.txt @@ -23,20 +23,20 @@ add_library(${TARGET_APP} STATIC genericcore.h ${TS_FILES} constants.h + structs.h data/settingshandler.h data/settingshandler.cpp + data/filehandler.h data/filehandler.cpp + formats/jsonparser.h formats/jsonparser.cpp + formats/csvparser.h formats/csvparser.cpp + model/metadata.h model/tablemodel.h model/tablemodel.cpp model/modelitem.h model/modelitem.cpp - formats/jsonparser.h formats/jsonparser.cpp + model/generalsortfiltermodel.h model/generalsortfiltermodel.cpp model/commands/insertrowscommand.h model/commands/insertrowscommand.cpp model/commands/removerowscommand.h model/commands/removerowscommand.cpp model/commands/edititemcommand.h model/commands/edititemcommand.cpp - data/filehandler.h data/filehandler.cpp - model/metadata.h - formats/csvparser.h formats/csvparser.cpp - model/generalsortfiltermodel.h model/generalsortfiltermodel.cpp - network/servercommunicator.h network/servercommunicator.cpp network/apiroutes.h - structs.h + network/servercommunicator.h network/servercommunicator.cpp # 3rd party libraries ../3rdParty/rapidcsv/src/rapidcsv.h ) diff --git a/libs/BeetRoundCore/genericcore.cpp b/libs/BeetRoundCore/genericcore.cpp index bc57d80..3942fc0 100644 --- a/libs/BeetRoundCore/genericcore.cpp +++ b/libs/BeetRoundCore/genericcore.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "../../ApplicationConfig.h" #include "CoreConfig.h" @@ -19,8 +20,6 @@ #include "model/tablemodel.h" #include "network/servercommunicator.h" -#include - using namespace std; GenericCore::GenericCore() { @@ -157,6 +156,7 @@ bool GenericCore::isSyncServerSetup() const { void GenericCore::onBiddingsChanged(int round, QList biddings) { qInfo() << "onBiddingsChanged: round:" << round << "- biddings:" << biddings.count(); + // NEXT merge biddings into model } void GenericCore::setupModels() {