|
|
|
@ -25,6 +25,7 @@ ShopForm::ShopForm(QWidget *parent) :
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
m_itemsModel = NULL;
|
|
|
|
|
m_commodityModel = NULL;
|
|
|
|
|
m_itemFound = false;
|
|
|
|
|
|
|
|
|
|
ui->temporarySaveButton->setEnabled(false);
|
|
|
|
|
ui->saveButton->setEnabled(false);
|
|
|
|
@ -38,8 +39,6 @@ ShopForm::~ShopForm()
|
|
|
|
|
|
|
|
|
|
void ShopForm::loadLast()
|
|
|
|
|
{
|
|
|
|
|
loadButtons();
|
|
|
|
|
|
|
|
|
|
if (m_itemsModel == NULL)
|
|
|
|
|
{
|
|
|
|
|
m_itemsModel = new AutoTableModel<VoucherItem>(this);
|
|
|
|
@ -82,7 +81,7 @@ void ShopForm::loadLast()
|
|
|
|
|
|
|
|
|
|
m_commodityModel->setData(srv.allSellableItems());
|
|
|
|
|
ui->commodityTable->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
|
|
|
|
|
ui->commodityTable->setColumnHidden(3, true);
|
|
|
|
|
ui->commodityTable->setColumnHidden(4, true);
|
|
|
|
|
ui->commodityTable->setColumnHidden(2, true);
|
|
|
|
|
|
|
|
|
|
if (srv.isEetEnabled())
|
|
|
|
@ -141,6 +140,8 @@ void ShopForm::loadButtons()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ui->commoditySearch->setFocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShopForm::fillRaceiptCombo()
|
|
|
|
@ -365,6 +366,8 @@ void ShopForm::addItem(QSharedPointer<IShopItem> item, int count)
|
|
|
|
|
onCountChanged();
|
|
|
|
|
|
|
|
|
|
ui->actualReceipt->scrollToBottom();
|
|
|
|
|
ui->commoditySearch->setFocus();
|
|
|
|
|
ui->commoditySearch->setText("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShopForm::on_receiptCombo_currentIndexChanged(int)
|
|
|
|
@ -464,6 +467,7 @@ void ShopForm::on_commoditySearch_textChanged(const QString &text)
|
|
|
|
|
QModelIndex matchingIndex = proxy.mapToSource(proxy.index(0,0));
|
|
|
|
|
if(matchingIndex.isValid()) {
|
|
|
|
|
moveToIndex(matchingIndex);
|
|
|
|
|
m_itemFound = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -473,6 +477,11 @@ void ShopForm::on_commoditySearch_textChanged(const QString &text)
|
|
|
|
|
if (matchingIndex.isValid())
|
|
|
|
|
{
|
|
|
|
|
moveToIndex(matchingIndex);
|
|
|
|
|
m_itemFound = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_itemFound = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -484,3 +493,12 @@ void ShopForm::on_lblEetState_linkActivated(const QString &)
|
|
|
|
|
|
|
|
|
|
ui->lblEetState->setText(srv.isEetOnline() ? tr("<a href=\"#eet\">Online</a>") : tr("<a href=\"#eet\">Offline</a>"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShopForm::on_commoditySearch_returnPressed()
|
|
|
|
|
{
|
|
|
|
|
if (m_itemFound)
|
|
|
|
|
{
|
|
|
|
|
ShopItemPtr item = m_commodityModel->itemFromIndex(ui->commodityTable->currentIndex());
|
|
|
|
|
addItem(item, ui->spnCount->value());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|