You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include "shopsettingsform.h"
|
|
|
|
#include "ui_shopsettingsform.h"
|
|
|
|
|
|
|
|
#include <settingsservice.h>
|
|
|
|
#include "shopservice.h"
|
|
|
|
|
|
|
|
ShopSettingsForm::ShopSettingsForm(QWidget *parent) :
|
|
|
|
FormBinder<ShopSettings>(parent),
|
|
|
|
ui(new Ui::ShopSettingsForm)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
registerBinding(ui->output);
|
|
|
|
registerBinding(ui->lettersPerLine);
|
|
|
|
registerBinding(ui->byMessage);
|
|
|
|
|
|
|
|
m_itemModel = new AutoTableModel<ShopItem>();
|
|
|
|
}
|
|
|
|
|
|
|
|
ShopSettingsForm::~ShopSettingsForm()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ShopSettingsForm::loadEntity()
|
|
|
|
{
|
|
|
|
SettingsService srv("SHOP");
|
|
|
|
ShopSettingsPtr settings = srv.loadSettings<ShopSettings>();
|
|
|
|
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;
|
|
|
|
}
|