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.
43 lines
944 B
C++
43 lines
944 B
C++
9 years ago
|
#include "globalsettingsform.h"
|
||
|
#include "ui_globalsettingsform.h"
|
||
|
|
||
|
#include "globalsettings.h"
|
||
|
#include "../settingsservice.h"
|
||
|
|
||
|
GlobalSettingsForm::GlobalSettingsForm(QWidget *parent) :
|
||
|
FormBinder<GlobalSettings>(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);
|
||
|
}
|
||
|
|
||
|
GlobalSettingsForm::~GlobalSettingsForm()
|
||
|
{
|
||
|
delete ui;
|
||
|
}
|
||
|
|
||
|
bool GlobalSettingsForm::saveRecord()
|
||
|
{
|
||
|
bindToData();
|
||
|
SettingsService srv("CORE");
|
||
|
srv.saveSettings(entity());
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
void GlobalSettingsForm::loadEntity()
|
||
|
{
|
||
|
SettingsService srv("CORE");
|
||
|
QSharedPointer<GlobalSettings> settings = srv.loadSettings<GlobalSettings>();
|
||
|
setEntity(settings);
|
||
|
}
|