author | zautrix <zautrix> | 2005-06-03 23:10:45 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-03 23:10:45 (UTC) |
commit | 858b047efb5627824438cb3877e7bec0cebb3751 (patch) (unidiff) | |
tree | 7b36963344d4f5019f3a1ecb5eb9290f27c3b3c7 | |
parent | 0207d193bdb6c66201562a17e68872e018ec223c (diff) | |
download | kdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.zip kdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.tar.gz kdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.tar.bz2 |
fixxx
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 167 | ||||
-rw-r--r-- | korganizer/calendarview.h | 20 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 4 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 6 | ||||
-rw-r--r-- | libkcal/event.cpp | 6 | ||||
-rw-r--r-- | libkcal/event.h | 2 | ||||
-rw-r--r-- | libkcal/incidence.h | 2 | ||||
-rw-r--r-- | libkcal/journal.cpp | 2 | ||||
-rw-r--r-- | libkcal/journal.h | 2 | ||||
-rw-r--r-- | libkcal/todo.cpp | 4 | ||||
-rw-r--r-- | libkcal/todo.h | 2 |
13 files changed, 206 insertions, 17 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 41868d9..cc8102c 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1341,41 +1341,41 @@ | |||
1341 | { "Todo is stopped","Todo ist gestoppt" }, | 1341 | { "Todo is stopped","Todo ist gestoppt" }, |
1342 | { "Start todo","Starte Todo" }, | 1342 | { "Start todo","Starte Todo" }, |
1343 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, | 1343 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, |
1344 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, | 1344 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, |
1345 | { "Todo has subtodos","Todo hat Untertodos" }, | 1345 | { "Todo has subtodos","Todo hat Untertodos" }, |
1346 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, | 1346 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, |
1347 | { "Colors","Farben" }, | 1347 | { "Colors","Farben" }, |
1348 | { "Click on new parent item","Klicke auf neues Übertodo" }, | 1348 | { "Click on new parent item","Klicke auf neues Übertodo" }, |
1349 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, | 1349 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, |
1350 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, | 1350 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, |
1351 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, | 1351 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, |
1352 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, | 1352 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, |
1353 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 1353 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
1354 | { "times","Zeiten" }, | 1354 | { "times","Zeiten" }, |
1355 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, | 1355 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, |
1356 | { "Backup enabled","Backup angeschaltet" }, | 1356 | { "Backup enabled","Backup angeschaltet" }, |
1357 | { "Use standard backup dir","Standard Backupverzeichnis" }, | 1357 | { "Use standard backup dir","Standard Backupverzeichnis" }, |
1358 | { "Number of Backups:","Anzahl der Backups" }, | 1358 | { "Number of Backups:","Anzahl der Backups" }, |
1359 | { "Make backup every ","Mache ein Backup alle " }, | 1359 | { "Make backup every ","Mache ein Backup alle " }, |
1360 | { " days"," Tage" }, | 1360 | { " days"," Tage" }, |
1361 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, | 1361 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, |
1362 | { "Backup Failed!","Backup Problem!" }, | 1362 | { "Backup Failed!","Backup Problem!" }, |
1363 | { "Try again now","Versuche jetzt nochmal" }, | 1363 | { "Try again now","Versuche jetzt nochmal" }, |
1364 | { "Try again later","Versuche später nochmal" }, | 1364 | { "Try again later","Versuche später nochmal" }, |
1365 | { "Try again tomorrow","Versuche morgen nochmal" }, | 1365 | { "Try again tomorrow","Versuche morgen nochmal" }, |
1366 | { "Disable backup","Schalte Backup ab" }, | 1366 | { "Disable backup","Schalte Backup ab" }, |
1367 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 1367 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
1368 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 1368 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
1369 | { "Choose action","Wähle Aktion" }, | 1369 | { "Choose action","Wähle Aktion" }, |
1370 | { "Comment for todo:","Kommentar zum Todo:" }, | 1370 | { "Comment for todo:","Kommentar zum Todo:" }, |
1371 | { "Stop+note","Stop+Notiz" }, | 1371 | { "Stop+note","Stop+Notiz" }, |
1372 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, | 1372 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, |
1373 | { "","" }, | 1373 | { "KO/Pi: Missing alarm notification!","KO/Pi: Benachrichtigung über verpasste Alarme!" }, |
1374 | { "","" }, | 1374 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, |
1375 | { "","" }, | 1375 | { "","" }, |
1376 | { "","" }, | 1376 | { "","" }, |
1377 | { "","" }, | 1377 | { "","" }, |
1378 | { "","" }, | 1378 | { "","" }, |
1379 | { "","" }, | 1379 | { "","" }, |
1380 | { "","" }, | 1380 | { "","" }, |
1381 | { "","" }, \ No newline at end of file | 1381 | { "","" }, \ No newline at end of file |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 503ef12..36db9c4 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -109,64 +109,182 @@ | |||
109 | #include "incomingdialog.h" | 109 | #include "incomingdialog.h" |
110 | #include "datenavigatorcontainer.h" | 110 | #include "datenavigatorcontainer.h" |
111 | #include "statusdialog.h" | 111 | #include "statusdialog.h" |
112 | #include "kdatenavigator.h" | 112 | #include "kdatenavigator.h" |
113 | #include "kotodoview.h" | 113 | #include "kotodoview.h" |
114 | #include "datenavigator.h" | 114 | #include "datenavigator.h" |
115 | #include "resourceview.h" | 115 | #include "resourceview.h" |
116 | #include "navigatorbar.h" | 116 | #include "navigatorbar.h" |
117 | #include "searchdialog.h" | 117 | #include "searchdialog.h" |
118 | #include "mainwindow.h" | 118 | #include "mainwindow.h" |
119 | 119 | ||
120 | #include "calendarview.h" | 120 | #include "calendarview.h" |
121 | #ifndef DESKTOP_VERSION | 121 | #ifndef DESKTOP_VERSION |
122 | #include <qtopia/alarmserver.h> | 122 | #include <qtopia/alarmserver.h> |
123 | #endif | 123 | #endif |
124 | #ifndef _WIN32_ | 124 | #ifndef _WIN32_ |
125 | #include <stdlib.h> | 125 | #include <stdlib.h> |
126 | #include <stdio.h> | 126 | #include <stdio.h> |
127 | #include <unistd.h> | 127 | #include <unistd.h> |
128 | #else | 128 | #else |
129 | #include <qprocess.h> | 129 | #include <qprocess.h> |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | #ifdef DESKTOP_VERSION | 132 | #ifdef DESKTOP_VERSION |
133 | #include <kabc/stdaddressbook.h> | 133 | #include <kabc/stdaddressbook.h> |
134 | #endif | 134 | #endif |
135 | using namespace KOrg; | 135 | using namespace KOrg; |
136 | using namespace KCal; | 136 | using namespace KCal; |
137 | extern int globalFlagBlockAgenda; | 137 | extern int globalFlagBlockAgenda; |
138 | extern int globalFlagBlockStartup; | 138 | extern int globalFlagBlockStartup; |
139 | 139 | ||
140 | 140 | ||
141 | MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) | ||
142 | |||
143 | { | ||
144 | mAlarms = alarms; | ||
145 | setBackgroundColor( QColor( 86, 153, 205 ) ); | ||
146 | QString mText = "<table width=\"100%\">\n"; | ||
147 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; | ||
148 | #ifdef DESKTOP_VERSION | ||
149 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; | ||
150 | #else | ||
151 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; | ||
152 | #endif | ||
153 | // mText += "<img src=\""; | ||
154 | // mText += ipath; | ||
155 | // mText += "\">"; | ||
156 | //mEventDate = QDate::currentDate(); | ||
157 | #ifdef DESKTOP_VERSION | ||
158 | mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h1>"; | ||
159 | #else | ||
160 | mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>"; | ||
161 | #endif | ||
162 | mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; | ||
163 | |||
164 | Incidence * inc = getNextInc( start ); | ||
165 | int time = 0; | ||
166 | mText += "<table>"; | ||
167 | while ( inc ) { | ||
168 | QDateTime dt ; | ||
169 | QString tempText = "<a "; | ||
170 | bool ok; | ||
171 | dt = inc->getNextOccurence( start, &ok ); | ||
172 | if ( !ok ) continue; | ||
173 | if ( inc->type() == "Event" ) { | ||
174 | tempText += "href=\"event:"; | ||
175 | } else if ( inc->type() == "Todo" ) { | ||
176 | tempText += "href=\"todo:"; | ||
177 | } | ||
178 | tempText += inc->uid() + "\">"; | ||
179 | if ( inc->type() == "Todo" ) | ||
180 | tempText += i18n("Todo: "); | ||
181 | if ( inc->summary().length() > 0 ) | ||
182 | tempText += inc->summary(); | ||
183 | else | ||
184 | tempText += i18n("-no summary-"); | ||
185 | QString timestr; | ||
186 | if (!inc->doesFloat()) | ||
187 | timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": "; | ||
188 | else | ||
189 | timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": "; | ||
190 | if ( dt.date() == QDate::currentDate() && time == 0 ) { | ||
191 | time = 1; | ||
192 | mText +="</table>"; | ||
193 | mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>"; | ||
194 | mText += "<table>"; | ||
195 | |||
196 | } | ||
197 | if ( dt.date() > QDate::currentDate() && time != 2 ) { | ||
198 | time = 2; | ||
199 | mText +="</table>"; | ||
200 | mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>"; | ||
201 | mText += "<table>"; | ||
202 | } | ||
203 | mText +="<tr><td><b>"; | ||
204 | mText += timestr; | ||
205 | mText += "</b></td><td>"; | ||
206 | mText += tempText; | ||
207 | mText += "</td></tr>\n"; | ||
208 | inc = getNextInc( start ); | ||
209 | } | ||
210 | mText +="</table>"; | ||
211 | setText( mText ); | ||
212 | } | ||
213 | |||
214 | Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start ) | ||
215 | { | ||
216 | QDateTime dt ; | ||
217 | Incidence * retInc; | ||
218 | Incidence * inc = mAlarms.first(); | ||
219 | if ( inc == 0 ) | ||
220 | return 0; | ||
221 | bool ok; | ||
222 | dt = inc->getNextOccurence( start, &ok ); | ||
223 | if ( ! ok ) return 0; | ||
224 | QDateTime dtn ; | ||
225 | retInc = inc; | ||
226 | inc = mAlarms.next(); | ||
227 | while ( inc ) { | ||
228 | dtn = inc->getNextOccurence( start, &ok ); | ||
229 | if ( ! ok ) return 0; | ||
230 | if ( dtn < dt ) { | ||
231 | dt = dtn; | ||
232 | retInc = inc; | ||
233 | } | ||
234 | inc = mAlarms.next(); | ||
235 | } | ||
236 | mAlarms.remove( retInc ); | ||
237 | return retInc; | ||
238 | |||
239 | } | ||
240 | void MissedAlarmTextBrowser::setSource(const QString & n) | ||
241 | { | ||
242 | if (n.startsWith("event:")) { | ||
243 | #ifdef DESKTOP_VERSION | ||
244 | emit showIncidence(n.mid(8)); | ||
245 | #else | ||
246 | emit showIncidence(n.mid(6)); | ||
247 | #endif | ||
248 | return; | ||
249 | } else if (n.startsWith("todo:")) { | ||
250 | #ifdef DESKTOP_VERSION | ||
251 | emit showIncidence(n.mid(7)); | ||
252 | #else | ||
253 | emit showIncidence(n.mid(5)); | ||
254 | #endif | ||
255 | return; | ||
256 | } | ||
257 | } | ||
258 | |||
141 | 259 | ||
142 | class KOBeamPrefs : public QDialog | 260 | class KOBeamPrefs : public QDialog |
143 | { | 261 | { |
144 | public: | 262 | public: |
145 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : | 263 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : |
146 | QDialog( parent, name, true ) | 264 | QDialog( parent, name, true ) |
147 | { | 265 | { |
148 | setCaption( i18n("Beam Options") ); | 266 | setCaption( i18n("Beam Options") ); |
149 | QVBoxLayout* lay = new QVBoxLayout( this ); | 267 | QVBoxLayout* lay = new QVBoxLayout( this ); |
150 | lay->setSpacing( 3 ); | 268 | lay->setSpacing( 3 ); |
151 | lay->setMargin( 3 ); | 269 | lay->setMargin( 3 ); |
152 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); | 270 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); |
153 | lay->addWidget( format ); | 271 | lay->addWidget( format ); |
154 | format->setExclusive ( true ) ; | 272 | format->setExclusive ( true ) ; |
155 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); | 273 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); |
156 | lay->addWidget( time ); time->setExclusive ( true ) ; | 274 | lay->addWidget( time ); time->setExclusive ( true ) ; |
157 | vcal = new QRadioButton(" vCalendar ", format ); | 275 | vcal = new QRadioButton(" vCalendar ", format ); |
158 | ical = new QRadioButton(" iCalendar ", format ); | 276 | ical = new QRadioButton(" iCalendar ", format ); |
159 | vcal->setChecked( true ); | 277 | vcal->setChecked( true ); |
160 | tz = new QRadioButton(i18n(" With timezone "), time ); | 278 | tz = new QRadioButton(i18n(" With timezone "), time ); |
161 | local = new QRadioButton(i18n(" Local time "), time ); | 279 | local = new QRadioButton(i18n(" Local time "), time ); |
162 | tz->setChecked( true ); | 280 | tz->setChecked( true ); |
163 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); | 281 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); |
164 | lay->addWidget( ok ); | 282 | lay->addWidget( ok ); |
165 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 283 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
166 | lay->addWidget( cancel ); | 284 | lay->addWidget( cancel ); |
167 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 285 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
168 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 286 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
169 | resize( 200, 200 ); | 287 | resize( 200, 200 ); |
170 | } | 288 | } |
171 | 289 | ||
172 | bool beamVcal() { return vcal->isChecked(); } | 290 | bool beamVcal() { return vcal->isChecked(); } |
@@ -477,65 +595,103 @@ void CalendarView::init() | |||
477 | mAlarmTimer = new QTimer( this ); | 595 | mAlarmTimer = new QTimer( this ); |
478 | mRecheckAlarmTimer = new QTimer( this ); | 596 | mRecheckAlarmTimer = new QTimer( this ); |
479 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); | 597 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); |
480 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); | 598 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); |
481 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); | 599 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); |
482 | mAlarmDialog = new AlarmDialog( this ); | 600 | mAlarmDialog = new AlarmDialog( this ); |
483 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); | 601 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); |
484 | mAlarmDialog->setServerNotification( false ); | 602 | mAlarmDialog->setServerNotification( false ); |
485 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 603 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
486 | 604 | ||
487 | 605 | ||
488 | #ifndef DESKTOP_VERSION | 606 | #ifndef DESKTOP_VERSION |
489 | //US listen for arriving address resultsets | 607 | //US listen for arriving address resultsets |
490 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 608 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
491 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 609 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
492 | #endif | 610 | #endif |
493 | mDateNavigator->setCalendar( mCalendar ); | 611 | mDateNavigator->setCalendar( mCalendar ); |
494 | } | 612 | } |
495 | 613 | ||
496 | 614 | ||
497 | CalendarView::~CalendarView() | 615 | CalendarView::~CalendarView() |
498 | { | 616 | { |
499 | // kdDebug() << "~CalendarView()" << endl; | 617 | // kdDebug() << "~CalendarView()" << endl; |
500 | //qDebug("CalendarView::~CalendarView() "); | 618 | //qDebug("CalendarView::~CalendarView() "); |
501 | delete mDialogManager; | 619 | delete mDialogManager; |
502 | delete mViewManager; | 620 | delete mViewManager; |
503 | delete mStorage; | 621 | delete mStorage; |
504 | delete mDateFrame ; | 622 | delete mDateFrame ; |
505 | delete beamDialog; | 623 | delete beamDialog; |
506 | delete mEventViewerDialog; | 624 | delete mEventViewerDialog; |
507 | //kdDebug() << "~CalendarView() done" << endl; | 625 | //kdDebug() << "~CalendarView() done" << endl; |
508 | } | 626 | } |
627 | void CalendarView::checkAlarms() | ||
628 | { | ||
629 | KConfig *config = KOGlobals::config(); | ||
630 | config->setGroup( "AppRun" ); | ||
631 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | ||
632 | int secs = config->readNumEntry( "LatestProgramStop" ) - 30; | ||
633 | //secs -= ( 3600 * 24*3 ); // debug only | ||
634 | QDateTime latest = dt.addSecs ( secs ); | ||
635 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); | ||
636 | QPtrList<Incidence> el = mCalendar->rawIncidences(); | ||
637 | QPtrList<Incidence> al; | ||
638 | Incidence* inL = el.first(); | ||
639 | while ( inL ) { | ||
640 | bool ok = false; | ||
641 | int offset = 0; | ||
642 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; | ||
643 | if ( ok ) { | ||
644 | //qDebug("OK %s",next.toString().latin1()); | ||
645 | if ( next < QDateTime::currentDateTime() ) { | ||
646 | al.append( inL ); | ||
647 | qDebug("found missed alarm: %s ", inL->summary().latin1() ); | ||
648 | } | ||
649 | } | ||
650 | inL = el.next(); | ||
651 | } | ||
652 | if ( al.count() ) { | ||
653 | QDialog dia ( this, "huhu", true ); | ||
654 | dia.setCaption( i18n("KO/Pi: Missing alarm notification!") ); | ||
655 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | ||
656 | lay->setSpacing( 3 ); | ||
657 | lay->setMargin( 3 ); | ||
658 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( &dia, al, latest ); | ||
659 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); | ||
660 | lay->addWidget( matb ); | ||
661 | dia.resize(240,240); | ||
662 | dia.exec(); | ||
509 | 663 | ||
664 | } | ||
665 | } | ||
510 | void CalendarView::showDay( QDate d ) | 666 | void CalendarView::showDay( QDate d ) |
511 | { | 667 | { |
512 | dateNavigator()->blockSignals( true ); | 668 | dateNavigator()->blockSignals( true ); |
513 | dateNavigator()->selectDate( d ); | 669 | dateNavigator()->selectDate( d ); |
514 | dateNavigator()->blockSignals( false ); | 670 | dateNavigator()->blockSignals( false ); |
515 | mViewManager->showDayView(); | 671 | mViewManager->showDayView(); |
516 | //dateNavigator()->selectDate( d ); | 672 | //dateNavigator()->selectDate( d ); |
517 | } | 673 | } |
518 | void CalendarView::timerAlarm() | 674 | void CalendarView::timerAlarm() |
519 | { | 675 | { |
520 | //qDebug("CalendarView::timerAlarm() "); | 676 | //qDebug("CalendarView::timerAlarm() "); |
521 | computeAlarm(mAlarmNotification ); | 677 | computeAlarm(mAlarmNotification ); |
522 | } | 678 | } |
523 | 679 | ||
524 | void CalendarView::suspendAlarm() | 680 | void CalendarView::suspendAlarm() |
525 | { | 681 | { |
526 | //qDebug(" CalendarView::suspendAlarm() "); | 682 | //qDebug(" CalendarView::suspendAlarm() "); |
527 | computeAlarm(mSuspendAlarmNotification ); | 683 | computeAlarm(mSuspendAlarmNotification ); |
528 | 684 | ||
529 | } | 685 | } |
530 | 686 | ||
531 | void CalendarView::startAlarm( QString mess , QString filename) | 687 | void CalendarView::startAlarm( QString mess , QString filename) |
532 | { | 688 | { |
533 | 689 | ||
534 | topLevelWidget()->showNormal(); | 690 | topLevelWidget()->showNormal(); |
535 | topLevelWidget()->setActiveWindow(); | 691 | topLevelWidget()->setActiveWindow(); |
536 | topLevelWidget()->raise(); | 692 | topLevelWidget()->raise(); |
537 | 693 | ||
538 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 694 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
539 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); | 695 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); |
540 | 696 | ||
541 | } | 697 | } |
@@ -1940,65 +2096,67 @@ void CalendarView::readSettings() | |||
1940 | maxVal = QApplication::desktop()->height()-10; | 2096 | maxVal = QApplication::desktop()->height()-10; |
1941 | } | 2097 | } |
1942 | sizes << resetval; | 2098 | sizes << resetval; |
1943 | if ( maxVal < resetval + resetval) | 2099 | if ( maxVal < resetval + resetval) |
1944 | resetval = maxVal - resetval; | 2100 | resetval = maxVal - resetval; |
1945 | sizes << resetval; | 2101 | sizes << resetval; |
1946 | } | 2102 | } |
1947 | mMainFrame->setSizes(sizes); | 2103 | mMainFrame->setSizes(sizes); |
1948 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 2104 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1949 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 2105 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1950 | else mNavigator->selectDates( dateCount ); | 2106 | else mNavigator->selectDates( dateCount ); |
1951 | // mViewManager->readSettings( config ); | 2107 | // mViewManager->readSettings( config ); |
1952 | updateConfig(); | 2108 | updateConfig(); |
1953 | globalFlagBlockAgenda = 2; | 2109 | globalFlagBlockAgenda = 2; |
1954 | mViewManager->readSettings( config ); | 2110 | mViewManager->readSettings( config ); |
1955 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); | 2111 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); |
1956 | } | 2112 | } |
1957 | 2113 | ||
1958 | 2114 | ||
1959 | void CalendarView::writeSettings() | 2115 | void CalendarView::writeSettings() |
1960 | { | 2116 | { |
1961 | // kdDebug() << "CalendarView::writeSettings" << endl; | 2117 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1962 | 2118 | ||
1963 | KConfig *config = KOGlobals::config(); | 2119 | KConfig *config = KOGlobals::config(); |
1964 | 2120 | ||
1965 | mViewManager->writeSettings( config ); | 2121 | mViewManager->writeSettings( config ); |
1966 | mTodoList->saveLayout(config,QString("Todo Layout")); | 2122 | mTodoList->saveLayout(config,QString("Todo Layout")); |
1967 | mDialogManager->writeSettings( config ); | 2123 | mDialogManager->writeSettings( config ); |
1968 | //KOPrefs::instance()->usrWriteConfig(); | 2124 | //KOPrefs::instance()->usrWriteConfig(); |
1969 | KOPrefs::instance()->writeConfig(); | 2125 | KOPrefs::instance()->writeConfig(); |
1970 | 2126 | ||
1971 | writeFilterSettings(config); | 2127 | writeFilterSettings(config); |
1972 | 2128 | config->setGroup( "AppRun" ); | |
2129 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | ||
2130 | config->writeEntry( "LatestProgramStop", dt.secsTo( QDateTime::currentDateTime() ) ); | ||
1973 | config->setGroup( "Views" ); | 2131 | config->setGroup( "Views" ); |
1974 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 2132 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1975 | 2133 | ||
1976 | QValueList<int> listINT = mLeftFrame->sizes(); | 2134 | QValueList<int> listINT = mLeftFrame->sizes(); |
1977 | config->writeEntry("Left Splitter Frame",listINT); | 2135 | config->writeEntry("Left Splitter Frame",listINT); |
1978 | QValueList<int> listINT2 = mMainFrame->sizes(); | 2136 | QValueList<int> listINT2 = mMainFrame->sizes(); |
1979 | config->writeEntry("Main Splitter Frame",listINT2); | 2137 | config->writeEntry("Main Splitter Frame",listINT2); |
1980 | #ifdef DESKTOP_VERSION | 2138 | #ifdef DESKTOP_VERSION |
1981 | config->setGroup("WidgetLayout"); | 2139 | config->setGroup("WidgetLayout"); |
1982 | QStringList list ;//= config->readListEntry("MainLayout"); | 2140 | QStringList list ;//= config->readListEntry("MainLayout"); |
1983 | int x,y,w,h; | 2141 | int x,y,w,h; |
1984 | QWidget* wid; | 2142 | QWidget* wid; |
1985 | wid = topLevelWidget(); | 2143 | wid = topLevelWidget(); |
1986 | x = wid->geometry().x(); | 2144 | x = wid->geometry().x(); |
1987 | y = wid->geometry().y(); | 2145 | y = wid->geometry().y(); |
1988 | w = wid->width(); | 2146 | w = wid->width(); |
1989 | h = wid->height(); | 2147 | h = wid->height(); |
1990 | list.clear(); | 2148 | list.clear(); |
1991 | list << QString::number( x ); | 2149 | list << QString::number( x ); |
1992 | list << QString::number( y ); | 2150 | list << QString::number( y ); |
1993 | list << QString::number( w ); | 2151 | list << QString::number( w ); |
1994 | list << QString::number( h ); | 2152 | list << QString::number( h ); |
1995 | config->writeEntry("MainLayout",list ); | 2153 | config->writeEntry("MainLayout",list ); |
1996 | 2154 | ||
1997 | wid = mEventEditor; | 2155 | wid = mEventEditor; |
1998 | x = wid->geometry().x(); | 2156 | x = wid->geometry().x(); |
1999 | y = wid->geometry().y(); | 2157 | y = wid->geometry().y(); |
2000 | w = wid->width(); | 2158 | w = wid->width(); |
2001 | h = wid->height(); | 2159 | h = wid->height(); |
2002 | list.clear(); | 2160 | list.clear(); |
2003 | list << QString::number( x ); | 2161 | list << QString::number( x ); |
2004 | list << QString::number( y ); | 2162 | list << QString::number( y ); |
@@ -3892,65 +4050,70 @@ void CalendarView::showIncidence() | |||
3892 | Incidence *incidence = currentSelection(); | 4050 | Incidence *incidence = currentSelection(); |
3893 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 4051 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3894 | if ( incidence ) { | 4052 | if ( incidence ) { |
3895 | ShowIncidenceVisitor v; | 4053 | ShowIncidenceVisitor v; |
3896 | v.act( incidence, this ); | 4054 | v.act( incidence, this ); |
3897 | } | 4055 | } |
3898 | } | 4056 | } |
3899 | void CalendarView::editIncidenceDescription() | 4057 | void CalendarView::editIncidenceDescription() |
3900 | { | 4058 | { |
3901 | mFlagEditDescription = true; | 4059 | mFlagEditDescription = true; |
3902 | editIncidence(); | 4060 | editIncidence(); |
3903 | mFlagEditDescription = false; | 4061 | mFlagEditDescription = false; |
3904 | } | 4062 | } |
3905 | void CalendarView::editIncidence() | 4063 | void CalendarView::editIncidence() |
3906 | { | 4064 | { |
3907 | // qDebug("editIncidence() "); | 4065 | // qDebug("editIncidence() "); |
3908 | Incidence *incidence = currentSelection(); | 4066 | Incidence *incidence = currentSelection(); |
3909 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 4067 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3910 | if ( incidence ) { | 4068 | if ( incidence ) { |
3911 | EditIncidenceVisitor v; | 4069 | EditIncidenceVisitor v; |
3912 | v.act( incidence, this ); | 4070 | v.act( incidence, this ); |
3913 | } | 4071 | } |
3914 | } | 4072 | } |
3915 | 4073 | ||
3916 | void CalendarView::deleteIncidence() | 4074 | void CalendarView::deleteIncidence() |
3917 | { | 4075 | { |
3918 | Incidence *incidence = currentSelection(); | 4076 | Incidence *incidence = currentSelection(); |
3919 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 4077 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3920 | if ( incidence ) { | 4078 | if ( incidence ) { |
3921 | deleteIncidence(incidence); | 4079 | deleteIncidence(incidence); |
3922 | } | 4080 | } |
3923 | } | 4081 | } |
3924 | 4082 | void CalendarView::showIncidence(QString uid) | |
4083 | { | ||
4084 | Incidence *inc = mCalendar->incidence( uid ); | ||
4085 | if ( inc ) | ||
4086 | showIncidence( inc ); | ||
4087 | } | ||
3925 | void CalendarView::showIncidence(Incidence *incidence) | 4088 | void CalendarView::showIncidence(Incidence *incidence) |
3926 | { | 4089 | { |
3927 | mViewerCallerIsSearchDialog = false; | 4090 | mViewerCallerIsSearchDialog = false; |
3928 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); | 4091 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); |
3929 | if ( sender() && mDialogManager->getSearchDialog() ) { | 4092 | if ( sender() && mDialogManager->getSearchDialog() ) { |
3930 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { | 4093 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { |
3931 | mViewerCallerIsSearchDialog = true; | 4094 | mViewerCallerIsSearchDialog = true; |
3932 | } | 4095 | } |
3933 | } | 4096 | } |
3934 | if ( incidence ) { | 4097 | if ( incidence ) { |
3935 | ShowIncidenceVisitor v; | 4098 | ShowIncidenceVisitor v; |
3936 | v.act( incidence, this ); | 4099 | v.act( incidence, this ); |
3937 | } | 4100 | } |
3938 | } | 4101 | } |
3939 | 4102 | ||
3940 | void CalendarView::editIncidence(Incidence *incidence) | 4103 | void CalendarView::editIncidence(Incidence *incidence) |
3941 | { | 4104 | { |
3942 | if ( incidence ) { | 4105 | if ( incidence ) { |
3943 | 4106 | ||
3944 | EditIncidenceVisitor v; | 4107 | EditIncidenceVisitor v; |
3945 | v.act( incidence, this ); | 4108 | v.act( incidence, this ); |
3946 | 4109 | ||
3947 | } | 4110 | } |
3948 | } | 4111 | } |
3949 | 4112 | ||
3950 | void CalendarView::deleteIncidence(Incidence *incidence) | 4113 | void CalendarView::deleteIncidence(Incidence *incidence) |
3951 | { | 4114 | { |
3952 | //qDebug(" CalendarView::deleteIncidence "); | 4115 | //qDebug(" CalendarView::deleteIncidence "); |
3953 | if ( incidence ) { | 4116 | if ( incidence ) { |
3954 | DeleteIncidenceVisitor v; | 4117 | DeleteIncidenceVisitor v; |
3955 | v.act( incidence, this ); | 4118 | v.act( incidence, this ); |
3956 | } | 4119 | } |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 05a34b4..1eca905 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -51,64 +51,82 @@ class QSplitter; | |||
51 | class CalPrinter; | 51 | class CalPrinter; |
52 | class KOFilterView; | 52 | class KOFilterView; |
53 | class KOViewManager; | 53 | class KOViewManager; |
54 | class KODialogManager; | 54 | class KODialogManager; |
55 | class KOTodoView; | 55 | class KOTodoView; |
56 | class KDateNavigator; | 56 | class KDateNavigator; |
57 | class DateNavigatorContainer; | 57 | class DateNavigatorContainer; |
58 | class DateNavigator; | 58 | class DateNavigator; |
59 | class KOIncidenceEditor; | 59 | class KOIncidenceEditor; |
60 | class KDatePicker; | 60 | class KDatePicker; |
61 | class ResourceView; | 61 | class ResourceView; |
62 | class KOEventEditor; | 62 | class KOEventEditor; |
63 | class KOTodoEditor ; | 63 | class KOTodoEditor ; |
64 | class KOEventViewerDialog; | 64 | class KOEventViewerDialog; |
65 | class KOBeamPrefs; | 65 | class KOBeamPrefs; |
66 | class KSyncProfile; | 66 | class KSyncProfile; |
67 | class AlarmDialog; | 67 | class AlarmDialog; |
68 | class KCal::Attendee; | 68 | class KCal::Attendee; |
69 | 69 | ||
70 | namespace KCal { class FileStorage; } | 70 | namespace KCal { class FileStorage; } |
71 | 71 | ||
72 | using namespace KCal; | 72 | using namespace KCal; |
73 | 73 | ||
74 | /** | 74 | /** |
75 | This is the main calendar widget. It provides the different vies on t he | 75 | This is the main calendar widget. It provides the different vies on t he |
76 | calendar data as well as the date navigator. It also handles synchronisation | 76 | calendar data as well as the date navigator. It also handles synchronisation |
77 | of the different views and controls the different dialogs like preferences, | 77 | of the different views and controls the different dialogs like preferences, |
78 | event editor, search dialog etc. | 78 | event editor, search dialog etc. |
79 | 79 | ||
80 | @short main calendar view widget | 80 | @short main calendar view widget |
81 | @author Cornelius Schumacher | 81 | @author Cornelius Schumacher |
82 | */ | 82 | */ |
83 | |||
84 | #include <qtextbrowser.h> | ||
85 | #include <qtextcodec.h> | ||
86 | |||
87 | class MissedAlarmTextBrowser : public QTextBrowser { | ||
88 | Q_OBJECT | ||
89 | public: | ||
90 | MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); | ||
91 | void setSource(const QString & n); | ||
92 | |||
93 | private: | ||
94 | Incidence * getNextInc(QDateTime start ); | ||
95 | QPtrList<Incidence> mAlarms; | ||
96 | signals: | ||
97 | void showIncidence( QString uid); | ||
98 | }; | ||
99 | |||
100 | |||
83 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 101 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
84 | { | 102 | { |
85 | Q_OBJECT | 103 | Q_OBJECT |
86 | public: | 104 | public: |
87 | /** | 105 | /** |
88 | Constructs a new calendar view widget. | 106 | Constructs a new calendar view widget. |
89 | 107 | ||
90 | @param calendar calendar document | 108 | @param calendar calendar document |
91 | @param parent parent window | 109 | @param parent parent window |
92 | @param name Qt internal widget object name | 110 | @param name Qt internal widget object name |
93 | */ | 111 | */ |
94 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 112 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
95 | const char *name = 0 ); | 113 | const char *name = 0 ); |
96 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 114 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
97 | const char *name = 0 ); | 115 | const char *name = 0 ); |
98 | virtual ~CalendarView(); | 116 | virtual ~CalendarView(); |
99 | 117 | ||
100 | Calendar *calendar() { return mCalendar; } | 118 | Calendar *calendar() { return mCalendar; } |
101 | 119 | ||
102 | KOViewManager *viewManager(); | 120 | KOViewManager *viewManager(); |
103 | KODialogManager *dialogManager(); | 121 | KODialogManager *dialogManager(); |
104 | 122 | ||
105 | QDate startDate(); | 123 | QDate startDate(); |
106 | QDate endDate(); | 124 | QDate endDate(); |
107 | 125 | ||
108 | QWidgetStack *viewStack(); | 126 | QWidgetStack *viewStack(); |
109 | QWidget *leftFrame(); | 127 | QWidget *leftFrame(); |
110 | 128 | ||
111 | DateNavigator *dateNavigator(); | 129 | DateNavigator *dateNavigator(); |
112 | KDateNavigator *dateNavigatorWidget(); | 130 | KDateNavigator *dateNavigatorWidget(); |
113 | 131 | ||
114 | void addView(KOrg::BaseView *); | 132 | void addView(KOrg::BaseView *); |
@@ -147,128 +165,130 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
147 | /** Emitted when state of events selection has changed and user is organizer*/ | 165 | /** Emitted when state of events selection has changed and user is organizer*/ |
148 | void organizerEventsSelected(bool); | 166 | void organizerEventsSelected(bool); |
149 | /** Emitted when state of events selection has changed and user is attendee*/ | 167 | /** Emitted when state of events selection has changed and user is attendee*/ |
150 | void groupEventsSelected(bool); | 168 | void groupEventsSelected(bool); |
151 | /** | 169 | /** |
152 | Emitted when an incidence gets selected. If the selection is cleared the | 170 | Emitted when an incidence gets selected. If the selection is cleared the |
153 | signal is emitted with 0 as argument. | 171 | signal is emitted with 0 as argument. |
154 | */ | 172 | */ |
155 | void incidenceSelected( Incidence * ); | 173 | void incidenceSelected( Incidence * ); |
156 | /** Emitted, when a todoitem is selected or deselected. */ | 174 | /** Emitted, when a todoitem is selected or deselected. */ |
157 | void todoSelected( bool ); | 175 | void todoSelected( bool ); |
158 | 176 | ||
159 | /** | 177 | /** |
160 | Emitted, when clipboard content changes. Parameter indicates if paste | 178 | Emitted, when clipboard content changes. Parameter indicates if paste |
161 | is possible or not. | 179 | is possible or not. |
162 | */ | 180 | */ |
163 | void pasteEnabled(bool); | 181 | void pasteEnabled(bool); |
164 | 182 | ||
165 | /** Emitted, when the number of incoming messages has changed. */ | 183 | /** Emitted, when the number of incoming messages has changed. */ |
166 | void numIncomingChanged(int); | 184 | void numIncomingChanged(int); |
167 | 185 | ||
168 | /** Emitted, when the number of outgoing messages has changed. */ | 186 | /** Emitted, when the number of outgoing messages has changed. */ |
169 | void numOutgoingChanged(int); | 187 | void numOutgoingChanged(int); |
170 | 188 | ||
171 | /** Send status message, which can e.g. be displayed in the status bar. */ | 189 | /** Send status message, which can e.g. be displayed in the status bar. */ |
172 | void statusMessage(const QString &); | 190 | void statusMessage(const QString &); |
173 | 191 | ||
174 | void calendarViewExpanded( bool ); | 192 | void calendarViewExpanded( bool ); |
175 | void updateSearchDialog(); | 193 | void updateSearchDialog(); |
176 | 194 | ||
177 | 195 | ||
178 | public slots: | 196 | public slots: |
197 | void checkAlarms(); | ||
179 | void slotprintSelInc(); | 198 | void slotprintSelInc(); |
180 | void showNextAlarms(); | 199 | void showNextAlarms(); |
181 | void showOpenError(); | 200 | void showOpenError(); |
182 | void watchSavedFile(); | 201 | void watchSavedFile(); |
183 | void recheckTimerAlarm(); | 202 | void recheckTimerAlarm(); |
184 | void checkNextTimerAlarm(); | 203 | void checkNextTimerAlarm(); |
185 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 204 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
186 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 205 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
187 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 206 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
188 | 207 | ||
189 | /** options dialog made a changed to the configuration. we catch this | 208 | /** options dialog made a changed to the configuration. we catch this |
190 | * and notify all widgets which need to update their configuration. */ | 209 | * and notify all widgets which need to update their configuration. */ |
191 | void updateConfig(); | 210 | void updateConfig(); |
192 | 211 | ||
193 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 212 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
194 | const QStringList& anniversaryList, const QStringList& realNameList, | 213 | const QStringList& anniversaryList, const QStringList& realNameList, |
195 | const QStringList& emailList, const QStringList& assembledNameList, | 214 | const QStringList& emailList, const QStringList& assembledNameList, |
196 | const QStringList& uidList); | 215 | const QStringList& uidList); |
197 | 216 | ||
198 | /** | 217 | /** |
199 | Load calendar from file \a filename. If \a merge is true, load | 218 | Load calendar from file \a filename. If \a merge is true, load |
200 | calendar into existing one, if it is false, clear calendar, before | 219 | calendar into existing one, if it is false, clear calendar, before |
201 | loading. Return true, if calendar could be successfully loaded. | 220 | loading. Return true, if calendar could be successfully loaded. |
202 | */ | 221 | */ |
203 | bool openCalendar(QString filename, bool merge=false); | 222 | bool openCalendar(QString filename, bool merge=false); |
204 | bool syncCalendar(QString filename,int mode = 0 ); | 223 | bool syncCalendar(QString filename,int mode = 0 ); |
205 | 224 | ||
206 | /** | 225 | /** |
207 | Save calendar data to file. Return true if calendar could be | 226 | Save calendar data to file. Return true if calendar could be |
208 | successfully saved. | 227 | successfully saved. |
209 | */ | 228 | */ |
210 | bool saveCalendar(QString filename); | 229 | bool saveCalendar(QString filename); |
211 | 230 | ||
212 | /** | 231 | /** |
213 | Close calendar. Clear calendar data and reset views to display an empty | 232 | Close calendar. Clear calendar data and reset views to display an empty |
214 | calendar. | 233 | calendar. |
215 | */ | 234 | */ |
216 | void closeCalendar(); | 235 | void closeCalendar(); |
217 | 236 | ||
218 | /** Archive old events of calendar */ | 237 | /** Archive old events of calendar */ |
219 | void archiveCalendar(); | 238 | void archiveCalendar(); |
220 | 239 | ||
221 | void showIncidence(); | 240 | void showIncidence(); |
222 | void editIncidence(); | 241 | void editIncidence(); |
223 | void editIncidenceDescription(); | 242 | void editIncidenceDescription(); |
224 | void deleteIncidence(); | 243 | void deleteIncidence(); |
225 | void cloneIncidence(); | 244 | void cloneIncidence(); |
226 | void moveIncidence(); | 245 | void moveIncidence(); |
227 | void beamIncidence(); | 246 | void beamIncidence(); |
228 | void toggleCancelIncidence(); | 247 | void toggleCancelIncidence(); |
229 | 248 | ||
230 | /** create an editeventwin with supplied date/time, and if bool is true, | 249 | /** create an editeventwin with supplied date/time, and if bool is true, |
231 | * make the event take all day. */ | 250 | * make the event take all day. */ |
232 | void newEvent(QDateTime, QDateTime, bool allDay ); | 251 | void newEvent(QDateTime, QDateTime, bool allDay ); |
233 | void newEvent(QDateTime, QDateTime); | 252 | void newEvent(QDateTime, QDateTime); |
234 | void newEvent(QDateTime fh); | 253 | void newEvent(QDateTime fh); |
235 | void newEvent(QDate dt); | 254 | void newEvent(QDate dt); |
236 | /** create new event without having a date hint. Takes current date as | 255 | /** create new event without having a date hint. Takes current date as |
237 | default hint. */ | 256 | default hint. */ |
238 | void newEvent(); | 257 | void newEvent(); |
239 | void newFloatingEvent(); | 258 | void newFloatingEvent(); |
240 | 259 | ||
241 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 260 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
242 | void showIncidence(Incidence *); | 261 | void showIncidence(Incidence *); |
262 | void showIncidence(QString uid); | ||
243 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 263 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
244 | void editIncidence(Incidence *); | 264 | void editIncidence(Incidence *); |
245 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 265 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
246 | void deleteIncidence(Incidence *); | 266 | void deleteIncidence(Incidence *); |
247 | void cloneIncidence(Incidence *); | 267 | void cloneIncidence(Incidence *); |
248 | void cancelIncidence(Incidence *); | 268 | void cancelIncidence(Incidence *); |
249 | /** Create an editor for the supplied event. */ | 269 | /** Create an editor for the supplied event. */ |
250 | void editEvent(Event *); | 270 | void editEvent(Event *); |
251 | /** Delete the supplied event. */ | 271 | /** Delete the supplied event. */ |
252 | void deleteEvent(Event *); | 272 | void deleteEvent(Event *); |
253 | /** Delete the event with the given unique ID. Returns false, if event wasn't | 273 | /** Delete the event with the given unique ID. Returns false, if event wasn't |
254 | found. */ | 274 | found. */ |
255 | bool deleteEvent(const QString &uid); | 275 | bool deleteEvent(const QString &uid); |
256 | /** Create a read-only viewer dialog for the supplied event. */ | 276 | /** Create a read-only viewer dialog for the supplied event. */ |
257 | void showEvent(Event *); | 277 | void showEvent(Event *); |
258 | 278 | ||
259 | void editJournal(Journal *); | 279 | void editJournal(Journal *); |
260 | void showJournal(Journal *); | 280 | void showJournal(Journal *); |
261 | void deleteJournal(Journal *); | 281 | void deleteJournal(Journal *); |
262 | /** Create an editor dialog for a todo */ | 282 | /** Create an editor dialog for a todo */ |
263 | void editTodo(Todo *); | 283 | void editTodo(Todo *); |
264 | /** Create a read-only viewer dialog for the supplied todo */ | 284 | /** Create a read-only viewer dialog for the supplied todo */ |
265 | void showTodo(Todo *); | 285 | void showTodo(Todo *); |
266 | /** create new todo */ | 286 | /** create new todo */ |
267 | void newTodo(); | 287 | void newTodo(); |
268 | void newTodoDateTime(QDateTime, bool allday); | 288 | void newTodoDateTime(QDateTime, bool allday); |
269 | /** create new todo with a parent todo */ | 289 | /** create new todo with a parent todo */ |
270 | void newSubTodo(); | 290 | void newSubTodo(); |
271 | /** create new todo with a parent todo */ | 291 | /** create new todo with a parent todo */ |
272 | void newSubTodo(Todo *); | 292 | void newSubTodo(Todo *); |
273 | /** Delete todo */ | 293 | /** Delete todo */ |
274 | void deleteTodo(Todo *); | 294 | void deleteTodo(Todo *); |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 8fe9999..5aaf360 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -448,66 +448,68 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
448 | mTodoListView->setColumnWidthMode(8, QListView::Manual); | 448 | mTodoListView->setColumnWidthMode(8, QListView::Manual); |
449 | 449 | ||
450 | 450 | ||
451 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); | 451 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); |
452 | 452 | ||
453 | mPriorityPopupMenu = new QPopupMenu(this); | 453 | mPriorityPopupMenu = new QPopupMenu(this); |
454 | for (int i = 1; i <= 5; i++) { | 454 | for (int i = 1; i <= 5; i++) { |
455 | QString label = QString ("%1").arg (i); | 455 | QString label = QString ("%1").arg (i); |
456 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; | 456 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; |
457 | } | 457 | } |
458 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); | 458 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); |
459 | 459 | ||
460 | mPercentageCompletedPopupMenu = new QPopupMenu(this); | 460 | mPercentageCompletedPopupMenu = new QPopupMenu(this); |
461 | for (int i = 0; i <= 100; i+=20) { | 461 | for (int i = 0; i <= 100; i+=20) { |
462 | QString label = QString ("%1 %").arg (i); | 462 | QString label = QString ("%1 %").arg (i); |
463 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; | 463 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; |
464 | } | 464 | } |
465 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); | 465 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); |
466 | 466 | ||
467 | 467 | ||
468 | 468 | ||
469 | mItemPopupMenu = new QPopupMenu(this); | 469 | mItemPopupMenu = new QPopupMenu(this); |
470 | mItemPopupMenu->insertItem(i18n("Show..."), this, | 470 | mItemPopupMenu->insertItem(i18n("Show..."), this, |
471 | SLOT (showTodo())); | 471 | SLOT (showTodo())); |
472 | mItemPopupMenu->insertItem(i18n("Edit..."), this, | 472 | mItemPopupMenu->insertItem(i18n("Edit..."), this, |
473 | SLOT (editTodo())); | 473 | SLOT (editTodo())); |
474 | mItemPopupMenu->insertItem( i18n("Delete"), this, | 474 | mItemPopupMenu->insertItem( i18n("Delete"), this, |
475 | SLOT (deleteTodo())); | 475 | SLOT (deleteTodo())); |
476 | mItemPopupMenu->insertItem( i18n("Clone..."), this, | 476 | mItemPopupMenu->insertItem( i18n("Clone..."), this, |
477 | SLOT (cloneTodo())); | 477 | SLOT (cloneTodo())); |
478 | mItemPopupMenu->insertItem( i18n("Move..."), this, | 478 | mItemPopupMenu->insertItem( i18n("Move..."), this, |
479 | SLOT (moveTodo())); | 479 | SLOT (moveTodo())); |
480 | #ifndef DESKTOP_VERSION | ||
480 | mItemPopupMenu->insertItem( i18n("Beam..."), this, | 481 | mItemPopupMenu->insertItem( i18n("Beam..."), this, |
481 | SLOT (beamTodo())); | 482 | SLOT (beamTodo())); |
483 | #endif | ||
482 | mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, | 484 | mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, |
483 | SLOT (cancelTodo())); | 485 | SLOT (cancelTodo())); |
484 | mItemPopupMenu->insertSeparator(); | 486 | mItemPopupMenu->insertSeparator(); |
485 | mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, | 487 | mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, |
486 | SLOT (toggleRunningItem())); | 488 | SLOT (toggleRunningItem())); |
487 | mItemPopupMenu->insertSeparator(); | 489 | mItemPopupMenu->insertSeparator(); |
488 | /* | 490 | /* |
489 | mItemPopupMenu->insertItem( i18n("New Todo..."), this, | 491 | mItemPopupMenu->insertItem( i18n("New Todo..."), this, |
490 | SLOT (newTodo())); | 492 | SLOT (newTodo())); |
491 | */ | 493 | */ |
492 | mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, | 494 | mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, |
493 | SLOT (newSubTodo())); | 495 | SLOT (newSubTodo())); |
494 | mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, | 496 | mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, |
495 | SLOT (unparentTodo()),0,21); | 497 | SLOT (unparentTodo()),0,21); |
496 | mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, | 498 | mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, |
497 | SLOT (reparentTodo()),0,22); | 499 | SLOT (reparentTodo()),0,22); |
498 | mItemPopupMenu->insertSeparator(); | 500 | mItemPopupMenu->insertSeparator(); |
499 | #if 0 | 501 | #if 0 |
500 | mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), | 502 | mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), |
501 | this, SLOT( purgeCompleted() ) ); | 503 | this, SLOT( purgeCompleted() ) ); |
502 | mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), | 504 | mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), |
503 | this, SLOT( toggleCompleted() ),0, 33 ); | 505 | this, SLOT( toggleCompleted() ),0, 33 ); |
504 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | 506 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), |
505 | this, SLOT( toggleQuickTodo() ),0, 34 ); | 507 | this, SLOT( toggleQuickTodo() ),0, 34 ); |
506 | mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), | 508 | mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), |
507 | this, SLOT( toggleRunning() ),0, 35 ); | 509 | this, SLOT( toggleRunning() ),0, 35 ); |
508 | 510 | ||
509 | #endif | 511 | #endif |
510 | mPopupMenu = new QPopupMenu(this); | 512 | mPopupMenu = new QPopupMenu(this); |
511 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, | 513 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, |
512 | SLOT (newTodo()),0,1); | 514 | SLOT (newTodo()),0,1); |
513 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), | 515 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 94d7293..1320231 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -343,64 +343,66 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
343 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 343 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
344 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 344 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
345 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 345 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
346 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 346 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
347 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 347 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
348 | mSyncManager->setDefaultFileName( sentSyncFile()); | 348 | mSyncManager->setDefaultFileName( sentSyncFile()); |
349 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 349 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
350 | mSyncManager->fillSyncMenu(); | 350 | mSyncManager->fillSyncMenu(); |
351 | 351 | ||
352 | 352 | ||
353 | 353 | ||
354 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 354 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
355 | if ( showWarning ) { | 355 | if ( showWarning ) { |
356 | KMessageBox::information( this, | 356 | KMessageBox::information( this, |
357 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 357 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
358 | qApp->processEvents(); | 358 | qApp->processEvents(); |
359 | mView->dialogManager()->showSyncOptions(); | 359 | mView->dialogManager()->showSyncOptions(); |
360 | } | 360 | } |
361 | 361 | ||
362 | //US listen for result adressed from Ka/Pi | 362 | //US listen for result adressed from Ka/Pi |
363 | #ifndef DESKTOP_VERSION | 363 | #ifndef DESKTOP_VERSION |
364 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 364 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
365 | #endif | 365 | #endif |
366 | #ifndef DESKTOP_VERSION | 366 | #ifndef DESKTOP_VERSION |
367 | infrared = 0; | 367 | infrared = 0; |
368 | #endif | 368 | #endif |
369 | updateFilterToolbar(); | 369 | updateFilterToolbar(); |
370 | updateWeek( mView->startDate() ); | 370 | updateWeek( mView->startDate() ); |
371 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 371 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
372 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 372 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
373 | mBRdisabled = false; | 373 | mBRdisabled = false; |
374 | //toggleBeamReceive(); | 374 | //toggleBeamReceive(); |
375 | |||
376 | QTimer::singleShot( 1000, mView, SLOT ( checkAlarms() )); | ||
375 | } | 377 | } |
376 | MainWindow::~MainWindow() | 378 | MainWindow::~MainWindow() |
377 | { | 379 | { |
378 | //qDebug("MainWindow::~MainWindow() "); | 380 | //qDebug("MainWindow::~MainWindow() "); |
379 | //save toolbar location | 381 | //save toolbar location |
380 | delete mCalendar; | 382 | delete mCalendar; |
381 | delete mSyncManager; | 383 | delete mSyncManager; |
382 | #ifndef DESKTOP_VERSION | 384 | #ifndef DESKTOP_VERSION |
383 | if ( infrared ) | 385 | if ( infrared ) |
384 | delete infrared; | 386 | delete infrared; |
385 | #endif | 387 | #endif |
386 | 388 | ||
387 | 389 | ||
388 | } | 390 | } |
389 | 391 | ||
390 | void MainWindow::disableBR(bool b) | 392 | void MainWindow::disableBR(bool b) |
391 | { | 393 | { |
392 | #ifndef DESKTOP_VERSION | 394 | #ifndef DESKTOP_VERSION |
393 | if ( b ) { | 395 | if ( b ) { |
394 | if ( infrared ) { | 396 | if ( infrared ) { |
395 | toggleBeamReceive(); | 397 | toggleBeamReceive(); |
396 | mBRdisabled = true; | 398 | mBRdisabled = true; |
397 | } | 399 | } |
398 | mBRdisabled = true; | 400 | mBRdisabled = true; |
399 | } else { | 401 | } else { |
400 | if ( mBRdisabled ) { | 402 | if ( mBRdisabled ) { |
401 | mBRdisabled = false; | 403 | mBRdisabled = false; |
402 | //makes no sense,because other cal ap is probably running | 404 | //makes no sense,because other cal ap is probably running |
403 | // toggleBeamReceive(); | 405 | // toggleBeamReceive(); |
404 | } | 406 | } |
405 | } | 407 | } |
406 | #endif | 408 | #endif |
@@ -768,64 +770,66 @@ void MainWindow::initActions() | |||
768 | FSaction->addTo( viewMenu ); | 770 | FSaction->addTo( viewMenu ); |
769 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 771 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
770 | 772 | ||
771 | icon = loadPixmap( pathString + "navi" ); | 773 | icon = loadPixmap( pathString + "navi" ); |
772 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 774 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
773 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 775 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
774 | action->addTo( viewMenu ); | 776 | action->addTo( viewMenu ); |
775 | connect( action, SIGNAL( activated() ), | 777 | connect( action, SIGNAL( activated() ), |
776 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 778 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
777 | mToggleNav = action ; | 779 | mToggleNav = action ; |
778 | icon = loadPixmap( pathString + "filter" ); | 780 | icon = loadPixmap( pathString + "filter" ); |
779 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 781 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
780 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 782 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
781 | action->addTo( viewMenu ); | 783 | action->addTo( viewMenu ); |
782 | connect( action, SIGNAL( activated() ), | 784 | connect( action, SIGNAL( activated() ), |
783 | mView, SLOT( toggleFilter() ) ); | 785 | mView, SLOT( toggleFilter() ) ); |
784 | mToggleFilter = action; | 786 | mToggleFilter = action; |
785 | icon = loadPixmap( pathString + "allday" ); | 787 | icon = loadPixmap( pathString + "allday" ); |
786 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 788 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
787 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 789 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
788 | action->addTo( viewMenu ); | 790 | action->addTo( viewMenu ); |
789 | connect( action, SIGNAL( activated() ), | 791 | connect( action, SIGNAL( activated() ), |
790 | mView, SLOT( toggleAllDaySize() ) ); | 792 | mView, SLOT( toggleAllDaySize() ) ); |
791 | mToggleAllday = action; | 793 | mToggleAllday = action; |
792 | 794 | ||
793 | 795 | ||
794 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 796 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
795 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 797 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
796 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 798 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
797 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 799 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
798 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 800 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
799 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 801 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
802 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | ||
803 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | ||
800 | 804 | ||
801 | viewMenu->insertSeparator(); | 805 | viewMenu->insertSeparator(); |
802 | icon = loadPixmap( pathString + "picker" ); | 806 | icon = loadPixmap( pathString + "picker" ); |
803 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 807 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
804 | action->addTo( viewMenu ); | 808 | action->addTo( viewMenu ); |
805 | connect( action, SIGNAL( activated() ), | 809 | connect( action, SIGNAL( activated() ), |
806 | mView, SLOT( showDatePicker() ) ); | 810 | mView, SLOT( showDatePicker() ) ); |
807 | action->addTo( iconToolBar ); | 811 | action->addTo( iconToolBar ); |
808 | viewMenu->insertSeparator(); | 812 | viewMenu->insertSeparator(); |
809 | 813 | ||
810 | if ( p-> mShowIconToggleFull ) | 814 | if ( p-> mShowIconToggleFull ) |
811 | FSaction->addTo( iconToolBar ); | 815 | FSaction->addTo( iconToolBar ); |
812 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 816 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
813 | 817 | ||
814 | //******************** | 818 | //******************** |
815 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 819 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
816 | 820 | ||
817 | 821 | ||
818 | icon = loadPixmap( pathString + "whatsnext" ); | 822 | icon = loadPixmap( pathString + "whatsnext" ); |
819 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 823 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
820 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 824 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
821 | whatsnext_action->addTo( viewMenu ); | 825 | whatsnext_action->addTo( viewMenu ); |
822 | connect( whatsnext_action, SIGNAL( activated() ), | 826 | connect( whatsnext_action, SIGNAL( activated() ), |
823 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 827 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
824 | 828 | ||
825 | icon = loadPixmap( pathString + "xdays" ); | 829 | icon = loadPixmap( pathString + "xdays" ); |
826 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 830 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
827 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 831 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
828 | xdays_action->addTo( viewMenu ); | 832 | xdays_action->addTo( viewMenu ); |
829 | connect( xdays_action, SIGNAL( activated() ), | 833 | connect( xdays_action, SIGNAL( activated() ), |
830 | mView->viewManager(), SLOT( showNextXView() ) ); | 834 | mView->viewManager(), SLOT( showNextXView() ) ); |
831 | 835 | ||
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index e75df70..bc76c0b 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -277,65 +277,65 @@ Todo *CalendarLocal::todo( const QString &uid ) | |||
277 | Todo *todo; | 277 | Todo *todo; |
278 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 278 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
279 | if ( todo->uid() == uid ) return todo; | 279 | if ( todo->uid() == uid ) return todo; |
280 | } | 280 | } |
281 | 281 | ||
282 | return 0; | 282 | return 0; |
283 | } | 283 | } |
284 | QString CalendarLocal::nextSummary() const | 284 | QString CalendarLocal::nextSummary() const |
285 | { | 285 | { |
286 | return mNextSummary; | 286 | return mNextSummary; |
287 | } | 287 | } |
288 | QDateTime CalendarLocal::nextAlarmEventDateTime() const | 288 | QDateTime CalendarLocal::nextAlarmEventDateTime() const |
289 | { | 289 | { |
290 | return mNextAlarmEventDateTime; | 290 | return mNextAlarmEventDateTime; |
291 | } | 291 | } |
292 | void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted) | 292 | void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted) |
293 | { | 293 | { |
294 | //mNextAlarmIncidence | 294 | //mNextAlarmIncidence |
295 | //mNextAlarmDateTime | 295 | //mNextAlarmDateTime |
296 | //return mNextSummary; | 296 | //return mNextSummary; |
297 | //return mNextAlarmEventDateTime; | 297 | //return mNextAlarmEventDateTime; |
298 | bool newNextAlarm = false; | 298 | bool newNextAlarm = false; |
299 | bool computeNextAlarm = false; | 299 | bool computeNextAlarm = false; |
300 | bool ok; | 300 | bool ok; |
301 | int offset; | 301 | int offset; |
302 | QDateTime nextA; | 302 | QDateTime nextA; |
303 | // QString nextSum; | 303 | // QString nextSum; |
304 | //QDateTime nextEvent; | 304 | //QDateTime nextEvent; |
305 | if ( mNextAlarmIncidence == 0 || incidence == 0 ) { | 305 | if ( mNextAlarmIncidence == 0 || incidence == 0 ) { |
306 | computeNextAlarm = true; | 306 | computeNextAlarm = true; |
307 | } else { | 307 | } else { |
308 | if ( ! deleted ) { | 308 | if ( ! deleted ) { |
309 | nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; | 309 | nextA = incidence->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; |
310 | if ( ok ) { | 310 | if ( ok ) { |
311 | if ( nextA < mNextAlarmDateTime ) { | 311 | if ( nextA < mNextAlarmDateTime ) { |
312 | deRegisterAlarm(); | 312 | deRegisterAlarm(); |
313 | mNextAlarmDateTime = nextA; | 313 | mNextAlarmDateTime = nextA; |
314 | mNextSummary = incidence->summary(); | 314 | mNextSummary = incidence->summary(); |
315 | mNextAlarmEventDateTime = nextA.addSecs(offset ) ; | 315 | mNextAlarmEventDateTime = nextA.addSecs(offset ) ; |
316 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); | 316 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); |
317 | newNextAlarm = true; | 317 | newNextAlarm = true; |
318 | mNextAlarmIncidence = incidence; | 318 | mNextAlarmIncidence = incidence; |
319 | } else { | 319 | } else { |
320 | if ( incidence == mNextAlarmIncidence ) { | 320 | if ( incidence == mNextAlarmIncidence ) { |
321 | computeNextAlarm = true; | 321 | computeNextAlarm = true; |
322 | } | 322 | } |
323 | } | 323 | } |
324 | } else { | 324 | } else { |
325 | if ( mNextAlarmIncidence == incidence ) { | 325 | if ( mNextAlarmIncidence == incidence ) { |
326 | computeNextAlarm = true; | 326 | computeNextAlarm = true; |
327 | } | 327 | } |
328 | } | 328 | } |
329 | } else { // deleted | 329 | } else { // deleted |
330 | if ( incidence == mNextAlarmIncidence ) { | 330 | if ( incidence == mNextAlarmIncidence ) { |
331 | computeNextAlarm = true; | 331 | computeNextAlarm = true; |
332 | } | 332 | } |
333 | } | 333 | } |
334 | } | 334 | } |
335 | if ( computeNextAlarm ) { | 335 | if ( computeNextAlarm ) { |
336 | deRegisterAlarm(); | 336 | deRegisterAlarm(); |
337 | nextA = nextAlarm( 1000 ); | 337 | nextA = nextAlarm( 1000 ); |
338 | if (! mNextAlarmIncidence ) { | 338 | if (! mNextAlarmIncidence ) { |
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | newNextAlarm = true; | 341 | newNextAlarm = true; |
@@ -392,78 +392,78 @@ QPtrList<Todo> CalendarLocal::todos( const QDate &date ) | |||
392 | if ( todo->hasDueDate() && todo->dtDue().date() == date ) { | 392 | if ( todo->hasDueDate() && todo->dtDue().date() == date ) { |
393 | todos.append( todo ); | 393 | todos.append( todo ); |
394 | } | 394 | } |
395 | } | 395 | } |
396 | 396 | ||
397 | filter()->apply( &todos ); | 397 | filter()->apply( &todos ); |
398 | return todos; | 398 | return todos; |
399 | } | 399 | } |
400 | void CalendarLocal::reInitAlarmSettings() | 400 | void CalendarLocal::reInitAlarmSettings() |
401 | { | 401 | { |
402 | if ( !mNextAlarmIncidence ) { | 402 | if ( !mNextAlarmIncidence ) { |
403 | nextAlarm( 1000 ); | 403 | nextAlarm( 1000 ); |
404 | } | 404 | } |
405 | deRegisterAlarm(); | 405 | deRegisterAlarm(); |
406 | mNextAlarmIncidence = 0; | 406 | mNextAlarmIncidence = 0; |
407 | checkAlarmForIncidence( 0, false ); | 407 | checkAlarmForIncidence( 0, false ); |
408 | 408 | ||
409 | } | 409 | } |
410 | 410 | ||
411 | 411 | ||
412 | 412 | ||
413 | QDateTime CalendarLocal::nextAlarm( int daysTo ) | 413 | QDateTime CalendarLocal::nextAlarm( int daysTo ) |
414 | { | 414 | { |
415 | QDateTime nextA = QDateTime::currentDateTime().addDays( daysTo ); | 415 | QDateTime nextA = QDateTime::currentDateTime().addDays( daysTo ); |
416 | QDateTime start = QDateTime::currentDateTime().addSecs( 30 ); | 416 | QDateTime start = QDateTime::currentDateTime().addSecs( 30 ); |
417 | QDateTime next; | 417 | QDateTime next; |
418 | Event *e; | 418 | Event *e; |
419 | bool ok; | 419 | bool ok; |
420 | bool found = false; | 420 | bool found = false; |
421 | int offset; | 421 | int offset; |
422 | mNextAlarmIncidence = 0; | 422 | mNextAlarmIncidence = 0; |
423 | for( e = mEventList.first(); e; e = mEventList.next() ) { | 423 | for( e = mEventList.first(); e; e = mEventList.next() ) { |
424 | next = e->getNextAlarmDateTime(& ok, &offset ) ; | 424 | next = e->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; |
425 | if ( ok ) { | 425 | if ( ok ) { |
426 | if ( next < nextA ) { | 426 | if ( next < nextA ) { |
427 | nextA = next; | 427 | nextA = next; |
428 | found = true; | 428 | found = true; |
429 | mNextSummary = e->summary(); | 429 | mNextSummary = e->summary(); |
430 | mNextAlarmEventDateTime = next.addSecs(offset ) ; | 430 | mNextAlarmEventDateTime = next.addSecs(offset ) ; |
431 | mNextAlarmIncidence = (Incidence *) e; | 431 | mNextAlarmIncidence = (Incidence *) e; |
432 | } | 432 | } |
433 | } | 433 | } |
434 | } | 434 | } |
435 | Todo *t; | 435 | Todo *t; |
436 | for( t = mTodoList.first(); t; t = mTodoList.next() ) { | 436 | for( t = mTodoList.first(); t; t = mTodoList.next() ) { |
437 | next = t->getNextAlarmDateTime(& ok, &offset ) ; | 437 | next = t->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; |
438 | if ( ok ) { | 438 | if ( ok ) { |
439 | if ( next < nextA ) { | 439 | if ( next < nextA ) { |
440 | nextA = next; | 440 | nextA = next; |
441 | found = true; | 441 | found = true; |
442 | mNextSummary = t->summary(); | 442 | mNextSummary = t->summary(); |
443 | mNextAlarmEventDateTime = next.addSecs(offset ); | 443 | mNextAlarmEventDateTime = next.addSecs(offset ); |
444 | mNextAlarmIncidence = (Incidence *) t; | 444 | mNextAlarmIncidence = (Incidence *) t; |
445 | } | 445 | } |
446 | } | 446 | } |
447 | } | 447 | } |
448 | if ( mNextAlarmIncidence ) { | 448 | if ( mNextAlarmIncidence ) { |
449 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); | 449 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); |
450 | mNextAlarmDateTime = nextA; | 450 | mNextAlarmDateTime = nextA; |
451 | } | 451 | } |
452 | return nextA; | 452 | return nextA; |
453 | } | 453 | } |
454 | Alarm::List CalendarLocal::alarmsTo( const QDateTime &to ) | 454 | Alarm::List CalendarLocal::alarmsTo( const QDateTime &to ) |
455 | { | 455 | { |
456 | return alarms( QDateTime( QDate( 1900, 1, 1 ) ), to ); | 456 | return alarms( QDateTime( QDate( 1900, 1, 1 ) ), to ); |
457 | } | 457 | } |
458 | 458 | ||
459 | Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) | 459 | Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) |
460 | { | 460 | { |
461 | kdDebug(5800) << "CalendarLocal::alarms(" << from.toString() << " - " | 461 | kdDebug(5800) << "CalendarLocal::alarms(" << from.toString() << " - " |
462 | << to.toString() << ")\n"; | 462 | << to.toString() << ")\n"; |
463 | 463 | ||
464 | Alarm::List alarms; | 464 | Alarm::List alarms; |
465 | 465 | ||
466 | Event *e; | 466 | Event *e; |
467 | 467 | ||
468 | for( e = mEventList.first(); e; e = mEventList.next() ) { | 468 | for( e = mEventList.first(); e; e = mEventList.next() ) { |
469 | if ( e->doesRecur() ) appendRecurringAlarms( alarms, e, from, to ); | 469 | if ( e->doesRecur() ) appendRecurringAlarms( alarms, e, from, to ); |
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index de8dceb..9b99855 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -142,80 +142,80 @@ void Event::setHasEndDate(bool b) | |||
142 | { | 142 | { |
143 | mHasEndDate = b; | 143 | mHasEndDate = b; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool Event::hasEndDate() const | 146 | bool Event::hasEndDate() const |
147 | { | 147 | { |
148 | return mHasEndDate; | 148 | return mHasEndDate; |
149 | } | 149 | } |
150 | 150 | ||
151 | bool Event::isMultiDay() const | 151 | bool Event::isMultiDay() const |
152 | { | 152 | { |
153 | bool multi = !(dtStart().date() == dtEnd().date()); | 153 | bool multi = !(dtStart().date() == dtEnd().date()); |
154 | return multi; | 154 | return multi; |
155 | } | 155 | } |
156 | 156 | ||
157 | void Event::setTransparency(Event::Transparency transparency) | 157 | void Event::setTransparency(Event::Transparency transparency) |
158 | { | 158 | { |
159 | if (mReadOnly) return; | 159 | if (mReadOnly) return; |
160 | mTransparency = transparency; | 160 | mTransparency = transparency; |
161 | updated(); | 161 | updated(); |
162 | } | 162 | } |
163 | 163 | ||
164 | Event::Transparency Event::transparency() const | 164 | Event::Transparency Event::transparency() const |
165 | { | 165 | { |
166 | return mTransparency; | 166 | return mTransparency; |
167 | } | 167 | } |
168 | 168 | ||
169 | void Event::setDuration(int seconds) | 169 | void Event::setDuration(int seconds) |
170 | { | 170 | { |
171 | setHasEndDate(false); | 171 | setHasEndDate(false); |
172 | Incidence::setDuration(seconds); | 172 | Incidence::setDuration(seconds); |
173 | } | 173 | } |
174 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const | 174 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const |
175 | { | 175 | { |
176 | 176 | ||
177 | bool yes; | 177 | bool yes; |
178 | QDateTime incidenceStart = getNextOccurence( QDateTime::currentDateTime(), &yes ); | 178 | QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); |
179 | if ( ! yes || cancelled() ) { | 179 | if ( ! yes || cancelled() ) { |
180 | *ok = false; | 180 | *ok = false; |
181 | return QDateTime (); | 181 | return QDateTime (); |
182 | } | 182 | } |
183 | 183 | ||
184 | bool enabled = false; | 184 | bool enabled = false; |
185 | Alarm* alarm; | 185 | Alarm* alarm; |
186 | int off = 0; | 186 | int off = 0; |
187 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 187 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
188 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 188 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
189 | // *ok = false; | 189 | // *ok = false; |
190 | // return incidenceStart; | 190 | // return incidenceStart; |
191 | // } | 191 | // } |
192 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 192 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
193 | if (alarm->enabled()) { | 193 | if (alarm->enabled()) { |
194 | if ( alarm->hasTime () ) { | 194 | if ( alarm->hasTime () ) { |
195 | if ( alarm->time() < alarmStart ) { | 195 | if ( alarm->time() < alarmStart ) { |
196 | alarmStart = alarm->time(); | 196 | alarmStart = alarm->time(); |
197 | enabled = true; | 197 | enabled = true; |
198 | off = alarmStart.secsTo( incidenceStart ); | 198 | off = alarmStart.secsTo( incidenceStart ); |
199 | } | 199 | } |
200 | 200 | ||
201 | } else { | 201 | } else { |
202 | int secs = alarm->startOffset().asSeconds(); | 202 | int secs = alarm->startOffset().asSeconds(); |
203 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { | 203 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { |
204 | alarmStart = incidenceStart.addSecs( secs ); | 204 | alarmStart = incidenceStart.addSecs( secs ); |
205 | enabled = true; | 205 | enabled = true; |
206 | off = -secs; | 206 | off = -secs; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | } | 209 | } |
210 | } | 210 | } |
211 | if ( enabled ) { | 211 | if ( enabled ) { |
212 | if ( alarmStart > QDateTime::currentDateTime() ) { | 212 | if ( alarmStart > start_dt ) { |
213 | *ok = true; | 213 | *ok = true; |
214 | * offset = off; | 214 | * offset = off; |
215 | return alarmStart; | 215 | return alarmStart; |
216 | } | 216 | } |
217 | } | 217 | } |
218 | *ok = false; | 218 | *ok = false; |
219 | return QDateTime (); | 219 | return QDateTime (); |
220 | 220 | ||
221 | } | 221 | } |
diff --git a/libkcal/event.h b/libkcal/event.h index 3bc8adc..8729956 100644 --- a/libkcal/event.h +++ b/libkcal/event.h | |||
@@ -13,65 +13,65 @@ | |||
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef EVENT_H | 21 | #ifndef EVENT_H |
22 | #define EVENT_H | 22 | #define EVENT_H |
23 | // | 23 | // |
24 | // Event component, representing a VEVENT object | 24 | // Event component, representing a VEVENT object |
25 | // | 25 | // |
26 | 26 | ||
27 | #include "incidence.h" | 27 | #include "incidence.h" |
28 | namespace KCal { | 28 | namespace KCal { |
29 | 29 | ||
30 | /** | 30 | /** |
31 | This class provides an Event in the sense of RFC2445. | 31 | This class provides an Event in the sense of RFC2445. |
32 | */ | 32 | */ |
33 | class Event : public Incidence | 33 | class Event : public Incidence |
34 | { | 34 | { |
35 | public: | 35 | public: |
36 | enum Transparency { Opaque, Transparent }; | 36 | enum Transparency { Opaque, Transparent }; |
37 | typedef ListBase<Event> List; | 37 | typedef ListBase<Event> List; |
38 | Event(); | 38 | Event(); |
39 | Event(const Event &); | 39 | Event(const Event &); |
40 | ~Event(); | 40 | ~Event(); |
41 | 41 | ||
42 | QCString type() const { return "Event"; } | 42 | QCString type() const { return "Event"; } |
43 | 43 | ||
44 | Incidence *clone(); | 44 | Incidence *clone(); |
45 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; | 45 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; |
46 | 46 | ||
47 | /** for setting an event's ending date/time with a QDateTime. */ | 47 | /** for setting an event's ending date/time with a QDateTime. */ |
48 | void setDtEnd(const QDateTime &dtEnd); | 48 | void setDtEnd(const QDateTime &dtEnd); |
49 | /** Return the event's ending date/time as a QDateTime. */ | 49 | /** Return the event's ending date/time as a QDateTime. */ |
50 | virtual QDateTime dtEnd() const; | 50 | virtual QDateTime dtEnd() const; |
51 | /** returns an event's end time as a string formatted according to the | 51 | /** returns an event's end time as a string formatted according to the |
52 | users locale settings */ | 52 | users locale settings */ |
53 | QString dtEndTimeStr() const; | 53 | QString dtEndTimeStr() const; |
54 | /** returns an event's end date as a string formatted according to the | 54 | /** returns an event's end date as a string formatted according to the |
55 | users locale settings */ | 55 | users locale settings */ |
56 | QString dtEndDateStr(bool shortfmt=true) const; | 56 | QString dtEndDateStr(bool shortfmt=true) const; |
57 | /** returns an event's end date and time as a string formatted according | 57 | /** returns an event's end date and time as a string formatted according |
58 | to the users locale settings */ | 58 | to the users locale settings */ |
59 | QString dtEndStr(bool shortfmt=true) const; | 59 | QString dtEndStr(bool shortfmt=true) const; |
60 | void setHasEndDate(bool); | 60 | void setHasEndDate(bool); |
61 | /** Return whether the event has an end date/time. */ | 61 | /** Return whether the event has an end date/time. */ |
62 | bool hasEndDate() const; | 62 | bool hasEndDate() const; |
63 | 63 | ||
64 | /** Return true if the event spans multiple days, otherwise return false. */ | 64 | /** Return true if the event spans multiple days, otherwise return false. */ |
65 | bool isMultiDay() const; | 65 | bool isMultiDay() const; |
66 | 66 | ||
67 | /** set the event's time transparency level. */ | 67 | /** set the event's time transparency level. */ |
68 | void setTransparency(Transparency transparency); | 68 | void setTransparency(Transparency transparency); |
69 | /** get the event's time transparency level. */ | 69 | /** get the event's time transparency level. */ |
70 | Transparency transparency() const; | 70 | Transparency transparency() const; |
71 | 71 | ||
72 | void setDuration(int seconds); | 72 | void setDuration(int seconds); |
73 | 73 | ||
74 | bool contains ( Event*); | 74 | bool contains ( Event*); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | bool accept(Visitor &v) { return v.visit(this); } | 77 | bool accept(Visitor &v) { return v.visit(this); } |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index ebd50d0..aa51e84 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -85,65 +85,65 @@ class Incidence : public IncidenceBase | |||
85 | template<class T> | 85 | template<class T> |
86 | class AddVisitor : public Visitor | 86 | class AddVisitor : public Visitor |
87 | { | 87 | { |
88 | public: | 88 | public: |
89 | AddVisitor( T *r ) : mResource( r ) {} | 89 | AddVisitor( T *r ) : mResource( r ) {} |
90 | bool visit( Event *e ) { return mResource->addEvent( e ); } | 90 | bool visit( Event *e ) { return mResource->addEvent( e ); } |
91 | bool visit( Todo *t ) { return mResource->addTodo( t ); } | 91 | bool visit( Todo *t ) { return mResource->addTodo( t ); } |
92 | bool visit( Journal *j ) { return mResource->addJournal( j ); } | 92 | bool visit( Journal *j ) { return mResource->addJournal( j ); } |
93 | 93 | ||
94 | private: | 94 | private: |
95 | T *mResource; | 95 | T *mResource; |
96 | }; | 96 | }; |
97 | 97 | ||
98 | /** enumeration for describing an event's secrecy. */ | 98 | /** enumeration for describing an event's secrecy. */ |
99 | enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; | 99 | enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; |
100 | typedef ListBase<Incidence> List; | 100 | typedef ListBase<Incidence> List; |
101 | Incidence(); | 101 | Incidence(); |
102 | Incidence(const Incidence &); | 102 | Incidence(const Incidence &); |
103 | ~Incidence(); | 103 | ~Incidence(); |
104 | 104 | ||
105 | /** | 105 | /** |
106 | Accept IncidenceVisitor. A class taking part in the visitor mechanism has to | 106 | Accept IncidenceVisitor. A class taking part in the visitor mechanism has to |
107 | provide this implementation: | 107 | provide this implementation: |
108 | <pre> | 108 | <pre> |
109 | bool accept(Visitor &v) { return v.visit(this); } | 109 | bool accept(Visitor &v) { return v.visit(this); } |
110 | </pre> | 110 | </pre> |
111 | */ | 111 | */ |
112 | virtual bool accept(Visitor &) { return false; } | 112 | virtual bool accept(Visitor &) { return false; } |
113 | 113 | ||
114 | virtual Incidence *clone() = 0; | 114 | virtual Incidence *clone() = 0; |
115 | virtual void cloneRelations( Incidence * ); | 115 | virtual void cloneRelations( Incidence * ); |
116 | 116 | ||
117 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; | 117 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; |
118 | void setReadOnly( bool ); | 118 | void setReadOnly( bool ); |
119 | 119 | ||
120 | /** | 120 | /** |
121 | Recreate event. The event is made a new unique event, but already stored | 121 | Recreate event. The event is made a new unique event, but already stored |
122 | event information is preserved. Sets uniquie id, creation date, last | 122 | event information is preserved. Sets uniquie id, creation date, last |
123 | modification date and revision number. | 123 | modification date and revision number. |
124 | */ | 124 | */ |
125 | void recreate(); | 125 | void recreate(); |
126 | Incidence* recreateCloneException(QDate); | 126 | Incidence* recreateCloneException(QDate); |
127 | 127 | ||
128 | /** set creation date */ | 128 | /** set creation date */ |
129 | void setCreated(QDateTime); | 129 | void setCreated(QDateTime); |
130 | /** return time and date of creation. */ | 130 | /** return time and date of creation. */ |
131 | QDateTime created() const; | 131 | QDateTime created() const; |
132 | 132 | ||
133 | /** set the number of revisions this event has seen */ | 133 | /** set the number of revisions this event has seen */ |
134 | void setRevision(int rev); | 134 | void setRevision(int rev); |
135 | /** return the number of revisions this event has seen */ | 135 | /** return the number of revisions this event has seen */ |
136 | int revision() const; | 136 | int revision() const; |
137 | 137 | ||
138 | /** Set starting date/time. */ | 138 | /** Set starting date/time. */ |
139 | virtual void setDtStart(const QDateTime &dtStart); | 139 | virtual void setDtStart(const QDateTime &dtStart); |
140 | /** Return the incidence's ending date/time as a QDateTime. */ | 140 | /** Return the incidence's ending date/time as a QDateTime. */ |
141 | virtual QDateTime dtEnd() const { return QDateTime(); } | 141 | virtual QDateTime dtEnd() const { return QDateTime(); } |
142 | 142 | ||
143 | /** sets the event's lengthy description. */ | 143 | /** sets the event's lengthy description. */ |
144 | void setDescription(const QString &description); | 144 | void setDescription(const QString &description); |
145 | /** returns a reference to the event's description. */ | 145 | /** returns a reference to the event's description. */ |
146 | QString description() const; | 146 | QString description() const; |
147 | 147 | ||
148 | /** sets the event's short summary. */ | 148 | /** sets the event's short summary. */ |
149 | void setSummary(const QString &summary); | 149 | void setSummary(const QString &summary); |
diff --git a/libkcal/journal.cpp b/libkcal/journal.cpp index 351fb32..859161f 100644 --- a/libkcal/journal.cpp +++ b/libkcal/journal.cpp | |||
@@ -13,37 +13,37 @@ | |||
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include "journal.h" | 21 | #include "journal.h" |
22 | 22 | ||
23 | using namespace KCal; | 23 | using namespace KCal; |
24 | 24 | ||
25 | Journal::Journal() | 25 | Journal::Journal() |
26 | { | 26 | { |
27 | } | 27 | } |
28 | 28 | ||
29 | Journal::~Journal() | 29 | Journal::~Journal() |
30 | { | 30 | { |
31 | } | 31 | } |
32 | 32 | ||
33 | Incidence *Journal::clone() | 33 | Incidence *Journal::clone() |
34 | { | 34 | { |
35 | return new Journal(*this); | 35 | return new Journal(*this); |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | bool KCal::operator==( const Journal& j1, const Journal& j2 ) | 39 | bool KCal::operator==( const Journal& j1, const Journal& j2 ) |
40 | { | 40 | { |
41 | return operator==( (const Incidence&)j1, (const Incidence&)j2 ); | 41 | return operator==( (const Incidence&)j1, (const Incidence&)j2 ); |
42 | } | 42 | } |
43 | 43 | ||
44 | 44 | ||
45 | QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset ) const | 45 | QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const |
46 | { | 46 | { |
47 | *ok = false; | 47 | *ok = false; |
48 | return QDateTime (); | 48 | return QDateTime (); |
49 | } | 49 | } |
diff --git a/libkcal/journal.h b/libkcal/journal.h index cb90c7a..2c1d7ea 100644 --- a/libkcal/journal.h +++ b/libkcal/journal.h | |||
@@ -10,41 +10,41 @@ | |||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef JOURNAL_H | 20 | #ifndef JOURNAL_H |
21 | #define JOURNAL_H | 21 | #define JOURNAL_H |
22 | // | 22 | // |
23 | // Journal component, representing a VJOURNAL object | 23 | // Journal component, representing a VJOURNAL object |
24 | // | 24 | // |
25 | 25 | ||
26 | #include "incidence.h" | 26 | #include "incidence.h" |
27 | 27 | ||
28 | namespace KCal { | 28 | namespace KCal { |
29 | 29 | ||
30 | /** | 30 | /** |
31 | This class provides a Journal in the sense of RFC2445. | 31 | This class provides a Journal in the sense of RFC2445. |
32 | */ | 32 | */ |
33 | class Journal : public Incidence | 33 | class Journal : public Incidence |
34 | { | 34 | { |
35 | public: | 35 | public: |
36 | Journal(); | 36 | Journal(); |
37 | ~Journal(); | 37 | ~Journal(); |
38 | 38 | ||
39 | QCString type() const { return "Journal"; } | 39 | QCString type() const { return "Journal"; } |
40 | 40 | ||
41 | Incidence *clone(); | 41 | Incidence *clone(); |
42 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; | 42 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; |
43 | private: | 43 | private: |
44 | bool accept(Visitor &v) { return v.visit(this); } | 44 | bool accept(Visitor &v) { return v.visit(this); } |
45 | }; | 45 | }; |
46 | 46 | ||
47 | bool operator==( const Journal&, const Journal& ); | 47 | bool operator==( const Journal&, const Journal& ); |
48 | } | 48 | } |
49 | 49 | ||
50 | #endif | 50 | #endif |
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index d7431c7..473247a 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -486,92 +486,92 @@ int Todo::percentComplete() const | |||
486 | bool Todo::setRecurDates() | 486 | bool Todo::setRecurDates() |
487 | { | 487 | { |
488 | if ( !mHasRecurrenceID ) | 488 | if ( !mHasRecurrenceID ) |
489 | return true; | 489 | return true; |
490 | int secs = mDtStart.secsTo( dtDue() ); | 490 | int secs = mDtStart.secsTo( dtDue() ); |
491 | bool ok; | 491 | bool ok; |
492 | qDebug("T:setRecurDates() "); | 492 | qDebug("T:setRecurDates() "); |
493 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); | 493 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); |
494 | QDateTime next = getNextOccurence( mRecurrenceID, &ok ); | 494 | QDateTime next = getNextOccurence( mRecurrenceID, &ok ); |
495 | if ( ok ) { | 495 | if ( ok ) { |
496 | mRecurrenceID = next; | 496 | mRecurrenceID = next; |
497 | mDtStart = next; | 497 | mDtStart = next; |
498 | setDtDue( next.addSecs( secs ) ); | 498 | setDtDue( next.addSecs( secs ) ); |
499 | if ( QDateTime::currentDateTime() > next) | 499 | if ( QDateTime::currentDateTime() > next) |
500 | return false; | 500 | return false; |
501 | } else { | 501 | } else { |
502 | setHasRecurrenceID( false ); | 502 | setHasRecurrenceID( false ); |
503 | recurrence()->unsetRecurs(); | 503 | recurrence()->unsetRecurs(); |
504 | } | 504 | } |
505 | return true; | 505 | return true; |
506 | } | 506 | } |
507 | void Todo::setPercentComplete(int v) | 507 | void Todo::setPercentComplete(int v) |
508 | { | 508 | { |
509 | if ( mHasRecurrenceID && v == 100 && mPercentComplete != 100 ) { | 509 | if ( mHasRecurrenceID && v == 100 && mPercentComplete != 100 ) { |
510 | if ( !setRecurDates() ) | 510 | if ( !setRecurDates() ) |
511 | v = 0; | 511 | v = 0; |
512 | } | 512 | } |
513 | mPercentComplete = v; | 513 | mPercentComplete = v; |
514 | if ( v != 100 ) | 514 | if ( v != 100 ) |
515 | mHasCompletedDate = false; | 515 | mHasCompletedDate = false; |
516 | updated(); | 516 | updated(); |
517 | } | 517 | } |
518 | QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const | 518 | QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const |
519 | { | 519 | { |
520 | if ( isCompleted() || ! hasDueDate() || cancelled() ) { | 520 | if ( isCompleted() || ! hasDueDate() || cancelled() ) { |
521 | *ok = false; | 521 | *ok = false; |
522 | return QDateTime (); | 522 | return QDateTime (); |
523 | } | 523 | } |
524 | QDateTime incidenceStart; | 524 | QDateTime incidenceStart; |
525 | incidenceStart = dtDue(); | 525 | incidenceStart = dtDue(); |
526 | bool enabled = false; | 526 | bool enabled = false; |
527 | Alarm* alarm; | 527 | Alarm* alarm; |
528 | int off = 0; | 528 | int off = 0; |
529 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 529 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
530 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 530 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
531 | // *ok = false; | 531 | // *ok = false; |
532 | // return incidenceStart; | 532 | // return incidenceStart; |
533 | // } | 533 | // } |
534 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 534 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
535 | if (alarm->enabled()) { | 535 | if (alarm->enabled()) { |
536 | if ( alarm->hasTime () ) { | 536 | if ( alarm->hasTime () ) { |
537 | if ( alarm->time() < alarmStart ) { | 537 | if ( alarm->time() < alarmStart ) { |
538 | alarmStart = alarm->time(); | 538 | alarmStart = alarm->time(); |
539 | enabled = true; | 539 | enabled = true; |
540 | off = alarmStart.secsTo( incidenceStart ); | 540 | off = alarmStart.secsTo( incidenceStart ); |
541 | } | 541 | } |
542 | 542 | ||
543 | } else { | 543 | } else { |
544 | int secs = alarm->startOffset().asSeconds(); | 544 | int secs = alarm->startOffset().asSeconds(); |
545 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { | 545 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { |
546 | alarmStart = incidenceStart.addSecs( secs ); | 546 | alarmStart = incidenceStart.addSecs( secs ); |
547 | enabled = true; | 547 | enabled = true; |
548 | off = -secs; | 548 | off = -secs; |
549 | } | 549 | } |
550 | } | 550 | } |
551 | } | 551 | } |
552 | } | 552 | } |
553 | if ( enabled ) { | 553 | if ( enabled ) { |
554 | if ( alarmStart > QDateTime::currentDateTime() ) { | 554 | if ( alarmStart > start_dt ) { |
555 | *ok = true; | 555 | *ok = true; |
556 | * offset = off; | 556 | * offset = off; |
557 | return alarmStart; | 557 | return alarmStart; |
558 | } | 558 | } |
559 | } | 559 | } |
560 | *ok = false; | 560 | *ok = false; |
561 | return QDateTime (); | 561 | return QDateTime (); |
562 | 562 | ||
563 | } | 563 | } |
564 | 564 | ||
565 | void Todo::checkSetCompletedFalse() | 565 | void Todo::checkSetCompletedFalse() |
566 | { | 566 | { |
567 | if ( !hasRecurrenceID() ) { | 567 | if ( !hasRecurrenceID() ) { |
568 | qDebug("ERROR 1 in Todo::checkSetCompletedFalse"); | 568 | qDebug("ERROR 1 in Todo::checkSetCompletedFalse"); |
569 | } | 569 | } |
570 | // qDebug("Todo::checkSetCompletedFalse()"); | 570 | // qDebug("Todo::checkSetCompletedFalse()"); |
571 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); | 571 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); |
572 | if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) { | 572 | if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) { |
573 | qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); | 573 | qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); |
574 | setCompleted( false ); | 574 | setCompleted( false ); |
575 | qDebug("Todo::checkSetCompletedFalse "); | 575 | qDebug("Todo::checkSetCompletedFalse "); |
576 | } | 576 | } |
577 | } | 577 | } |
diff --git a/libkcal/todo.h b/libkcal/todo.h index a5354ce..ab8fdf1 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h | |||
@@ -15,65 +15,65 @@ | |||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef TODO_H | 20 | #ifndef TODO_H |
21 | #define TODO_H | 21 | #define TODO_H |
22 | // | 22 | // |
23 | // Todo component, representing a VTODO object | 23 | // Todo component, representing a VTODO object |
24 | // | 24 | // |
25 | 25 | ||
26 | #include "incidence.h" | 26 | #include "incidence.h" |
27 | 27 | ||
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | 29 | ||
30 | namespace KCal { | 30 | namespace KCal { |
31 | 31 | ||
32 | /** | 32 | /** |
33 | This class provides a Todo in the sense of RFC2445. | 33 | This class provides a Todo in the sense of RFC2445. |
34 | */ | 34 | */ |
35 | class Todo : public QObject,public Incidence | 35 | class Todo : public QObject,public Incidence |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | Todo(); | 39 | Todo(); |
40 | Todo(const Todo &); | 40 | Todo(const Todo &); |
41 | ~Todo(); | 41 | ~Todo(); |
42 | typedef ListBase<Todo> List; | 42 | typedef ListBase<Todo> List; |
43 | QCString type() const { return "Todo"; } | 43 | QCString type() const { return "Todo"; } |
44 | 44 | ||
45 | /** Return an exact copy of this todo. */ | 45 | /** Return an exact copy of this todo. */ |
46 | Incidence *clone(); | 46 | Incidence *clone(); |
47 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; | 47 | QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const; |
48 | 48 | ||
49 | /** for setting the todo's due date/time with a QDateTime. */ | 49 | /** for setting the todo's due date/time with a QDateTime. */ |
50 | void setDtDue(const QDateTime &dtDue); | 50 | void setDtDue(const QDateTime &dtDue); |
51 | /** returns an event's Due date/time as a QDateTime. */ | 51 | /** returns an event's Due date/time as a QDateTime. */ |
52 | QDateTime dtDue() const; | 52 | QDateTime dtDue() const; |
53 | /** returns an event's due time as a string formatted according to the | 53 | /** returns an event's due time as a string formatted according to the |
54 | users locale settings */ | 54 | users locale settings */ |
55 | QString dtDueTimeStr() const; | 55 | QString dtDueTimeStr() const; |
56 | /** returns an event's due date as a string formatted according to the | 56 | /** returns an event's due date as a string formatted according to the |
57 | users locale settings */ | 57 | users locale settings */ |
58 | QString dtDueDateStr(bool shortfmt=true) const; | 58 | QString dtDueDateStr(bool shortfmt=true) const; |
59 | /** returns an event's due date and time as a string formatted according | 59 | /** returns an event's due date and time as a string formatted according |
60 | to the users locale settings */ | 60 | to the users locale settings */ |
61 | QString dtDueStr(bool shortfmt=true) const; | 61 | QString dtDueStr(bool shortfmt=true) const; |
62 | 62 | ||
63 | /** returns TRUE or FALSE depending on whether the todo has a due date */ | 63 | /** returns TRUE or FALSE depending on whether the todo has a due date */ |
64 | bool hasDueDate() const; | 64 | bool hasDueDate() const; |
65 | /** sets the event's hasDueDate value. */ | 65 | /** sets the event's hasDueDate value. */ |
66 | void setHasDueDate(bool f); | 66 | void setHasDueDate(bool f); |
67 | 67 | ||
68 | /* | 68 | /* |
69 | Looks for a subtodo (including itself ) which is not complete and is | 69 | Looks for a subtodo (including itself ) which is not complete and is |
70 | - overdue, or | 70 | - overdue, or |
71 | - due today. | 71 | - due today. |
72 | It returns 0 for nothing found, | 72 | It returns 0 for nothing found, |
73 | 1 for found a todo which is due today and no overdue found | 73 | 1 for found a todo which is due today and no overdue found |
74 | 2 for found a overdue todo | 74 | 2 for found a overdue todo |
75 | */ | 75 | */ |
76 | int hasDueSubTodo( bool checkSubtodos = true ); | 76 | int hasDueSubTodo( bool checkSubtodos = true ); |
77 | /* same as above, but a specific date can be specified*/ | 77 | /* same as above, but a specific date can be specified*/ |
78 | int hasDueSubTodoForDate( const QDate & date, bool checkSubtodos ); | 78 | int hasDueSubTodoForDate( const QDate & date, bool checkSubtodos ); |
79 | 79 | ||