#include "centbox.h"
#include "pricecatdlg.h"
#include "formula.h"
+#include "flagedit.h"
MEventEditor::MEventEditor(QWidget*pw,qint64 id)
:QDialog(pw)
QPushButton*p;
QDialog d(this);
setWindowTitle(tr("Change Price"));
+ setSizeGripEnabled(true);
setLayout(vl=new QVBoxLayout);
vl->addLayout(gl=new QFormLayout,10);
- gl->addRow(tr("Price category:"),new QLabel(prc.pricecategory().value().name()));
+ gl->addRow(tr("Price category:"),cname=new QLabel(prc.pricecategory().value().name()));
gl->addRow(tr("Price:"),price=new MCentSpinBox(&d,prc.price()));
+ price->setMinimumWidth(200);
gl->addRow(tr("Maximum Seats:"),cap=new QSpinBox);
+ gl->addRow(tr("Flags:"),hl=new QHBoxLayout);
+ hl->addWidget(flg=new QLabel(prc.flags()),1);
+ hl->addWidget(p=new QPushButton("..."),0);
+ connect(p,SIGNAL(clicked(bool)),this,SLOT(setFlags()));
cap->setRange(prc.amountticketsblock(),maxseats);
cap->setValue(prc.maxavailable());
vl->addSpacing(10);
connect(p,SIGNAL(clicked()),this,SLOT(reject()));
}
+void MEEPriceEdit::setFlags()
+{
+ flg->setText(MFlagEditor::edit(this, flg->text(), tr("Edit flags of price %1:").arg(cname->text())));
+}
+
+
void MEventEditor::changePrice()
{
//get selection
//use data
prc[lid].setprice(d.price->value());
prc[lid].setmaxavailable(d.cap->value());
+ prc[lid].setflags(d.flg->text());
event.setprice(prc);
updatePrice();
}