Fetching current biddings from server menu. No extracting biddings from the response and merging into the model yet.

This commit is contained in:
2026-02-14 10:02:00 +01:00
parent cfd3031cf9
commit 6e51aee3a5
10 changed files with 67 additions and 103 deletions

View File

@ -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<QAction>(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<QAction>(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<QAction>(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<QAction>(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() {