edit flags for prices
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Tue, 30 Nov 2010 13:34:35 +0000 (13:34 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Tue, 30 Nov 2010 13:34:35 +0000 (13:34 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@645 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

src/dialogs/eventedit.cpp
src/dialogs/eventedit.h

index 8661775..22b6c50 100644 (file)
@@ -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();
 }
index bf460ea..2455134 100644 (file)
@@ -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();
 };