Commodity - added setting for translate czech chars to numbers (bar code scanner fix).

This commit is contained in:
2018-05-23 11:59:26 +02:00
parent fe3602fcfc
commit 0ddf8bce92
10 changed files with 168 additions and 30 deletions
+14 -1
View File
@@ -1,16 +1,21 @@
#include "commoditysettingsform.h"
#include "ui_commoditysettingsform.h"
#include <service.h>
#include <settingsservice.h>
#include "commodity-odb.hxx"
CommoditySettingsForm::CommoditySettingsForm(QWidget *parent) :
IForm(parent),
FormBinder<CommoditySettings>(parent),
ui(new Ui::CommoditySettingsForm)
{
ui->setupUi(this);
registerBinding(ui->codeAsNumber);
m_table = new AutoTableModel<CommodityTypeData>();
m_table->setEditableCols(QList<int>() << 0);
ui->commodityTypesTable->setModel(m_table);
ui->commodityTypesTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
}
CommoditySettingsForm::~CommoditySettingsForm()
@@ -20,12 +25,20 @@ CommoditySettingsForm::~CommoditySettingsForm()
void CommoditySettingsForm::loadEntity()
{
SettingsService srv("COMMODITY");
CommoditySettingsPtr settings = srv.loadSettings<CommoditySettings>();
setEntity(settings);
Service<CommodityTypeData> commodityService;
m_table->setData(commodityService.all());
}
bool CommoditySettingsForm::saveRecord()
{
bindToData();
SettingsService srv("COMMODITY");
srv.saveSettings(entity());
Service<CommodityTypeData> commodityService;
foreach (QSharedPointer<CommodityTypeData> item, m_table->list())
{