From: konrad Date: Tue, 30 Nov 2010 13:34:35 +0000 (+0000) Subject: edit flags for prices X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=5ea9c84955c3e5f1f8a49b833e617249cfdfbf3a;p=web%2Fkonrad%2Fsmoke.git edit flags for prices git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@645 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/src/dialogs/eventedit.cpp b/src/dialogs/eventedit.cpp index 8661775..22b6c50 100644 --- a/src/dialogs/eventedit.cpp +++ b/src/dialogs/eventedit.cpp @@ -36,6 +36,7 @@ #include "centbox.h" #include "pricecatdlg.h" #include "formula.h" +#include "flagedit.h" MEventEditor::MEventEditor(QWidget*pw,qint64 id) :QDialog(pw) @@ -221,11 +222,17 @@ MEEPriceEdit::MEEPriceEdit(QWidget*pw,MOEventPrice prc,int maxseats) 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); @@ -238,6 +245,12 @@ MEEPriceEdit::MEEPriceEdit(QWidget*pw,MOEventPrice prc,int maxseats) 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 @@ -258,6 +271,7 @@ void MEventEditor::changePrice() //use data prc[lid].setprice(d.price->value()); prc[lid].setmaxavailable(d.cap->value()); + prc[lid].setflags(d.flg->text()); event.setprice(prc); updatePrice(); } diff --git a/src/dialogs/eventedit.h b/src/dialogs/eventedit.h index bf460ea..2455134 100644 --- a/src/dialogs/eventedit.h +++ b/src/dialogs/eventedit.h @@ -84,7 +84,10 @@ class MEEPriceEdit:public QDialog friend class MEventEditor; MCentSpinBox*price; QSpinBox*cap; + QLabel*flg,*cname; MEEPriceEdit(QWidget*,MOEventPrice,int); + private slots: + void setFlags(); };