-rw-r--r-- | core/pim/today/today.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 381ae6b..00a8842 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -1,61 +1,61 @@ /* * today.cpp : main class * * --------------------- * * 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. * * * ***************************************************************************/ #include "today.h" #include "minidom.h" #include "TodoItem.h" -#include <qpushbutton.h> -#include <qlabel.h> - #include <qpe/datebookdb.h> #include <qpe/timestring.h> #include <qpe/config.h> - +#include <qpe/qcopenvelope_qws.h> #include <qpe/qprocess.h> + #include <qdir.h> #include <qfile.h> #include <qdatetime.h> #include <qtextstream.h> #include <qcheckbox.h> #include <qspinbox.h> +#include <qpushbutton.h> +#include <qlabel.h> //#include <iostream.h> //#include <unistd.h> #include <stdlib.h> int MAX_LINES_TASK; int MAX_CHAR_CLIP; int MAX_LINES_MEET; int SHOW_LOCATION; int SHOW_NOTES; // show only later dates int ONLY_LATER = 1; /* * Constructs a Example which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ Today::Today( QWidget* parent, const char* name, WFlags fl ) : TodayBase( parent, name, fl ) { 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() ) ); QDate date = QDate::currentDate(); @@ -168,50 +168,50 @@ void Today::getDates() // include location or not if (SHOW_LOCATION == 1) { msg+= "<BR>" + (*it).location(); } msg += "<BR>" // start time of event + TimeString::timeString(QTime((*it).event().start().time()) ) // end time of event + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) ) + "<BR>"; // include possible note or not if (SHOW_NOTES == 1) { msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; } } } } DatesField->setText(msg); } } /* - * - * + * Parse in the todolist.xml + * */ QList<TodoItem> Today::loadTodo(const char *filename) { DOM *todo; ELE *tasks; ELE **tasklist; ATT **attlist; int i, j; char *description; int completed; int priority; TodoItem *tmp; QList<TodoItem> loadtodolist; todo = minidom_load(filename); tasks = todo->el; tasks = tasks->el[0]; /*!DOCTYPE-quickhack*/ if(tasks) { tasklist = tasks->el; i = 0; while((tasklist) && (tasklist[i])) { @@ -290,46 +290,45 @@ void Today::getTodo() { tmpout += "<b>- </b>" + QString(((item)->getDescription().mid(0, MAX_CHAR_CLIP) + ("<br>"))); } } } } if (count > 0) { output = QString("There are <b> %1</b> active tasks: <br>").arg(count); output += tmpout; } else { output = ("No active tasks"); } TodoField->setText(output); } /* * lanches datebook */ void Today::startDatebook() -{ - //ugly but working - system("/opt/QtPalmtop/bin/datebook"); +{ + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString("datebook"); } /* * lanches todolist */ void Today::startTodo() { - // QProcess *datelanch = new QProcess( this, "datebook"); - //datelanch->start(); - system("/opt/QtPalmtop/bin/todolist"); + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString("todolist"); } /* * Destroys the object and frees any allocated resources */ Today::~Today() { // no need to delete child widgets, Qt does it all for us } |