summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp18
-rw-r--r--core/pim/today/today.h1
2 files changed, 12 insertions, 7 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 9e9d31f..ad1ec90 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -376,122 +376,126 @@ void Today::getTodo() {
QString output;
QString tmpout;
int count = 0;
int ammount = 0;
// get overdue todos first
QValueList<ToDoEvent> overDueList = todo->overDue();
qBubbleSort(overDueList);
for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin();
it!=overDueList.end(); ++it ) {
if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) {
tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>";
ammount++;
}
}
// get total number of still open todos
QValueList<ToDoEvent> openTodo = todo->rawToDos();
qBubbleSort(openTodo);
for ( QValueList<ToDoEvent>::Iterator it=openTodo.begin();
it!=openTodo.end(); ++it ) {
if (!(*it).isCompleted()){
count +=1;
// not the overdues, we allready got them, and not if we are
// over the maxlines
if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) {
tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>";
ammount++;
}
}
}
if (count > 0) {
if( count == 1 ) {
output = tr("There is <b> 1</b> active task: <br>" );
} else {
output = tr("There are <b> %1</b> active tasks: <br>").arg(count);
}
output += tmpout;
} else {
output = tr("No active tasks");
}
TodoField->setText(tr(output));
}
+
+void Today::startAddressbook() {
+ QCopEnvelope e("QPE/System", "execute(QString)");
+ e << QString("addressbook");
+}
+
+extern QPEApplication *todayApp;
+
/*
* launch addressbook (personal card)
*/
void Today::editCard() {
- QCopEnvelope w("QPE/System", "execute(QString)");
- w << QString("addressbook");
- // while( !QCopChannel::isRegistered("QPE/Addressbook"))
+ startAddressbook();
+
+ while( !QCopChannel::isRegistered("QPE/Addressbook")) todayApp->processEvents();
QCopEnvelope v("QPE/Addressbook", "editPersonalAndClose()");
}
/*
* launches datebook
*/
void Today::startDatebook() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("datebook");
}
/*
* starts the edit dialog as known from datebook
*/
-
-
-extern QPEApplication *todayApp;
-
void Today::editEvent(const Event &e) {
startDatebook();
while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents();
QCopEnvelope env("QPE/Datebook", "editEvent(int)");
env << e.uid();
}
/*
* launches todolist
*/
void Today::startTodo() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("todolist");
}
/*
* launch opiemail
*/
void Today::startMail() {
QCopEnvelope e("QPE/System", "execute(QString)");
e << QString("opiemail");
//Right now start both, maybe decide which to rum via config file ..
QCopEnvelope f("QPE/System", "execute(QString)");
f << QString("qtmail");
}
Today::~Today() {
}
/*
* Gets the events for the current day, if it should get all dates
*/
DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
QWidget* parent,
int SHOW_LOCATION,
int SHOW_NOTES,
const char* name,
WFlags fl) :
OClickableLabel(parent,name,fl), event(ev) {
QString msg;
//QTime time = QTime::currentTime();
Config config( "qpe" );
config.setGroup( "Time" );
// if 24 h format
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 54f31cc..f28c029 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -1,96 +1,97 @@
/*
* today.h
*
* ---------------------
*
* begin : Sun 10 17:20:00 CEST 2002
* copyright : (c) 2002 by Maximilian Reiß
* email : max.reiss@gmx.de
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TODAY_H
#define TODAY_H
#include <qpe/datebookdb.h>
#include <qpe/event.h>
#include <opie/tododb.h>
#include <opie/oclickablelabel.h>
#include <qdatetime.h>
#include <qlist.h>
#include "todayconfig.h"
#include "todaybase.h"
class QVBoxLayout;
class Today : public TodayBase {
Q_OBJECT
public:
Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~Today();
private slots:
void startConfig();
void startTodo();
void startDatebook();
+ void startAddressbook();
void startMail();
void editCard();
void draw();
void editEvent(const Event &e);
private:
void init();
void getDates();
void getTodo();
void getMail();
void autoStart();
bool checkIfModified();
void setOwnerField();
void setOwnerField(QString &string);
private slots:
void channelReceived(const QCString &msg, const QByteArray & data);
private:
DateBookDB *db;
ToDoDB *todo;
todayconfig *conf;
QWidget* AllDateBookEvents;
//Config cfg;
int MAX_LINES_TASK;
int MAX_CHAR_CLIP;
int MAX_LINES_MEET;
int SHOW_LOCATION;
int SHOW_NOTES;
};
class DateBookEvent: public OClickableLabel {
Q_OBJECT
public:
DateBookEvent(const EffectiveEvent &ev,
QWidget* parent = 0,
int SHOW_LOCATION = 0,
int SHOW_NOTES = 0,
const char* name = 0,
WFlags fl = 0);
signals:
void editEvent(const Event &e);
private slots:
void editMe();
private:
QString ampmTime(QTime);
const EffectiveEvent event;
bool ampm;
};