Fetching current biddings from server menu. No extracting biddings from the response and merging into the model yet.
This commit is contained in:
@ -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() {
|
||||
|
||||
@ -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<QAction> m_deleteItemAct;
|
||||
unique_ptr<QAction> m_findItemAct;
|
||||
/// Server actions
|
||||
unique_ptr<QAction> m_fetchItemsAct;
|
||||
unique_ptr<QAction> m_postItemsAct;
|
||||
unique_ptr<QAction> m_deleteItemsAct;
|
||||
unique_ptr<QAction> m_fetchCurrentBiddingsAct;
|
||||
|
||||
/// View actions
|
||||
unique_ptr<QAction> m_showModelUndoViewAct;
|
||||
|
||||
Reference in New Issue
Block a user