gl->addWidget(lab=new QLabel(tr("ID:")),lctr,0);
lab->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
gl->addWidget(eventid=new QLabel,lctr,1);
+ eventid->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken);
eventid->setText(event.id().isNull()?"new":QString::number(event.id()));
gl->addWidget(lab=new QLabel(tr("Title:")),++lctr,0);
cancelreason->setText(event.cancelreason());
connect(cancelcheck,SIGNAL(toggled(bool)),cancelreason,SLOT(setEnabled(bool)));
+ gl->addWidget(lab=new QLabel(tr("Flags:")),++lctr,0);
+ lab->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
+ gl->addLayout(hl=new QHBoxLayout,lctr,1);
+ hl->addWidget(flags=new QLabel(event.flags()),1);
+ flags->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken);
+ hl->addWidget(p=new QPushButton("..."),0);
+ connect(p,SIGNAL(clicked(bool)),this,SLOT(setFlags()));
+
tab->addTab(w=new QWidget,tr("Description"));
w->setLayout(vl2=new QVBoxLayout);
vl2->addWidget(new QLabel(tr("The description will be displayed on the web site, please use HTML syntax.")),0);
event.setcomment(comment->toPlainText());
event.setcapacity(capacity->value());
event.setroom(room->text());
+ event.setflags(flags->text());
//artist is set in other methods already
//prices are changed by the methods reacting to the table
//send to server
}
}
+void MEventEditor::setFlags()
+{
+ flags->setText(MFlagEditor::edit(this, flags->text(), tr("Edit flags of event %1:").arg(event.title())));
+}
+
+
void MEventEditor::updatePrice()
{
pricemodel->clear();
pricemodel->insertColumns(0,5);
- pricemodel->setHorizontalHeaderLabels(QStringList()<<tr("Price Category")<<tr("Price")<<tr("Ticket Capacity")<<tr("Tickets")<<tr("Seats Blocked"));
+ pricemodel->setHorizontalHeaderLabels(QStringList()<<tr("Price Category")<<tr("Price")<<tr("Ordering")<<tr("Ticket Capacity")<<tr("Tickets")<<tr("Seats Blocked")<<tr("Flags"));
QList<MOEventPrice> prc=event.price();
pricemodel->insertRows(0,prc.size());
for(int i=0;i<prc.size();i++){
- pricemodel->setData(pricemodel->index(i,0),prc[i].pricecategory().value().name().value());
- pricemodel->setData(pricemodel->index(i,0),prc[i].pricecategoryid().value(),Qt::UserRole);
- pricemodel->setData(pricemodel->index(i,1),cent2str(prc[i].price().value()));
- pricemodel->setData(pricemodel->index(i,2),prc[i].maxavailable().value());
- pricemodel->setData(pricemodel->index(i,3),prc[i].amounttickets().value());
- pricemodel->setData(pricemodel->index(i,4),prc[i].amountticketsblock().value());
+ pricemodel->setData(pricemodel->index(i,0), prc[i].pricecategory().value().name().value());
+ pricemodel->setData(pricemodel->index(i,0), prc[i].pricecategoryid().value(), Qt::UserRole);
+ pricemodel->setData(pricemodel->index(i,1), cent2str(prc[i].price().value()));
+ pricemodel->setData(pricemodel->index(i,2), prc[i].prio().value());
+ pricemodel->setData(pricemodel->index(i,3), prc[i].maxavailable().value());
+ pricemodel->setData(pricemodel->index(i,4), prc[i].amounttickets().value());
+ pricemodel->setData(pricemodel->index(i,5), prc[i].amountticketsblock().value());
+ pricemodel->setData(pricemodel->index(i,6), prc[i].flags().value());
}
pricetable->resizeColumnsToContents();
}
setLayout(vl=new QVBoxLayout);
vl->addLayout(gl=new QFormLayout,10);
gl->addRow(tr("Price category:"),cname=new QLabel(prc.pricecategory().value().name()));
+ cname->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken);
gl->addRow(tr("Price:"),price=new MCentSpinBox(&d,prc.price()));
price->setMinimumWidth(200);
gl->addRow(tr("Maximum Seats:"),cap=new QSpinBox);
+ gl->addRow(tr("Ordering:"),ord=new QSpinBox);
gl->addRow(tr("Flags:"),hl=new QHBoxLayout);
hl->addWidget(flg=new QLabel(prc.flags()),1);
+ flg->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken);
hl->addWidget(p=new QPushButton("..."),0);
connect(p,SIGNAL(clicked(bool)),this,SLOT(setFlags()));
cap->setRange(prc.amountticketsblock(),maxseats);
cap->setValue(prc.maxavailable());
+ ord->setRange(0,0x7fffffff);
+ ord->setValue(prc.prio());
vl->addSpacing(10);
vl->addStretch(1);
vl->addLayout(hl=new QHBoxLayout,0);
prc[lid].setprice(d.price->value());
prc[lid].setmaxavailable(d.cap->value());
prc[lid].setflags(d.flg->text());
+ prc[lid].setprio(d.ord->value());
event.setprice(prc);
updatePrice();
}