author | harlekin <harlekin> | 2002-04-24 21:01:23 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-04-24 21:01:23 (UTC) |
commit | b15d6ac87e3579992234d4903a34f367d6fa58b4 (patch) (side-by-side diff) | |
tree | 3160d16b2db8f62089a2e1ce0382735914aa405e | |
parent | feaa245515b0746f6f70f590411c38e0a54c88ee (diff) | |
download | opie-b15d6ac87e3579992234d4903a34f367d6fa58b4.zip opie-b15d6ac87e3579992234d4903a34f367d6fa58b4.tar.gz opie-b15d6ac87e3579992234d4903a34f367d6fa58b4.tar.bz2 |
fix
-rw-r--r-- | core/pim/today/today.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 87a7970..0ab7a2a 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -29,32 +29,33 @@ #include <qpe/qpeapplication.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 <qtimer.h> #include <qpixmap.h> //#include <qfileinfo.h> #include <qlayout.h> #include <qtl.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; int AUTOSTART; int NEW_START=1; QString AUTOSTART_TIMER; /* @@ -114,46 +115,47 @@ void Today::setOwnerField() { } /* * Set the owner field with a given QString, for example per qcop. */ void Today::setOwnerField(QString &message) { if (!message.isEmpty()) { OwnerField->setText("<b>" + message + "</b>"); } } /* * Autostart, uses the new (opie only) autostart method in the launcher code. * If registered against that today ist started on each resume. */ void Today::autoStart() { - // Config cfg("today"); - //cfg.setGroup("Autostart"); - //AUTOSTART = cfg.readNumEntry("autostart",1); - - if (AUTOSTART) { - QCopEnvelope e("QPE/System", "autoStart(QString, QString, QString)"); - e << QString("add"); - e << QString("today"); - e << AUTOSTART_TIMER; - } else { - QCopEnvelope e("QPE/System", "autoStart(QString, QString)"); - e << QString("remove"); - e << QString("today"); - } + Config cfg("today"); + cfg.setGroup("Autostart"); + int AUTOSTART = cfg.readNumEntry("autostart",1); + qDebug(QString("%1").arg(AUTOSTART)); + if (AUTOSTART) { + QCopEnvelope e("QPE/System", "autoStart(QString, QString, QString)"); + e << QString("add"); + e << QString("today"); + e << AUTOSTART_TIMER; + } else { + qDebug("Nun in else bei autostart"); + QCopEnvelope e("QPE/System", "autoStart(QString, QString)"); + e << QString("remove"); + e << QString("today"); + } } /* * Repaint method. Reread all fields. */ void Today::draw() { init(); getDates(); getMail(); // if the todolist.xml file was not modified in between, do not parse it. if (checkIfModified()) { if (todo) delete todo; todo = new ToDoDB; getTodo(); } @@ -248,46 +250,48 @@ void Today::startConfig() { // if today should be autostarted conf->CheckBoxAuto->setChecked(AUTOSTART); // autostart only if device has been suspended for X minutes conf->SpinBoxTime->setValue( AUTOSTART_TIMER.toInt() ); conf->exec(); int maxlinestask = conf->SpinBox2->value(); int maxmeet = conf->SpinBox1->value(); int location = conf->CheckBox1->isChecked(); int notes = conf->CheckBox2->isChecked(); int maxcharclip = conf->SpinBox7->value(); int onlylater = conf->CheckBox3->isChecked(); int autostart = conf->CheckBoxAuto->isChecked(); int autostartdelay = conf->SpinBoxTime->value(); + cfg.writeEntry("maxlinestask",maxlinestask); cfg.writeEntry("maxcharclip", maxcharclip); cfg.writeEntry("maxlinesmeet",maxmeet); cfg.writeEntry("showlocation",location); cfg.writeEntry("shownotes", notes); cfg.writeEntry("onlylater", onlylater); cfg.setGroup("Autostart"); cfg.writeEntry("autostart", autostart); cfg.writeEntry("autostartdelay", autostartdelay); // sync it to "disk" cfg.write(); NEW_START=1; draw(); + AUTOSTART=autostart; autoStart(); } /* * Get all events that are in the datebook xml file for today */ void Today::getDates() { QDate date = QDate::currentDate(); if (AllDateBookEvents) delete AllDateBookEvents; AllDateBookEvents = new QWidget( ); QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); if (db) { delete db; @@ -440,33 +444,33 @@ void Today::editEvent(const Event &e) { /* * 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)"); - e << QString("qtmail"); + 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 = 0, int SHOW_LOCATION = 0, int SHOW_NOTES = 0, const char* name = 0, WFlags fl = 0) : ClickableLabel(parent,name,fl), event(ev) { |