#include "globalsettingsform.h" #include "ui_globalsettingsform.h" #include "globalsettings.h" #include "../settingsservice.h" GlobalSettingsForm::GlobalSettingsForm(QWidget *parent) : FormBinder(parent), ui(new Ui::GlobalSettingsForm) { ui->setupUi(this); registerBinding(ui->firmName); registerBinding(ui->street); registerBinding(ui->houseNumber); registerBinding(ui->zipCode); registerBinding(ui->city); registerBinding(ui->ic); registerBinding(ui->vatPayer); registerBinding(ui->dic); registerBinding(ui->vatHigh); registerBinding(ui->vatFirstLower); registerBinding(ui->vatSecondLower); } GlobalSettingsForm::~GlobalSettingsForm() { delete ui; } bool GlobalSettingsForm::saveRecord() { bindToData(); SettingsService srv("CORE"); srv.saveSettings(entity()); return true; } void GlobalSettingsForm::loadEntity() { SettingsService srv("CORE"); QSharedPointer settings = srv.loadSettings(); setEntity(settings); ui->grpVat->setEnabled(settings->vatPayer()); } void GlobalSettingsForm::on_vatPayer_toggled(bool checked) { ui->grpVat->setEnabled(checked); }