summaryrefslogtreecommitdiff
authordrw <drw>2005-03-07 16:52:17 (UTC)
committer drw <drw>2005-03-07 16:52:17 (UTC)
commit5ab00b78b199b1a03d3f27faa8b1dcffd9a86ff7 (patch) (side-by-side diff)
treebebec7df2d48f82b79a1ff3a98e05791dc444556
parent61b9d5f646faa5bd84391318f6440bee6cbefcd8 (diff)
downloadopie-5ab00b78b199b1a03d3f27faa8b1dcffd9a86ff7.zip
opie-5ab00b78b199b1a03d3f27faa8b1dcffd9a86ff7.tar.gz
opie-5ab00b78b199b1a03d3f27faa8b1dcffd9a86ff7.tar.bz2
Use popup menu for edit, duplicate, delete and beam in week list view - patch courtesy of Thomas Schnetzer
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
@@ -565,2 +565,5 @@ void DateBook::initWeekLst() {
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
@@ -9,2 +9,3 @@
#include <qpe/config.h>
+#include <qpe/ir.h>
#include <qpe/resource.h>
@@ -194,3 +195,3 @@ 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 ) );
@@ -200,3 +201,25 @@ void DateBookWeekLstEvent::editMe() {
}
-
+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() ));
+}
@@ -250,2 +273,6 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
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()));
}
@@ -271,2 +298,6 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
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)));
@@ -279,2 +310,6 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
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)));
@@ -364,2 +399,6 @@ 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)));
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
@@ -4,5 +4,5 @@
#include <qwidget.h>
-#include <qdatetime.h>
+#include <qdatetime.h>
#include <qpe/event.h>
-#include <qlabel.h>
+#include <qlabel.h>
#include <qscrollview.h>
@@ -21,3 +21,3 @@ class DateBookWeekLstHeader: public DateBookWeekLstHeaderBase
public:
- DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0,
+ DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0,
WFlags fl = 0 );
@@ -25,3 +25,3 @@ public:
void setDate(const QDate &d);
-
+
public slots:
@@ -47,3 +47,3 @@ public:
DateBookWeekLstDayHdr(const QDate &d, bool onM,
- QWidget* parent = 0, const char* name = 0,
+ QWidget* parent = 0, const char* name = 0,
WFlags fl = 0 );
@@ -51,3 +51,3 @@ public slots:
void showDay();
- void newEvent();
+ void newEvent();
signals:
@@ -60,3 +60,3 @@ private:
-class DateBookWeekLstEvent: public Opie::Ui::OClickableLabel
+class DateBookWeekLstEvent: public Opie::Ui::OClickableLabel
{
@@ -69,6 +69,16 @@ 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 );
};
@@ -85,2 +95,6 @@ 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);
@@ -104,2 +118,6 @@ 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);
@@ -137,2 +155,5 @@ signals:
void editEvent(const Event &e);
+ void duplicateEvent(const Event &e);
+ void removeEvent(const Event &e);
+ void beamEvent(const Event &e);