#include "shopsettingsform.h" #include "ui_shopsettingsform.h" #include #include #include #include "shopservice.h" ShopSettingsForm::ShopSettingsForm(QWidget *parent) : FormBinder(parent), ui(new Ui::ShopSettingsForm) { ui->setupUi(this); registerBinding(ui->output); registerBinding(ui->lettersPerLine); registerBinding(ui->byMessage); registerBinding(ui->eetActive); registerBinding(ui->eetShopId); registerBinding(ui->eetRegisterId); QList listModes; listModes << ComboData(0, tr("Simplifyed")) << ComboData(1, tr("Standard")); registerBinding(ui->eetMode, listModes); registerBinding(ui->eetCertificate); registerBinding(ui->eetKeyPassword); registerBinding(ui->eetTest); registerBinding(ui->eetPlayground); m_itemModel = new AutoTableModel(); } ShopSettingsForm::~ShopSettingsForm() { delete ui; } void ShopSettingsForm::loadEntity() { SettingsService srv("SHOP"); ShopSettingsPtr settings = srv.loadSettings(); setEntity(settings); ShopService srvShop; m_itemModel->setData(srvShop.allSellableItems()); ui->tableItems->setModel(m_itemModel); } bool ShopSettingsForm::saveRecord() { bindToData(); SettingsService srv("SHOP"); srv.saveSettings(entity()); return true; } void ShopSettingsForm::on_btnCertBrowse_clicked() { QString certFile = QFileDialog::getOpenFileName(this, "Certificate file", "", "P12 Files (*.p12)"); if (!certFile.isEmpty()) { ui->eetCertificate->setText(certFile); } }