From 77d1dfe7f2700ba4a7f463299253cc7fc1c0b4d3 Mon Sep 17 00:00:00 2001 From: konrad Date: Thu, 27 Sep 2007 19:42:22 +0000 Subject: [PATCH] start on event editor git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@35 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/eventedit.cpp | 19 +++++++++++++++++++ src/eventedit.h | 25 +++++++++++++++++++++++++ src/overview.cpp | 14 ++++++++++++-- src/overview.h | 2 ++ src/smoke.pro | 6 ++++-- 5 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 src/eventedit.cpp create mode 100644 src/eventedit.h diff --git a/src/eventedit.cpp b/src/eventedit.cpp new file mode 100644 index 0000000..322ff2c --- /dev/null +++ b/src/eventedit.cpp @@ -0,0 +1,19 @@ +// +// C++ Implementation: eventedit +// +// Description: +// +// +// Author: Konrad Rosenbaum , (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 index 0000000..8001637 --- /dev/null +++ b/src/eventedit.h @@ -0,0 +1,25 @@ +// +// C++ Interface: eventedit +// +// Description: +// +// +// Author: Konrad Rosenbaum , (C) 2007 +// +// Copyright: See README/COPYING files that come with this distribution +// +// + +#ifndef SMOKE_EVENT_EDIT_H +#define SMOKE_EVENT_EDIT_H + +#include + +class MEventEditor:public QDialog +{ + public: + MEventEditor(QWidget*,qint32 id=-1); +}; + + +#endif diff --git a/src/overview.cpp b/src/overview.cpp index 30490f0..4ab2795 100644 --- a/src/overview.cpp +++ b/src/overview.cpp @@ -12,6 +12,7 @@ #include "overview.h" #include "webrequest.h" +#include "eventedit.h" #include #include @@ -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(); +} diff --git a/src/overview.h b/src/overview.h index 732d547..f3057e8 100644 --- a/src/overview.h +++ b/src/overview.h @@ -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; diff --git a/src/smoke.pro b/src/smoke.pro index a31eaf7..2d18154 100644 --- a/src/smoke.pro +++ b/src/smoke.pro @@ -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 -- 1.7.2.5