start on event editor
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Thu, 27 Sep 2007 19:42:22 +0000 (19:42 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Thu, 27 Sep 2007 19:42:22 +0000 (19:42 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@35 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

src/eventedit.cpp [new file with mode: 0644]
src/eventedit.h [new file with mode: 0644]
src/overview.cpp
src/overview.h
src/smoke.pro

diff --git a/src/eventedit.cpp b/src/eventedit.cpp
new file mode 100644 (file)
index 0000000..322ff2c
--- /dev/null
@@ -0,0 +1,19 @@
+//
+// C++ Implementation: eventedit
+//
+// Description: 
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2007
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include "eventedit.h"
+
+MEventEditor::MEventEditor(QWidget*w,qint32 id)
+       :QDialog(w)
+{
+       setWindowTitle("Event Editor");
+}
diff --git a/src/eventedit.h b/src/eventedit.h
new file mode 100644 (file)
index 0000000..8001637
--- /dev/null
@@ -0,0 +1,25 @@
+//
+// C++ Interface: eventedit
+//
+// Description: 
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2007
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef SMOKE_EVENT_EDIT_H
+#define SMOKE_EVENT_EDIT_H
+
+#include <QDialog>
+
+class MEventEditor:public QDialog
+{
+       public:
+               MEventEditor(QWidget*,qint32 id=-1);
+};
+
+
+#endif
index 30490f0..4ab2795 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "overview.h"
 #include "webrequest.h"
+#include "eventedit.h"
 
 #include <QSettings>
 #include <QMessageBox>
@@ -42,7 +43,7 @@ MOverview::MOverview(MWebRequest*mw,QString pk)
        
        m=mb->addMenu(tr("&Event"));
        m->addAction(tr("&Show details..."));
-       m->addAction(tr("&New Event..."));
+       m->addAction(tr("&New Event..."),this,SLOT(newEvent()))->setEnabled(req->hasRole("createevent"));
        m->addAction(tr("&Cancel Event..."));
        
        m=mb->addMenu(tr("&Customer"));
@@ -66,7 +67,10 @@ MOverview::MOverview(MWebRequest*mw,QString pk)
        hl->addWidget(new QTableView,10);
        hl->addSpacing(5);
        hl->addLayout(vl=new QVBoxLayout,0);
-       vl->addWidget(new QPushButton(tr("New Event...")),0);
+       QPushButton*p;
+       vl->addWidget(p=new QPushButton(tr("New Event...")),0);
+       connect(p,SIGNAL(clicked()),this,SLOT(newEvent()));
+       p->setEnabled(req->hasRole("createevent"));
        vl->addWidget(new QPushButton(tr("Details...")),0);
        vl->addSpacing(15);
        vl->addWidget(new QPushButton(tr("Order Ticket...")),0);
@@ -131,3 +135,9 @@ void MOverview::relogin()
                QMessageBox::warning(this,tr("Warning"),tr("I was unable to renew the login at the server, the error was: %1").arg(req->errorString()));
        setEnabled(true);
 }
+
+void MOverview::newEvent()
+{
+       MEventEditor ed(this);
+       ed.exec();
+}
index 732d547..f3057e8 100644 (file)
@@ -32,6 +32,8 @@ class MOverview:public QMainWindow
        private slots:
                /**try to log in again*/
                void relogin();
+               /**create a new event*/
+               void newEvent();
        private:
                //my session object
                MWebRequest*req;
index a31eaf7..2d18154 100644 (file)
@@ -21,13 +21,15 @@ SOURCES = \
        hmac.cpp \
        code39.cpp \
        webrequest.cpp \
-       overview.cpp
+       overview.cpp \
+       eventedit.cpp
 HEADERS = \
        keygen.h \
        mainwindow.h \
        hmac.h \
        webrequest.h \
-       overview.h
+       overview.h \
+       eventedit.h
 
 RESOURCES += files.qrc