Camp wizard is now able to open from shop plugin

This commit is contained in:
2017-05-31 16:16:22 +02:00
parent 397ec82d06
commit 13d90445cc
8 changed files with 177 additions and 6 deletions
+28
View File
@@ -0,0 +1,28 @@
#include "campseller.h"
#include "campwizard.h"
#include "campservice.h"
#include "data/camp-data.h"
#include "campshopitem.h"
CampSeller::CampSeller(QObject *parent)
:ISeller(parent)
{
}
void CampSeller::prepareItem()
{
CampWizard *wizard = new CampWizard();
wizard->setAttribute(Qt::WA_DeleteOnClose);
CampService srv;
CampDataPtr data = srv.create();
wizard->setData(data);
wizard->show();
connect(wizard, &QDialog::accepted, [this, data](){
CampShopItemPtr item(new CampShopItem);
item->setUnitPrice(data->totalPrice());
emit itemPrepared(item, 1);
});
}