author | harlekin <harlekin> | 2002-03-13 00:03:08 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-03-13 00:03:08 (UTC) |
commit | 8e9330a8626076a3dd289a1abbe218eccd3a1784 (patch) (side-by-side diff) | |
tree | 458506d9a708cf47c49268f8336b9ce7a7fafedd /core/pim/today/today.cpp | |
parent | ffa1d178f1daedafe801183c8a41a06023423713 (diff) | |
download | opie-8e9330a8626076a3dd289a1abbe218eccd3a1784.zip opie-8e9330a8626076a3dd289a1abbe218eccd3a1784.tar.gz opie-8e9330a8626076a3dd289a1abbe218eccd3a1784.tar.bz2 |
many bugfixes, should work right now again, also now the dates are allways in the right order, at least i hope so
-rw-r--r-- | core/pim/today/today.cpp | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 1cdc6b4..81d4d36 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -42,9 +42,8 @@ #include <qlayout.h> +#include <qtl.h> //#include <iostream.h> -//#include <unistd.h> +#include <unistd.h> #include <stdlib.h> - - int MAX_LINES_TASK; @@ -64,3 +63,3 @@ int NEW_START=1; Today::Today( QWidget* parent, const char* name, WFlags fl ) - : TodayBase( parent, name, fl ) { + : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) { QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); @@ -197,2 +196,3 @@ void Today::startConfig() { cfg.write(); + NEW_START=1; draw(); @@ -207,3 +207,5 @@ void Today::getDates() { QDate date = QDate::currentDate(); - QWidget* AllDateBookEvents = new QWidget( ); + + if (AllDateBookEvents) delete AllDateBookEvents; + AllDateBookEvents = new QWidget( ); QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); @@ -212,2 +214,5 @@ void Today::getDates() { + qBubbleSort(list); + // printf("Get dates\n"); + Config config( "qpe" ); @@ -223,3 +228,2 @@ void Today::getDates() { - count++; @@ -230,2 +234,3 @@ void Today::getDates() { if (!ONLY_LATER) { + count++; DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents); @@ -233,4 +238,6 @@ void Today::getDates() { connect (l, SIGNAL(editEvent(const Event &)), - this, SIGNAL(editEvent(const Event &))); + this, SLOT(editEvent(const Event &))); } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { + count++; + // show only later appointments @@ -239,9 +246,10 @@ void Today::getDates() { connect (l, SIGNAL(editEvent(const Event &)), - this, SIGNAL(editEvent(const Event &))); - } else { - QLabel* noMoreEvents = new QLabel(AllDateBookEvents); - noMoreEvents->setText("No more appointments today"); - layoutDates->addWidget(noMoreEvents); - } + this, SLOT(editEvent(const Event &))); + } } + } + if (ONLY_LATER && count==0) { + QLabel* noMoreEvents = new QLabel(AllDateBookEvents); + noMoreEvents->setText("No more appointments today"); + layoutDates->addWidget(noMoreEvents); } @@ -255,2 +263,3 @@ void Today::getDates() { sv1->addChild(AllDateBookEvents); + AllDateBookEvents->show(); @@ -395,2 +404,12 @@ void Today::startDatebook() { } +void Today::editEvent(const Event &e) { + startDatebook(); + + //Dissabled for now as uid's not working properly + /* + while(!QCopChannel::isRegistered("QPE/Datebook")) sleep(1); + QCopEnvelope env("QPE/Datebook", "editEvent(int)"); + env << e.uid(); + */ +} |