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.

32 lines
563 B
C++

#include "dialog.h"
#include "ui_dialog.h"
#include <context.h>
#include <iplugin.h>
#include "data/person.h"
#include "accommodation-odb.hxx"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::on_buttonBox_accepted()
{
IPlugin *plugin = Context::instance().plugins().at(0);
QSharedPointer<Person> p(new Person());
p->setFirstName(ui->lineEdit->text());
p->setLastName(ui->lineEdit_2->text());
plugin->service<Person>()->save(p);
}