summaryrefslogtreecommitdiff
path: root/core/pim/today
Side-by-side diff
Diffstat (limited to 'core/pim/today') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/changelog6
-rw-r--r--core/pim/today/opie-today.control2
-rw-r--r--core/pim/today/today.cpp45
-rw-r--r--core/pim/today/today.h2
4 files changed, 41 insertions, 14 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index ded4458..d0dd966 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,3 +1,9 @@
+0.2.9
+
+* Many bugfixes.
+* Today now apparently sorts the dates _allways_ right, i would assume it
+to be a qt bug
+
0.2.8
* Appointments are now clickable (connection to datebook still missing)
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control
index 5ad8f01..f875624 100644
--- a/core/pim/today/opie-today.control
+++ b/core/pim/today/opie-today.control
@@ -3,7 +3,7 @@ Priority: optional
Section: opie/applications
Maintainer: Maximilian Reiß <max.reiss@gmx.de>
Architecture: arm
-Version: 0.2.8-$SUB_VERSION
+Version: 0.2.9-$SUB_VERSION
Depends: opie-base ($QPE_VERSION)
License: GPL
Description: today screen
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
@@ -40,13 +40,12 @@
#include <qpixmap.h>
#include <qfileinfo.h>
#include <qlayout.h>
+#include <qtl.h>
//#include <iostream.h>
-//#include <unistd.h>
+#include <unistd.h>
#include <stdlib.h>
-
-
int MAX_LINES_TASK;
int MAX_CHAR_CLIP;
int MAX_LINES_MEET;
@@ -62,7 +61,7 @@ int NEW_START=1;
* name 'name' and widget flags set to 'f'
*/
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() ) );
QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) );
QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) );
@@ -195,6 +194,7 @@ void Today::startConfig() {
cfg.writeEntry("autostart", autostart);
// sync it to "disk"
cfg.write();
+ NEW_START=1;
draw();
autoStart();
}
@@ -205,11 +205,16 @@ void Today::startConfig() {
*/
void Today::getDates() {
QDate date = QDate::currentDate();
- QWidget* AllDateBookEvents = new QWidget( );
+
+ if (AllDateBookEvents) delete AllDateBookEvents;
+ AllDateBookEvents = new QWidget( );
QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents);
QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date);
+ qBubbleSort(list);
+ // printf("Get dates\n");
+
Config config( "qpe" );
// if 24 h format
//bool ampm = config.readBoolEntry( "AMPM", TRUE );
@@ -221,29 +226,32 @@ void Today::getDates() {
for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin();
it!=list.end(); ++it ) {
- count++;
if ( count <= MAX_LINES_MEET ) {
QTime time = QTime::currentTime();
if (!ONLY_LATER) {
+ count++;
DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents);
layoutDates->addWidget(l);
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
DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents);
layoutDates->addWidget(l);
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);
}
} else {
QLabel* noEvents = new QLabel(AllDateBookEvents);
@@ -253,6 +261,7 @@ void Today::getDates() {
layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
sv1->addChild(AllDateBookEvents);
+ AllDateBookEvents->show();
}
@@ -393,6 +402,16 @@ void Today::startDatebook() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("datebook");
}
+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();
+ */
+}
/*
* launches todolist
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index b3f0654..0b4356c 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -47,6 +47,7 @@ class Today : public TodayBase {
void startDatebook();
void startMail();
void draw();
+ void editEvent(const Event &e);
private:
void init();
void getDates();
@@ -58,6 +59,7 @@ class Today : public TodayBase {
private:
DateBookDB *db;
todayconfig *conf;
+ QWidget* AllDateBookEvents;
//Config cfg;
int MAX_LINES_TASK;
int MAX_CHAR_CLIP;