summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp3
-rw-r--r--core/pim/datebook/datebookweeklst.cpp43
-rw-r--r--core/pim/datebook/datebookweeklst.h35
3 files changed, 72 insertions, 9 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 0a47bb8..a18a5b4 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -564,4 +564,7 @@ void DateBook::initWeekLst() {
connect( this, SIGNAL( newEvent() ), weekLstView, SLOT( redraw() ) );
connect( weekLstView, SIGNAL( editEvent(const Event&) ), this, SLOT( editEvent(const Event&) ) );
+ connect( weekLstView, SIGNAL( duplicateEvent( const Event & ) ), this, SLOT( duplicateEvent( const Event & ) ) );
+ connect( weekLstView, SIGNAL( beamEvent(const Event&) ), this, SLOT( beamEvent(const Event&) ) );
+ connect( weekLstView, SIGNAL( removeEvent( const Event & ) ), this, SLOT( removeEvent( const Event & ) ) );
}
}
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index fe2ab51..771aa00 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -8,4 +8,5 @@
#include <qpe/datebookmonth.h>
#include <qpe/config.h>
+#include <qpe/ir.h>
#include <qpe/resource.h>
@@ -193,5 +194,5 @@ DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
}
setText(QString(s) + " " + ev.description());
- connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
+// connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
}
@@ -199,5 +200,27 @@ void DateBookWeekLstEvent::editMe() {
emit editEvent(event.event());
}
-
+void DateBookWeekLstEvent::duplicateMe()
+{
+ emit duplicateEvent(event.event());
+}
+void DateBookWeekLstEvent::deleteMe()
+{
+ emit removeEvent(event.event());
+ emit redraw();
+}
+void DateBookWeekLstEvent::beamMe()
+{
+ emit beamEvent( event.event() );
+}
+void DateBookWeekLstEvent::mousePressEvent( QMouseEvent *e )
+{
+ popmenue = new QPopupMenu;
+ popmenue->insertItem( tr( "Edit" ), this, SLOT(editMe()));
+ popmenue->insertItem( tr( "Duplicate" ), this, SLOT(duplicateMe()));
+ popmenue->insertItem( tr( "Delete" ), this, SLOT(deleteMe()));
+ if(Ir::supported())
+ popmenue->insertItem( tr( "Beam" ), this, SLOT(beamMe()));
+ popmenue->popup( mapToGlobal( e->pos() ));
+}
DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
@@ -249,4 +272,8 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
layout->addWidget(l);
connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
+ connect (l, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
+ connect (l, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
+ connect (l, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
+ connect (l, SIGNAL(redraw()), this, SIGNAL(redraw()));
}
it++;
@@ -270,4 +297,8 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
layout->addWidget(w);
connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
+ connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
+ connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
+ connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
+ connect (w, SIGNAL(redraw()), this, SIGNAL(redraw()));
connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
@@ -278,4 +309,8 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
layout->addWidget(w);
connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
+ connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
+ connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
+ connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
+ connect (w, SIGNAL(redraw()), this, SIGNAL(redraw()));
connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
@@ -363,4 +398,8 @@ void DateBookWeekLst::getEvents() {
connect (view, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
+ connect (view, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
+ connect (view, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
+ connect (view, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
+ connect (view, SIGNAL(redraw()), this, SLOT(redraw()));
connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
connect (view, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
diff --git a/core/pim/datebook/datebookweeklst.h b/core/pim/datebook/datebookweeklst.h
index 32fa23f..3bc7f2f 100644
--- a/core/pim/datebook/datebookweeklst.h
+++ b/core/pim/datebook/datebookweeklst.h
@@ -3,7 +3,7 @@
#include <qwidget.h>
-#include <qdatetime.h>
+#include <qdatetime.h>
#include <qpe/event.h>
-#include <qlabel.h>
+#include <qlabel.h>
#include <qscrollview.h>
@@ -20,9 +20,9 @@ class DateBookWeekLstHeader: public DateBookWeekLstHeaderBase
Q_OBJECT
public:
- DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0,
+ DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0,
WFlags fl = 0 );
~DateBookWeekLstHeader();
void setDate(const QDate &d);
-
+
public slots:
void nextWeek();
@@ -46,9 +46,9 @@ class DateBookWeekLstDayHdr: public DateBookWeekLstDayHdrBase
public:
DateBookWeekLstDayHdr(const QDate &d, bool onM,
- QWidget* parent = 0, const char* name = 0,
+ QWidget* parent = 0, const char* name = 0,
WFlags fl = 0 );
public slots:
void showDay();
- void newEvent();
+ void newEvent();
signals:
void showDate(int y, int m, int d);
@@ -59,5 +59,5 @@ private:
};
-class DateBookWeekLstEvent: public Opie::Ui::OClickableLabel
+class DateBookWeekLstEvent: public Opie::Ui::OClickableLabel
{
Q_OBJECT
@@ -68,8 +68,18 @@ public:
signals:
void editEvent(const Event &e);
+ void duplicateEvent(const Event &e);
+ void removeEvent(const Event &e);
+ void beamEvent(const Event &e);
+ void redraw();
private slots:
void editMe();
+ void duplicateMe();
+ void deleteMe();
+ void beamMe();
private:
const EffectiveEvent event;
+ QPopupMenu* popmenue;
+protected:
+ void mousePressEvent( QMouseEvent *e );
};
@@ -84,4 +94,8 @@ public:
signals:
void editEvent(const Event &e);
+ void duplicateEvent(const Event &e);
+ void removeEvent(const Event &e);
+ void beamEvent(const Event &e);
+ void redraw();
void showDate(int y, int m, int d);
void addEvent(const QDateTime &start, const QDateTime &stop,
@@ -103,4 +117,8 @@ public:
signals:
void editEvent(const Event &e);
+ void duplicateEvent(const Event &e);
+ void removeEvent(const Event &e);
+ void beamEvent(const Event &e);
+ void redraw();
void showDate(int y, int m, int d);
void addEvent(const QDateTime &start, const QDateTime &stop,
@@ -136,4 +154,7 @@ signals:
const QString &str, const QString &location);
void editEvent(const Event &e);
+ void duplicateEvent(const Event &e);
+ void removeEvent(const Event &e);
+ void beamEvent(const Event &e);
private: