summaryrefslogtreecommitdiff
authordrw <drw>2005-03-07 16:52:17 (UTC)
committer drw <drw>2005-03-07 16:52:17 (UTC)
commit5ab00b78b199b1a03d3f27faa8b1dcffd9a86ff7 (patch) (unidiff)
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() {
565 connect( weekLstView, SIGNAL( editEvent(const Event&) ), this, SLOT( editEvent(const Event&) ) ); 565 connect( weekLstView, SIGNAL( editEvent(const Event&) ), this, SLOT( editEvent(const Event&) ) );
566 connect( weekLstView, SIGNAL( duplicateEvent( const Event & ) ), this, SLOT( duplicateEvent( const Event & ) ) );
567 connect( weekLstView, SIGNAL( beamEvent(const Event&) ), this, SLOT( beamEvent(const Event&) ) );
568 connect( weekLstView, SIGNAL( removeEvent( const Event & ) ), this, SLOT( removeEvent( const Event & ) ) );
566 } 569 }
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 @@
9#include <qpe/config.h> 9#include <qpe/config.h>
10#include <qpe/ir.h>
10#include <qpe/resource.h> 11#include <qpe/resource.h>
@@ -194,3 +195,3 @@ DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
194 setText(QString(s) + " " + ev.description()); 195 setText(QString(s) + " " + ev.description());
195 connect(this, SIGNAL(clicked()), this, SLOT(editMe())); 196 //connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
196 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); 197 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
@@ -200,3 +201,25 @@ void DateBookWeekLstEvent::editMe() {
200} 201}
201 202void DateBookWeekLstEvent::duplicateMe()
203{
204 emit duplicateEvent(event.event());
205}
206void DateBookWeekLstEvent::deleteMe()
207{
208 emit removeEvent(event.event());
209 emit redraw();
210}
211void DateBookWeekLstEvent::beamMe()
212{
213 emit beamEvent( event.event() );
214}
215void DateBookWeekLstEvent::mousePressEvent( QMouseEvent *e )
216{
217 popmenue = new QPopupMenu;
218 popmenue->insertItem( tr( "Edit" ), this, SLOT(editMe()));
219 popmenue->insertItem( tr( "Duplicate" ), this, SLOT(duplicateMe()));
220 popmenue->insertItem( tr( "Delete" ), this, SLOT(deleteMe()));
221 if(Ir::supported())
222 popmenue->insertItem( tr( "Beam" ), this, SLOT(beamMe()));
223 popmenue->popup( mapToGlobal( e->pos() ));
224}
202 225
@@ -250,2 +273,6 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
250 connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 273 connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
274 connect (l, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
275 connect (l, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
276 connect (l, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
277 connect (l, SIGNAL(redraw()), this, SIGNAL(redraw()));
251 } 278 }
@@ -271,2 +298,6 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
271 connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 298 connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
299 connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
300 connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
301 connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
302 connect (w, SIGNAL(redraw()), this, SIGNAL(redraw()));
272 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 303 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
@@ -279,2 +310,6 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
279 connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 310 connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
311 connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
312 connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
313 connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
314 connect (w, SIGNAL(redraw()), this, SIGNAL(redraw()));
280 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 315 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
@@ -364,2 +399,6 @@ void DateBookWeekLst::getEvents() {
364 connect (view, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 399 connect (view, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
400 connect (view, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
401 connect (view, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
402 connect (view, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
403 connect (view, SIGNAL(redraw()), this, SLOT(redraw()));
365 connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 404 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 @@
4#include <qwidget.h> 4#include <qwidget.h>
5#include <qdatetime.h> 5#include <qdatetime.h>
6#include <qpe/event.h> 6#include <qpe/event.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qscrollview.h> 8#include <qscrollview.h>
@@ -21,3 +21,3 @@ class DateBookWeekLstHeader: public DateBookWeekLstHeaderBase
21public: 21public:
22 DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0, 22 DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0,
23 WFlags fl = 0 ); 23 WFlags fl = 0 );
@@ -25,3 +25,3 @@ public:
25 void setDate(const QDate &d); 25 void setDate(const QDate &d);
26 26
27public slots: 27public slots:
@@ -47,3 +47,3 @@ public:
47 DateBookWeekLstDayHdr(const QDate &d, bool onM, 47 DateBookWeekLstDayHdr(const QDate &d, bool onM,
48 QWidget* parent = 0, const char* name = 0, 48 QWidget* parent = 0, const char* name = 0,
49 WFlags fl = 0 ); 49 WFlags fl = 0 );
@@ -51,3 +51,3 @@ public slots:
51 void showDay(); 51 void showDay();
52 void newEvent(); 52 void newEvent();
53signals: 53signals:
@@ -60,3 +60,3 @@ private:
60 60
61class DateBookWeekLstEvent: public Opie::Ui::OClickableLabel 61class DateBookWeekLstEvent: public Opie::Ui::OClickableLabel
62{ 62{
@@ -69,6 +69,16 @@ signals:
69 void editEvent(const Event &e); 69 void editEvent(const Event &e);
70 void duplicateEvent(const Event &e);
71 void removeEvent(const Event &e);
72 void beamEvent(const Event &e);
73 void redraw();
70private slots: 74private slots:
71 void editMe(); 75 void editMe();
76 void duplicateMe();
77 void deleteMe();
78 void beamMe();
72private: 79private:
73 const EffectiveEvent event; 80 const EffectiveEvent event;
81 QPopupMenu* popmenue;
82protected:
83 void mousePressEvent( QMouseEvent *e );
74}; 84};
@@ -85,2 +95,6 @@ signals:
85 void editEvent(const Event &e); 95 void editEvent(const Event &e);
96 void duplicateEvent(const Event &e);
97 void removeEvent(const Event &e);
98 void beamEvent(const Event &e);
99 void redraw();
86 void showDate(int y, int m, int d); 100 void showDate(int y, int m, int d);
@@ -104,2 +118,6 @@ signals:
104 void editEvent(const Event &e); 118 void editEvent(const Event &e);
119 void duplicateEvent(const Event &e);
120 void removeEvent(const Event &e);
121 void beamEvent(const Event &e);
122 void redraw();
105 void showDate(int y, int m, int d); 123 void showDate(int y, int m, int d);
@@ -137,2 +155,5 @@ signals:
137 void editEvent(const Event &e); 155 void editEvent(const Event &e);
156 void duplicateEvent(const Event &e);
157 void removeEvent(const Event &e);
158 void beamEvent(const Event &e);
138 159