summaryrefslogtreecommitdiff
path: root/core
authorharlekin <harlekin>2002-03-11 15:05:28 (UTC)
committer harlekin <harlekin>2002-03-11 15:05:28 (UTC)
commit07177b1aa8b5c6979fe06874da903a9d17debb65 (patch) (unidiff)
tree3cd6fef4b53355e861ae1d3db923c9ee92436a47 /core
parentcb57d1df6804ab3739f96ba1881ffc8110e3caa9 (diff)
downloadopie-07177b1aa8b5c6979fe06874da903a9d17debb65.zip
opie-07177b1aa8b5c6979fe06874da903a9d17debb65.tar.gz
opie-07177b1aa8b5c6979fe06874da903a9d17debb65.tar.bz2
some new features like clickable appointments, but not connected to datebook yet
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/TODO11
-rw-r--r--core/pim/today/changelog4
-rw-r--r--core/pim/today/today.cpp159
-rw-r--r--core/pim/today/today.h25
-rw-r--r--core/pim/today/today.pro5
-rw-r--r--core/pim/today/todaybase.cpp16
-rw-r--r--core/pim/today/todaybase.h6
-rw-r--r--core/pim/today/todayconfig.h2
8 files changed, 147 insertions, 81 deletions
diff --git a/core/pim/today/TODO b/core/pim/today/TODO
index 5876e2b..a3b01d2 100644
--- a/core/pim/today/TODO
+++ b/core/pim/today/TODO
@@ -2,5 +2,5 @@ TODO for today:
2 2
3* start the app on "resume" 3* start the app on "resume" (partly done)
4 4
5* show alarm icons on alarm events 5* show alarm icons on alarm events (partly done)
6 6
@@ -8,6 +8,7 @@ TODO for today:
8 8
9 * fix 23 pm bug (done??)
10
11* qcop integration for updating events? 9* qcop integration for updating events?
12 10
13* sort todos by pri. \ No newline at end of file 11* sort todos by pri.
12
13* make Opiezilla a clickable label wich is allway on the far right side of
14the screen , klick will open credits ,) \ No newline at end of file
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index 7111154..333326d 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1 +1,5 @@
1
2* Appointments are now clickable (connection to datebook still missing)
3* autostart support (opie only)
4
10.2.7 50.2.7
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index d715fc1..69bcb68 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -41,2 +41,3 @@
41#include <qfileinfo.h> 41#include <qfileinfo.h>
42#include <qlayout.h>
42 43
@@ -47,2 +48,3 @@
47 48
49
48int MAX_LINES_TASK; 50int MAX_LINES_TASK;
@@ -55,2 +57,4 @@ int ONLY_LATER;
55int AUTOSTART; 57int AUTOSTART;
58
59int NEW_START=1;
56/* 60/*
@@ -71,3 +75,2 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
71 75
72
73void Today::autoStart() { 76void Today::autoStart() {
@@ -205,3 +208,6 @@ void Today::getDates() {
205 QDate date = QDate::currentDate(); 208 QDate date = QDate::currentDate();
206 QTime time = QTime::currentTime(); 209 QWidget* AllDateBookEvents = new QWidget( );
210 QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents);
211 //QTime time = QTime::currentTime();
212
207 QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); 213 QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date);
@@ -223,64 +229,21 @@ void Today::getDates() {
223 if ( count <= MAX_LINES_MEET ) { 229 if ( count <= MAX_LINES_MEET ) {
224 //cout << time.toString() << endl; 230
225 //cout << TimeString::dateString((*it).event().end()) << endl; 231
226 232 DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents);
227 // decide if to get all day or only later appointments 233 layoutDates->addWidget(l);
228 if (!ONLY_LATER) { 234 connect (l, SIGNAL(editEvent(const Event &)),
229 msg += "<B>" + (*it).description() + "</B>"; 235 this, SIGNAL(editEvent(const Event &)));
230 if ( (*it).event().hasAlarm() ) {
231 msg += " <b>[with alarm]</b>";
232 }
233 // include location or not
234 if (SHOW_LOCATION == 1) {
235 msg += "<BR><i>" + (*it).location();
236 msg += "</i>";
237 }
238
239 if ( (TimeString::timeString(QTime((*it).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((*it).event().end().time()) ) == "23:59") ) {
240 msg += "<br>All day";
241 } else {
242 // start time of event
243 msg += "<br>" + TimeString::timeString(QTime((*it).event().start().time()) )
244 // end time of event
245 + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) );
246 }
247 msg += "<BR>";
248 // include possible note or not
249 if (SHOW_NOTES == 1) {
250 msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
251 }
252 } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) {
253 msg += "<B>" + (*it).description() + "</B>";
254 if ( (*it).event().hasAlarm() ) {
255 msg += " <b>[with alarm]</b>";
256 }
257 // include location or not
258 if (SHOW_LOCATION == 1) {
259 msg+= "<BR><i>" + (*it).location();
260 msg += "</i>";
261 }
262
263 if ( (TimeString::timeString(QTime((*it).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((*it).event().end().time()) ) == "23:59") ) {
264 msg += "<br>All day";
265 } else {
266 // start time of event
267 msg += "<br>" + TimeString::timeString(QTime((*it).event().start().time()) )
268 // end time of event
269 + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) );
270 }
271 msg += "<BR>";
272 // include possible note or not
273 if (SHOW_NOTES == 1) {
274 msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
275 }
276 }
277 } 236 }
278 } 237
279 if (msg.isEmpty()) { 238 }
280 msg = tr("No more appointments today"); 239 layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
281 } 240 sv1->addChild(AllDateBookEvents);
282 DatesField->setText(msg); 241
242 //if (msg.isEmpty()) {
243 // msg = tr("No more appointments today");
244 //}
245 //DatesField->setText(msg);
283 } 246 }
284} 247}
285 248
286/* 249/*
@@ -373,5 +336,6 @@ void Today::getTodo() {
373 // if the todolist.xml file was not modified in between, do not parse it. 336 // if the todolist.xml file was not modified in between, do not parse it.
374 if (!checkIfModified()) { 337 if (!checkIfModified() && !NEW_START) {
375 return; 338 return;
376 } 339 }
340 NEW_START=0;
377 341
@@ -443 +407,72 @@ Today::~Today() {
443} 407}
408
409
410DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
411 QWidget* parent = 0,
412 const char* name = 0,
413 WFlags fl = 0) :
414 ClickableLabel(parent,name,fl), event(ev) {
415
416 QString msg;
417 QTime time = QTime::currentTime();
418
419 if (!ONLY_LATER) {
420 msg += "<B>" + (ev).description() + "</B>";
421 if ( (ev).event().hasAlarm() ) {
422 msg += " <b>[with alarm]</b>";
423 }
424 // include location or not
425 if (SHOW_LOCATION == 1) {
426 msg += "<BR><i>" + (ev).location();
427 msg += "</i>";
428 }
429
430 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
431 msg += "<br>All day";
432 } else {
433 // start time of event
434 msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) )
435 // end time of event
436 + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) );
437 }
438 msg += "<BR>";
439 // include possible note or not
440 if (SHOW_NOTES == 1) {
441 msg += " <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
442 }
443 } else if ((time.toString() <= TimeString::dateString((ev).event().end())) ) {
444 msg += "<B>" + (ev).description() + "</B>";
445 if ( (ev).event().hasAlarm() ) {
446 msg += " <b>[with alarm]</b>";
447 }
448 // include location or not
449 if (SHOW_LOCATION == 1) {
450 msg+= "<BR><i>" + (ev).location();
451 msg += "</i>";
452 }
453
454 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
455 msg += "<br>All day";
456 } else {
457 // start time of event
458 msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) )
459 // end time of event
460 + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) );
461 }
462 // include possible note or not
463 if (SHOW_NOTES == 1) {
464 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
465 }
466 }
467
468 setText(msg);
469 connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
470 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
471}
472
473void DateBookEvent::editMe() {
474 emit editEvent(event.event());
475}
476
477
478
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index b3b7d01..0a0837c 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -22,5 +22,5 @@
22#define TODAY_H 22#define TODAY_H
23#include "todaybase.h"
24 23
25#include <qpe/datebookdb.h> 24#include <qpe/datebookdb.h>
25#include <qpe/event.h>
26 26
@@ -28,7 +28,11 @@
28#include <qlist.h> 28#include <qlist.h>
29
29#include "TodoItem.h" 30#include "TodoItem.h"
30#include "todayconfig.h" 31#include "todayconfig.h"
32#include "todaybase.h"
33#include "clickablelabel.h"
34
35class QVBoxLayout;
31 36
32class Today : public TodayBase 37class Today : public TodayBase {
33{
34 Q_OBJECT 38 Q_OBJECT
@@ -63,2 +67,17 @@ class Today : public TodayBase
63}; 67};
68
69class DateBookEvent: public ClickableLabel {
70 Q_OBJECT
71public:
72 DateBookEvent(const EffectiveEvent &ev,
73 QWidget* parent = 0, const char* name = 0,
74 WFlags fl = 0);
75signals:
76 void editEvent(const Event &e);
77private slots:
78 void editMe();
79private:
80 const EffectiveEvent event;
81};
82
64#endif // TODAY_H 83#endif // TODAY_H
diff --git a/core/pim/today/today.pro b/core/pim/today/today.pro
index 7d56e71..454b3ff 100644
--- a/core/pim/today/today.pro
+++ b/core/pim/today/today.pro
@@ -3,4 +3,5 @@ TEMPLATE = app
3 CONFIG = qt warn_on release 3 CONFIG = qt warn_on release
4 HEADERS = today.h TodoItem.h minidom.h todaybase.h todayconfig.h 4 HEADERS = today.h TodoItem.h minidom.h todaybase.h todayconfig.h clickablelabel.h
5 SOURCES = main.cpp today.cpp todaybase.cpp todayconfig.cpp minidom.c TodoItem.cpp 5 SOURCES = main.cpp today.cpp todaybase.cpp todayconfig.cpp minidom.c TodoItem.cpp clickablelabel.cpp
6
6 INCLUDEPATH+= $(OPIEDIR)/include 7 INCLUDEPATH+= $(OPIEDIR)/include
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index 5c1dc24..552e2eb 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -53,2 +53,3 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
53 53
54
54 QWidget *d = QApplication::desktop(); 55 QWidget *d = QApplication::desktop();
@@ -97,3 +98,4 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
97 98
98 QScrollView* sv1 = new QScrollView( Frame4 ); 99 // QScrollView* sv1 = new QScrollView( Frame4 );
100 sv1 = new QScrollView( Frame4 );
99 sv1->setResizePolicy(QScrollView::AutoOneFit); 101 sv1->setResizePolicy(QScrollView::AutoOneFit);
@@ -111,9 +113,11 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
111 113
112 DatesField = new QLabel( sv1->viewport(), "DatesField" ); 114 //DatesField = new QLabel( sv1->viewport(), "DatesField" );
113 sv1->addChild(DatesField); 115 //DatesField = new QVBox(sv1->viewport());
114 DatesField->setText( tr( "No appointments today" ) ); 116 //QWidget *dummy = new QWidget(sv1->viewport());
115 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 117 //sv1->addChild(DatesField);
118 //DatesField->setText( tr( "No appointments today" ) );
119 // DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
116 120
117 121
118 // --- mail section --- 122 // --- mail section ---)
119 MailFrame = new QFrame( this ,"MailFrame" ); 123 MailFrame = new QFrame( this ,"MailFrame" );
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index 13fbb8d..8840125 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -16,3 +16,3 @@
16 16
17class QVBoxLayout; 17class QVBox;
18class QHBoxLayout; 18class QHBoxLayout;
@@ -34,3 +34,3 @@ public:
34 QPushButton* DatesButton; 34 QPushButton* DatesButton;
35 QLabel* DatesField; 35 //QLabel* DatesField;
36 QLabel* Frame; 36 QLabel* Frame;
@@ -38,2 +38,4 @@ public:
38 QLabel* TextLabel1; 38 QLabel* TextLabel1;
39 QScrollView* sv1;
40 QVBox* DatesField;
39 QFrame* Frame15; 41 QFrame* Frame15;
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index 020097d..4739b5a 100644
--- a/core/pim/today/todayconfig.h
+++ b/core/pim/today/todayconfig.h
@@ -13,3 +13,3 @@
13#include <qdialog.h> 13#include <qdialog.h>
14class QVBoxLayout; 14//class QVBoxLayout;
15class QHBoxLayout; 15class QHBoxLayout;