summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-12-07 09:55:57 (UTC)
committer zautrix <zautrix>2004-12-07 09:55:57 (UTC)
commit17b25691f0332e648dd1d800e89ccf4e1da8955d (patch) (unidiff)
treeb7bc28e6c57c043fc49328a7ebd86e1b5cd0f17a
parentdcd2bbbc8d3064b35f268a831c567feaafea5fd8 (diff)
downloadkdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.zip
kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.tar.gz
kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.tar.bz2
some kopi usebility fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt13
-rw-r--r--korganizer/calendarview.cpp46
-rw-r--r--korganizer/calendarview.h3
-rw-r--r--korganizer/koagendaitem.cpp4
-rw-r--r--korganizer/komonthview.cpp10
-rw-r--r--korganizer/komonthview.h3
-rw-r--r--korganizer/koviewmanager.cpp3
-rw-r--r--korganizer/mainwindow.cpp7
-rw-r--r--libkcal/calendar.cpp11
-rw-r--r--libkcal/calendar.h3
-rw-r--r--libkcal/calendarlocal.cpp9
-rw-r--r--libkcal/incidence.cpp14
-rw-r--r--libkcal/incidence.h1
-rw-r--r--version2
14 files changed, 119 insertions, 10 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 5021212..46d59a3 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,50 +1,63 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 1.9.15 ************
4
5Usebilty enhancements in KO/Pi:
6When clicking on the date in a month view cell, the day view is shown.
7Old behaviour was, that the "new event" dialog popped up.
8
9Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
10That means, you can restore the latest
11event/todo/journal you have deleted.
12A journal is deleted, if you clear all the text of the journal.
13
14
15
3********** VERSION 1.9.14 ************ 16********** VERSION 1.9.14 ************
4 17
5Fixed some problems with the dialog sizes when switching 18Fixed some problems with the dialog sizes when switching
6portrait/landscape mode on 640x480 PDA display. 19portrait/landscape mode on 640x480 PDA display.
7 20
8Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 21Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
9 22
10Fixed an ugly bug in KOpieMail: 23Fixed an ugly bug in KOpieMail:
11KOpieMail was not able to write files (mails) to MSDOS file system, 24KOpieMail was not able to write files (mails) to MSDOS file system,
12like on an usual preformatted SD card. That should work now. 25like on an usual preformatted SD card. That should work now.
13To save your mail data on the Sd card do the following: 26To save your mail data on the Sd card do the following:
14Create a dir on the SD card: 27Create a dir on the SD card:
15mkdir /mnt/card/localmail 28mkdir /mnt/card/localmail
16Go to your home dir: 29Go to your home dir:
17cd 30cd
18Go to kopiemail data storage dir: 31Go to kopiemail data storage dir:
19cd kdepim/apps/kopiemail 32cd kdepim/apps/kopiemail
20Create a symlink to the SD card: 33Create a symlink to the SD card:
21ls -s /mnt/card/localmail 34ls -s /mnt/card/localmail
22Now KOpieMail will store all mails on the SD card. 35Now KOpieMail will store all mails on the SD card.
23 36
24KO/Pi Monthview: 37KO/Pi Monthview:
25Now "Go to Today" selects the current month from day 1-end, 38Now "Go to Today" selects the current month from day 1-end,
26not the current date + some days. 39not the current date + some days.
27I.e. "Go to Today" shows now always 40I.e. "Go to Today" shows now always
28the current month with first day of month in the first row. 41the current month with first day of month in the first row.
29 42
30Added missing German translation. 43Added missing German translation.
31 44
32Fixed icons of executeable on Wintendo. 45Fixed icons of executeable on Wintendo.
33 46
34Added a "Show next Mail" button to the OM/Pi 47Added a "Show next Mail" button to the OM/Pi
35mail viewer such that the mail below the current mail 48mail viewer such that the mail below the current mail
36in the mail list view of the current folder 49in the mail list view of the current folder
37can be read with a single click. 50can be read with a single click.
38 51
39 52
40********** VERSION 1.9.13 ************ 53********** VERSION 1.9.13 ************
41 54
42Fixed nasty PwM/Pi file reading bug, when 55Fixed nasty PwM/Pi file reading bug, when
43the used hash algo of file is different then the global 56the used hash algo of file is different then the global
44hash algo. 57hash algo.
45 58
46Added KA/Pi support for opie mailit mailapplication. 59Added KA/Pi support for opie mailit mailapplication.
47 60
48Fixed some bugs in OM/Pi. 61Fixed some bugs in OM/Pi.
49Now character conversion tables are available for the Zaurus 62Now character conversion tables are available for the Zaurus
50to make OM/Pi working properly. 63to make OM/Pi working properly.
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 543897a..15c5dd9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -446,96 +446,103 @@ void CalendarView::init()
446 446
447 mDateFrame = new QVBox(0,0,WType_Popup); 447 mDateFrame = new QVBox(0,0,WType_Popup);
448 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 448 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
449 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 449 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
450 mDateFrame->setLineWidth(3); 450 mDateFrame->setLineWidth(3);
451 mDateFrame->hide(); 451 mDateFrame->hide();
452 mDateFrame->setCaption( i18n( "Pick a date to display")); 452 mDateFrame->setCaption( i18n( "Pick a date to display"));
453 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 453 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
454 454
455 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 455 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
456 456
457 mEventEditor = mDialogManager->getEventEditor(); 457 mEventEditor = mDialogManager->getEventEditor();
458 mTodoEditor = mDialogManager->getTodoEditor(); 458 mTodoEditor = mDialogManager->getTodoEditor();
459 459
460 mFlagEditDescription = false; 460 mFlagEditDescription = false;
461 461
462 mSuspendTimer = new QTimer( this ); 462 mSuspendTimer = new QTimer( this );
463 mAlarmTimer = new QTimer( this ); 463 mAlarmTimer = new QTimer( this );
464 mRecheckAlarmTimer = new QTimer( this ); 464 mRecheckAlarmTimer = new QTimer( this );
465 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 465 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
466 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 466 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
467 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 467 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
468 mAlarmDialog = new AlarmDialog( this ); 468 mAlarmDialog = new AlarmDialog( this );
469 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 469 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
470 mAlarmDialog->setServerNotification( false ); 470 mAlarmDialog->setServerNotification( false );
471 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 471 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
472 472
473 473
474#ifndef DESKTOP_VERSION 474#ifndef DESKTOP_VERSION
475//US listen for arriving address resultsets 475//US listen for arriving address resultsets
476 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 476 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
477 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 477 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
478#endif 478#endif
479 479
480} 480}
481 481
482 482
483CalendarView::~CalendarView() 483CalendarView::~CalendarView()
484{ 484{
485 // kdDebug() << "~CalendarView()" << endl; 485 // kdDebug() << "~CalendarView()" << endl;
486 //qDebug("CalendarView::~CalendarView() "); 486 //qDebug("CalendarView::~CalendarView() ");
487 delete mDialogManager; 487 delete mDialogManager;
488 delete mViewManager; 488 delete mViewManager;
489 delete mStorage; 489 delete mStorage;
490 delete mDateFrame ; 490 delete mDateFrame ;
491 delete beamDialog; 491 delete beamDialog;
492 //kdDebug() << "~CalendarView() done" << endl; 492 //kdDebug() << "~CalendarView() done" << endl;
493} 493}
494
495void CalendarView::showDay( QDate d )
496{
497 dateNavigator()->selectDate( d );
498 mViewManager->showWeekView();
499 dateNavigator()->selectDate( d );
500}
494void CalendarView::timerAlarm() 501void CalendarView::timerAlarm()
495{ 502{
496 //qDebug("CalendarView::timerAlarm() "); 503 //qDebug("CalendarView::timerAlarm() ");
497 computeAlarm(mAlarmNotification ); 504 computeAlarm(mAlarmNotification );
498} 505}
499 506
500void CalendarView::suspendAlarm() 507void CalendarView::suspendAlarm()
501{ 508{
502 //qDebug(" CalendarView::suspendAlarm() "); 509 //qDebug(" CalendarView::suspendAlarm() ");
503 computeAlarm(mSuspendAlarmNotification ); 510 computeAlarm(mSuspendAlarmNotification );
504 511
505} 512}
506 513
507void CalendarView::startAlarm( QString mess , QString filename) 514void CalendarView::startAlarm( QString mess , QString filename)
508{ 515{
509 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 516 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
510 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); 517 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) );
511 518
512} 519}
513 520
514void CalendarView::checkNextTimerAlarm() 521void CalendarView::checkNextTimerAlarm()
515{ 522{
516 mCalendar->checkAlarmForIncidence( 0, true ); 523 mCalendar->checkAlarmForIncidence( 0, true );
517} 524}
518 525
519void CalendarView::computeAlarm( QString msg ) 526void CalendarView::computeAlarm( QString msg )
520{ 527{
521 528
522 QString mess = msg; 529 QString mess = msg;
523 QString mAlarmMessage = mess.mid( 9 ); 530 QString mAlarmMessage = mess.mid( 9 );
524 QString filename = MainWindow::resourcePath(); 531 QString filename = MainWindow::resourcePath();
525 filename += "koalarm.wav"; 532 filename += "koalarm.wav";
526 QString tempfilename; 533 QString tempfilename;
527 if ( mess.left( 13 ) == "suspend_alarm") { 534 if ( mess.left( 13 ) == "suspend_alarm") {
528 bool error = false; 535 bool error = false;
529 int len = mess.mid( 13 ).find("+++"); 536 int len = mess.mid( 13 ).find("+++");
530 if ( len < 2 ) 537 if ( len < 2 )
531 error = true; 538 error = true;
532 else { 539 else {
533 tempfilename = mess.mid( 13, len ); 540 tempfilename = mess.mid( 13, len );
534 if ( !QFile::exists( tempfilename ) ) 541 if ( !QFile::exists( tempfilename ) )
535 error = true; 542 error = true;
536 } 543 }
537 if ( ! error ) { 544 if ( ! error ) {
538 filename = tempfilename; 545 filename = tempfilename;
539 } 546 }
540 mAlarmMessage = mess.mid( 13+len+3 ); 547 mAlarmMessage = mess.mid( 13+len+3 );
541 //qDebug("suspend file %s ",tempfilename.latin1() ); 548 //qDebug("suspend file %s ",tempfilename.latin1() );
@@ -2164,116 +2171,130 @@ void CalendarView::edit_cut()
2164 } 2171 }
2165 } 2172 }
2166 2173
2167 if (!anEvent) { 2174 if (!anEvent) {
2168 KNotifyClient::beep(); 2175 KNotifyClient::beep();
2169 return; 2176 return;
2170 } 2177 }
2171 DndFactory factory( mCalendar ); 2178 DndFactory factory( mCalendar );
2172 factory.cutEvent(anEvent); 2179 factory.cutEvent(anEvent);
2173 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2180 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2174} 2181}
2175 2182
2176void CalendarView::edit_copy() 2183void CalendarView::edit_copy()
2177{ 2184{
2178 Event *anEvent=0; 2185 Event *anEvent=0;
2179 2186
2180 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2187 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2181 2188
2182 if (mViewManager->currentView()->isEventView()) { 2189 if (mViewManager->currentView()->isEventView()) {
2183 if ( incidence && incidence->type() == "Event" ) { 2190 if ( incidence && incidence->type() == "Event" ) {
2184 anEvent = static_cast<Event *>(incidence); 2191 anEvent = static_cast<Event *>(incidence);
2185 } 2192 }
2186 } 2193 }
2187 2194
2188 if (!anEvent) { 2195 if (!anEvent) {
2189 KNotifyClient::beep(); 2196 KNotifyClient::beep();
2190 return; 2197 return;
2191 } 2198 }
2192 DndFactory factory( mCalendar ); 2199 DndFactory factory( mCalendar );
2193 factory.copyEvent(anEvent); 2200 factory.copyEvent(anEvent);
2194} 2201}
2195 2202
2196void CalendarView::edit_paste() 2203void CalendarView::edit_paste()
2197{ 2204{
2198 QDate date = mNavigator->selectedDates().first(); 2205 QDate date = mNavigator->selectedDates().first();
2199 2206
2200 DndFactory factory( mCalendar ); 2207 DndFactory factory( mCalendar );
2201 Event *pastedEvent = factory.pasteEvent( date ); 2208 Event *pastedEvent = factory.pasteEvent( date );
2202 2209
2203 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2210 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2204} 2211}
2205 2212
2206void CalendarView::edit_options() 2213void CalendarView::edit_options()
2207{ 2214{
2208 mDialogManager->showOptionsDialog(); 2215 mDialogManager->showOptionsDialog();
2209 //writeSettings(); 2216 //writeSettings();
2210} 2217}
2211 2218
2219
2212void CalendarView::slotSelectPickerDate( QDate d) 2220void CalendarView::slotSelectPickerDate( QDate d)
2213{ 2221{
2214 mDateFrame->hide(); 2222 mDateFrame->hide();
2215 if ( mDatePickerMode == 1 ) { 2223 if ( mDatePickerMode == 1 ) {
2216 mNavigator->slotDaySelect( d ); 2224 mNavigator->slotDaySelect( d );
2217 } else if ( mDatePickerMode == 2 ) { 2225 } else if ( mDatePickerMode == 2 ) {
2218 if ( mMoveIncidence->type() == "Todo" ) { 2226 if ( mMoveIncidence->type() == "Todo" ) {
2219 Todo * to = (Todo *) mMoveIncidence; 2227 Todo * to = (Todo *) mMoveIncidence;
2220 QTime tim; 2228 QTime tim;
2221 if ( to->hasDueDate() ) 2229 if ( to->hasDueDate() )
2222 tim = to->dtDue().time(); 2230 tim = to->dtDue().time();
2223 else { 2231 else {
2224 tim = QTime ( 0,0,0 ); 2232 tim = QTime ( 0,0,0 );
2225 to->setFloats( true ); 2233 to->setFloats( true );
2226 to->setHasDueDate( true ); 2234 to->setHasDueDate( true );
2227 } 2235 }
2228 QDateTime dt ( d,tim ); 2236 QDateTime dt ( d,tim );
2229 to->setDtDue( dt ); 2237 to->setDtDue( dt );
2230 todoChanged( to ); 2238 todoChanged( to );
2231 } else { 2239 } else {
2240 if ( mMoveIncidence->doesRecur() ) {
2241#if 0
2242 // PENDING implement this
2243 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2244 mCalendar()->addIncidence( newInc );
2245 if ( mMoveIncidence->type() == "Todo" )
2246 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2247 else
2248 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2249 mMoveIncidence = newInc;
2250
2251#endif
2252 }
2232 QTime tim = mMoveIncidence->dtStart().time(); 2253 QTime tim = mMoveIncidence->dtStart().time();
2233 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2254 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2234 QDateTime dt ( d,tim ); 2255 QDateTime dt ( d,tim );
2235 mMoveIncidence->setDtStart( dt ); 2256 mMoveIncidence->setDtStart( dt );
2236 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2257 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2237 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2258 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2238 } 2259 }
2239 2260
2240 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2261 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2241 } 2262 }
2242} 2263}
2243 2264
2244void CalendarView::removeCategories() 2265void CalendarView::removeCategories()
2245{ 2266{
2246 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2267 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2247 QStringList catList = KOPrefs::instance()->mCustomCategories; 2268 QStringList catList = KOPrefs::instance()->mCustomCategories;
2248 QStringList catIncList; 2269 QStringList catIncList;
2249 QStringList newCatList; 2270 QStringList newCatList;
2250 Incidence* inc = incList.first(); 2271 Incidence* inc = incList.first();
2251 int i; 2272 int i;
2252 int count = 0; 2273 int count = 0;
2253 while ( inc ) { 2274 while ( inc ) {
2254 newCatList.clear(); 2275 newCatList.clear();
2255 catIncList = inc->categories() ; 2276 catIncList = inc->categories() ;
2256 for( i = 0; i< catIncList.count(); ++i ) { 2277 for( i = 0; i< catIncList.count(); ++i ) {
2257 if ( catList.contains (catIncList[i])) 2278 if ( catList.contains (catIncList[i]))
2258 newCatList.append( catIncList[i] ); 2279 newCatList.append( catIncList[i] );
2259 } 2280 }
2260 newCatList.sort(); 2281 newCatList.sort();
2261 inc->setCategories( newCatList.join(",") ); 2282 inc->setCategories( newCatList.join(",") );
2262 inc = incList.next(); 2283 inc = incList.next();
2263 } 2284 }
2264} 2285}
2265 2286
2266int CalendarView::addCategories() 2287int CalendarView::addCategories()
2267{ 2288{
2268 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2289 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2269 QStringList catList = KOPrefs::instance()->mCustomCategories; 2290 QStringList catList = KOPrefs::instance()->mCustomCategories;
2270 QStringList catIncList; 2291 QStringList catIncList;
2271 Incidence* inc = incList.first(); 2292 Incidence* inc = incList.first();
2272 int i; 2293 int i;
2273 int count = 0; 2294 int count = 0;
2274 while ( inc ) { 2295 while ( inc ) {
2275 catIncList = inc->categories() ; 2296 catIncList = inc->categories() ;
2276 for( i = 0; i< catIncList.count(); ++i ) { 2297 for( i = 0; i< catIncList.count(); ++i ) {
2277 if ( !catList.contains (catIncList[i])) { 2298 if ( !catList.contains (catIncList[i])) {
2278 catList.append( catIncList[i] ); 2299 catList.append( catIncList[i] );
2279 //qDebug("add cat %s ", catIncList[i].latin1()); 2300 //qDebug("add cat %s ", catIncList[i].latin1());
@@ -2381,96 +2402,98 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2381 storage.save(); 2402 storage.save();
2382 } 2403 }
2383 delete cal; 2404 delete cal;
2384 mes = i18n("KO/Pi: Ready for beaming"); 2405 mes = i18n("KO/Pi: Ready for beaming");
2385 topLevelWidget()->setCaption(mes); 2406 topLevelWidget()->setCaption(mes);
2386 KApplication::convert2latin1( fn ); 2407 KApplication::convert2latin1( fn );
2387#ifndef DESKTOP_VERSION 2408#ifndef DESKTOP_VERSION
2388 Ir *ir = new Ir( this ); 2409 Ir *ir = new Ir( this );
2389 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2410 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2390 ir->send( fn, description, "text/x-vCalendar" ); 2411 ir->send( fn, description, "text/x-vCalendar" );
2391#endif 2412#endif
2392 } 2413 }
2393} 2414}
2394void CalendarView::beamDone( Ir *ir ) 2415void CalendarView::beamDone( Ir *ir )
2395{ 2416{
2396#ifndef DESKTOP_VERSION 2417#ifndef DESKTOP_VERSION
2397 delete ir; 2418 delete ir;
2398#endif 2419#endif
2399 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2420 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2400 topLevelWidget()->raise(); 2421 topLevelWidget()->raise();
2401} 2422}
2402 2423
2403void CalendarView::moveIncidence(Incidence * inc ) 2424void CalendarView::moveIncidence(Incidence * inc )
2404{ 2425{
2405 if ( !inc ) return; 2426 if ( !inc ) return;
2406 // qDebug("showDatePickerForIncidence( ) "); 2427 // qDebug("showDatePickerForIncidence( ) ");
2407 if ( mDateFrame->isVisible() ) 2428 if ( mDateFrame->isVisible() )
2408 mDateFrame->hide(); 2429 mDateFrame->hide();
2409 else { 2430 else {
2410 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; 2431 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
2411 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; 2432 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
2412 int dw = QApplication::desktop()->width(); 2433 int dw = QApplication::desktop()->width();
2413 int dh = QApplication::desktop()->height(); 2434 int dh = QApplication::desktop()->height();
2414 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2435 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2415 mDateFrame->show(); 2436 mDateFrame->show();
2416 } 2437 }
2417 mDatePickerMode = 2; 2438 mDatePickerMode = 2;
2418 mMoveIncidence = inc ; 2439 mMoveIncidence = inc ;
2419 QDate da; 2440 QDate da;
2420 if ( mMoveIncidence->type() == "Todo" ) { 2441 if ( mMoveIncidence->type() == "Todo" ) {
2421 Todo * to = (Todo *) mMoveIncidence; 2442 Todo * to = (Todo *) mMoveIncidence;
2422 if ( to->hasDueDate() ) 2443 if ( to->hasDueDate() )
2423 da = to->dtDue().date(); 2444 da = to->dtDue().date();
2424 else 2445 else
2425 da = QDate::currentDate(); 2446 da = QDate::currentDate();
2426 } else { 2447 } else {
2427 da = mMoveIncidence->dtStart().date(); 2448 da = mMoveIncidence->dtStart().date();
2428 } 2449 }
2450 //PENDING set date for recurring incidence to date of recurrence
2451 //mMoveIncidenceOldDate;
2429 mDatePicker->setDate( da ); 2452 mDatePicker->setDate( da );
2430} 2453}
2431void CalendarView::showDatePicker( ) 2454void CalendarView::showDatePicker( )
2432{ 2455{
2433 //qDebug("CalendarView::showDatePicker( ) "); 2456 //qDebug("CalendarView::showDatePicker( ) ");
2434 if ( mDateFrame->isVisible() ) 2457 if ( mDateFrame->isVisible() )
2435 mDateFrame->hide(); 2458 mDateFrame->hide();
2436 else { 2459 else {
2437 int w =mDatePicker->sizeHint().width() ; 2460 int w =mDatePicker->sizeHint().width() ;
2438 int h = mDatePicker->sizeHint().height() ; 2461 int h = mDatePicker->sizeHint().height() ;
2439 int dw = QApplication::desktop()->width(); 2462 int dw = QApplication::desktop()->width();
2440 int dh = QApplication::desktop()->height(); 2463 int dh = QApplication::desktop()->height();
2441 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2464 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2442 mDateFrame->show(); 2465 mDateFrame->show();
2443 } 2466 }
2444 mDatePickerMode = 1; 2467 mDatePickerMode = 1;
2445 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2468 mDatePicker->setDate( mNavigator->selectedDates().first() );
2446} 2469}
2447 2470
2448void CalendarView::showEventEditor() 2471void CalendarView::showEventEditor()
2449{ 2472{
2450#ifdef DESKTOP_VERSION 2473#ifdef DESKTOP_VERSION
2451 mEventEditor->show(); 2474 mEventEditor->show();
2452#else 2475#else
2453 if ( mEventEditor->width() != QApplication::desktop()->width() ) { 2476 if ( mEventEditor->width() != QApplication::desktop()->width() ) {
2454 qDebug("CalendarView: recreate mEventEditor "); 2477 qDebug("CalendarView: recreate mEventEditor ");
2455 delete mEventEditor; 2478 delete mEventEditor;
2456 mEventEditor = mDialogManager->getEventEditor(); 2479 mEventEditor = mDialogManager->getEventEditor();
2457 } 2480 }
2458 mEventEditor->showMaximized(); 2481 mEventEditor->showMaximized();
2459#endif 2482#endif
2460} 2483}
2461void CalendarView::showTodoEditor() 2484void CalendarView::showTodoEditor()
2462{ 2485{
2463#ifdef DESKTOP_VERSION 2486#ifdef DESKTOP_VERSION
2464 mTodoEditor->show(); 2487 mTodoEditor->show();
2465#else 2488#else
2466 if ( mTodoEditor->width() != QApplication::desktop()->width() ) { 2489 if ( mTodoEditor->width() != QApplication::desktop()->width() ) {
2467 qDebug("CalendarView: recreate mTodoEditor "); 2490 qDebug("CalendarView: recreate mTodoEditor ");
2468 delete mTodoEditor; 2491 delete mTodoEditor;
2469 mTodoEditor = mDialogManager->getTodoEditor(); 2492 mTodoEditor = mDialogManager->getTodoEditor();
2470 } 2493 }
2471 mTodoEditor->showMaximized(); 2494 mTodoEditor->showMaximized();
2472#endif 2495#endif
2473} 2496}
2474 2497
2475void CalendarView::cloneIncidence() 2498void CalendarView::cloneIncidence()
2476{ 2499{
@@ -2839,146 +2862,146 @@ void CalendarView::deleteTodo(Todo *todo)
2839 break; 2862 break;
2840 } // switch 2863 } // switch
2841 } else { 2864 } else {
2842 if (!todo->relations().isEmpty()) { 2865 if (!todo->relations().isEmpty()) {
2843 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2866 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2844 i18n("Delete To-Do")); 2867 i18n("Delete To-Do"));
2845 } else { 2868 } else {
2846 checkExternalId( todo ); 2869 checkExternalId( todo );
2847 mCalendar->deleteTodo(todo); 2870 mCalendar->deleteTodo(todo);
2848 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2871 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2849 updateView(); 2872 updateView();
2850 } 2873 }
2851 } 2874 }
2852 emit updateSearchDialog(); 2875 emit updateSearchDialog();
2853} 2876}
2854void CalendarView::deleteJournal(Journal *jour) 2877void CalendarView::deleteJournal(Journal *jour)
2855{ 2878{
2856 if (!jour) { 2879 if (!jour) {
2857 KNotifyClient::beep(); 2880 KNotifyClient::beep();
2858 return; 2881 return;
2859 } 2882 }
2860 if (KOPrefs::instance()->mConfirm) { 2883 if (KOPrefs::instance()->mConfirm) {
2861 switch (msgItemDelete()) { 2884 switch (msgItemDelete()) {
2862 case KMessageBox::Continue: // OK 2885 case KMessageBox::Continue: // OK
2863 calendar()->deleteJournal(jour); 2886 calendar()->deleteJournal(jour);
2864 updateView(); 2887 updateView();
2865 break; 2888 break;
2866 } // switch 2889 } // switch
2867 } else { 2890 } else {
2868 calendar()->deleteJournal(jour);; 2891 calendar()->deleteJournal(jour);;
2869 updateView(); 2892 updateView();
2870 } 2893 }
2871 emit updateSearchDialog(); 2894 emit updateSearchDialog();
2872} 2895}
2873 2896
2874void CalendarView::deleteEvent(Event *anEvent) 2897void CalendarView::deleteEvent(Event *anEvent)
2875{ 2898{
2876 if (!anEvent) { 2899 if (!anEvent) {
2877 KNotifyClient::beep(); 2900 KNotifyClient::beep();
2878 return; 2901 return;
2879 } 2902 }
2880 2903
2881 if (anEvent->recurrence()->doesRecur()) { 2904 if (anEvent->recurrence()->doesRecur()) {
2882 QDate itemDate = mViewManager->currentSelectionDate(); 2905 QDate itemDate = mViewManager->currentSelectionDate();
2883 int km; 2906 int km;
2884 if (!itemDate.isValid()) { 2907 if (!itemDate.isValid()) {
2885 //kdDebug() << "Date Not Valid" << endl; 2908 //kdDebug() << "Date Not Valid" << endl;
2886 if (KOPrefs::instance()->mConfirm) { 2909 if (KOPrefs::instance()->mConfirm) {
2887 km = KMessageBox::warningContinueCancel(this,anEvent->summary() + 2910 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
2888 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 2911 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
2889 i18n("KO/Pi Confirmation"),i18n("Delete All")); 2912 i18n("KO/Pi Confirmation"),i18n("Delete All"));
2890 if ( km == KMessageBox::Continue ) 2913 if ( km == KMessageBox::Continue )
2891 km = KMessageBox::No; // No = all below 2914 km = KMessageBox::No; // No = all below
2892 } else 2915 } else
2893 km = KMessageBox::No; 2916 km = KMessageBox::No;
2894 } else { 2917 } else {
2895 km = KMessageBox::warningYesNoCancel(this,anEvent->summary() + 2918 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) +
2896 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 2919 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
2897 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 2920 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
2898 i18n("KO/Pi Confirmation"),i18n("Current"), 2921 i18n("KO/Pi Confirmation"),i18n("Current"),
2899 i18n("All")); 2922 i18n("All"));
2900 } 2923 }
2901 switch(km) { 2924 switch(km) {
2902 2925
2903 case KMessageBox::No: // Continue // all 2926 case KMessageBox::No: // Continue // all
2904 //qDebug("KMessageBox::No "); 2927 //qDebug("KMessageBox::No ");
2905 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2928 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2906 schedule(Scheduler::Cancel,anEvent); 2929 schedule(Scheduler::Cancel,anEvent);
2907 2930
2908 checkExternalId( anEvent); 2931 checkExternalId( anEvent);
2909 mCalendar->deleteEvent(anEvent); 2932 mCalendar->deleteEvent(anEvent);
2910 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); 2933 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
2911 break; 2934 break;
2912 2935
2913 // Disabled because it does not work 2936 // Disabled because it does not work
2914 //#if 0 2937 //#if 0
2915 case KMessageBox::Yes: // just this one 2938 case KMessageBox::Yes: // just this one
2916 //QDate qd = mNavigator->selectedDates().first(); 2939 //QDate qd = mNavigator->selectedDates().first();
2917 //if (!qd.isValid()) { 2940 //if (!qd.isValid()) {
2918 // kdDebug() << "no date selected, or invalid date" << endl; 2941 // kdDebug() << "no date selected, or invalid date" << endl;
2919 // KNotifyClient::beep(); 2942 // KNotifyClient::beep();
2920 // return; 2943 // return;
2921 //} 2944 //}
2922 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); 2945 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
2923 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { 2946 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
2924 anEvent->addExDate(itemDate); 2947 anEvent->addExDate(itemDate);
2925 int duration = anEvent->recurrence()->duration(); 2948 int duration = anEvent->recurrence()->duration();
2926 if ( duration > 0 ) { 2949 if ( duration > 0 ) {
2927 anEvent->recurrence()->setDuration( duration - 1 ); 2950 anEvent->recurrence()->setDuration( duration - 1 );
2928 } 2951 }
2929 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 2952 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
2930 } 2953 }
2931 break; 2954 break;
2932 //#endif 2955 //#endif
2933 } // switch 2956 } // switch
2934 } else { 2957 } else {
2935 if (KOPrefs::instance()->mConfirm) { 2958 if (KOPrefs::instance()->mConfirm) {
2936 switch (KMessageBox::warningContinueCancel(this,anEvent->summary() + 2959 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
2937 i18n("\nAre you sure you want\nto delete this event?"), 2960 i18n("\nAre you sure you want\nto delete this event?"),
2938 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 2961 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
2939 case KMessageBox::Continue: // OK 2962 case KMessageBox::Continue: // OK
2940 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2963 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2941 schedule(Scheduler::Cancel,anEvent); 2964 schedule(Scheduler::Cancel,anEvent);
2942 checkExternalId( anEvent); 2965 checkExternalId( anEvent);
2943 mCalendar->deleteEvent(anEvent); 2966 mCalendar->deleteEvent(anEvent);
2944 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2967 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2945 break; 2968 break;
2946 } // switch 2969 } // switch
2947 } else { 2970 } else {
2948 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 2971 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
2949 schedule(Scheduler::Cancel,anEvent); 2972 schedule(Scheduler::Cancel,anEvent);
2950 checkExternalId( anEvent); 2973 checkExternalId( anEvent);
2951 mCalendar->deleteEvent(anEvent); 2974 mCalendar->deleteEvent(anEvent);
2952 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2975 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2953 } 2976 }
2954 } // if-else 2977 } // if-else
2955 emit updateSearchDialog(); 2978 emit updateSearchDialog();
2956} 2979}
2957 2980
2958bool CalendarView::deleteEvent(const QString &uid) 2981bool CalendarView::deleteEvent(const QString &uid)
2959{ 2982{
2960 Event *ev = mCalendar->event(uid); 2983 Event *ev = mCalendar->event(uid);
2961 if (ev) { 2984 if (ev) {
2962 deleteEvent(ev); 2985 deleteEvent(ev);
2963 return true; 2986 return true;
2964 } else { 2987 } else {
2965 return false; 2988 return false;
2966 } 2989 }
2967} 2990}
2968 2991
2969/*****************************************************************************/ 2992/*****************************************************************************/
2970 2993
2971void CalendarView::action_mail() 2994void CalendarView::action_mail()
2972{ 2995{
2973#ifndef KORG_NOMAIL 2996#ifndef KORG_NOMAIL
2974 KOMailClient mailClient; 2997 KOMailClient mailClient;
2975 2998
2976 Incidence *incidence = currentSelection(); 2999 Incidence *incidence = currentSelection();
2977 3000
2978 if (!incidence) { 3001 if (!incidence) {
2979 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3002 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
2980 return; 3003 return;
2981 } 3004 }
2982 if(incidence->attendeeCount() == 0 ) { 3005 if(incidence->attendeeCount() == 0 ) {
2983 KMessageBox::sorry(this, 3006 KMessageBox::sorry(this,
2984 i18n("Can't generate mail:\nNo attendees defined.\n")); 3007 i18n("Can't generate mail:\nNo attendees defined.\n"));
@@ -3754,48 +3777,65 @@ void CalendarView::slotCalendarChanged()
3754 3777
3755NavigatorBar *CalendarView::navigatorBar() 3778NavigatorBar *CalendarView::navigatorBar()
3756{ 3779{
3757 return mNavigatorBar; 3780 return mNavigatorBar;
3758} 3781}
3759 3782
3760 3783
3761 3784
3762void CalendarView::keyPressEvent ( QKeyEvent *e) 3785void CalendarView::keyPressEvent ( QKeyEvent *e)
3763{ 3786{
3764 //qDebug(" alendarView::keyPressEvent "); 3787 //qDebug(" alendarView::keyPressEvent ");
3765 e->ignore(); 3788 e->ignore();
3766} 3789}
3767 3790
3768 3791
3769bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) 3792bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
3770{ 3793{
3771 // mSyncManager = manager; 3794 // mSyncManager = manager;
3772 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 3795 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
3773 qDebug("SyncKDE request detected!"); 3796 qDebug("SyncKDE request detected!");
3774 } 3797 }
3775 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3798 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
3776 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 3799 mCurrentSyncName = mSyncManager->getCurrentSyncName();
3777 return syncCalendar( filename, mode ); 3800 return syncCalendar( filename, mode );
3778} 3801}
3779bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 3802bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
3780{ 3803{
3781 //mSyncManager = manager; 3804 //mSyncManager = manager;
3782 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 3805 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
3783 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 3806 mCurrentSyncName = mSyncManager->getCurrentSyncName();
3784 if ( resource == "sharp" ) 3807 if ( resource == "sharp" )
3785 syncExternal( 0 ); 3808 syncExternal( 0 );
3786 if ( resource == "phone" ) 3809 if ( resource == "phone" )
3787 syncExternal( 1 ); 3810 syncExternal( 1 );
3788 // pending setmodified 3811 // pending setmodified
3789 return true; 3812 return true;
3790} 3813}
3791void CalendarView::setSyncManager(KSyncManager* manager) 3814void CalendarView::setSyncManager(KSyncManager* manager)
3792{ 3815{
3793 mSyncManager = manager; 3816 mSyncManager = manager;
3794} 3817}
3795 3818
3796void CalendarView::removeSyncInfo( QString syncProfile) 3819void CalendarView::removeSyncInfo( QString syncProfile)
3797{ 3820{
3798 qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); 3821 qDebug("removeSyncInfo for profile %s ", syncProfile.latin1());
3799 mCalendar->removeSyncInfo( syncProfile ); 3822 mCalendar->removeSyncInfo( syncProfile );
3800 3823
3801} 3824}
3825
3826void CalendarView::undo_delete()
3827{
3828 //qDebug("undo_delete() ");
3829 Incidence* undo = mCalendar->undoIncidence();
3830 if ( !undo ) {
3831 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
3832 i18n("KO/Pi"));
3833 return;
3834 }
3835 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) +
3836 i18n("\nAre you sure you want\nto restore this?"),
3837 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
3838 mCalendar->undoDeleteIncidence();
3839 updateView();
3840 }
3841}
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 437a51c..646973d 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -405,96 +405,98 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
405 405
406 /** Move to the next date(s) in the current view */ 406 /** Move to the next date(s) in the current view */
407 void goNext(); 407 void goNext();
408 408
409 /** Move to the previous date(s) in the current view */ 409 /** Move to the previous date(s) in the current view */
410 void goPrevious(); 410 void goPrevious();
411 /** Move to the next date(s) in the current view */ 411 /** Move to the next date(s) in the current view */
412 void goNextMonth(); 412 void goNextMonth();
413 413
414 /** Move to the previous date(s) in the current view */ 414 /** Move to the previous date(s) in the current view */
415 void goPreviousMonth(); 415 void goPreviousMonth();
416 416
417 void toggleExpand(); 417 void toggleExpand();
418 void toggleDateNavigatorWidget(); 418 void toggleDateNavigatorWidget();
419 void toggleAllDaySize(); 419 void toggleAllDaySize();
420 void dialogClosing(Incidence *); 420 void dialogClosing(Incidence *);
421 421
422 /** Look for new messages in the inbox */ 422 /** Look for new messages in the inbox */
423 void lookForIncomingMessages(); 423 void lookForIncomingMessages();
424 /** Look for new messages in the outbox */ 424 /** Look for new messages in the outbox */
425 void lookForOutgoingMessages(); 425 void lookForOutgoingMessages();
426 426
427 void processMainViewSelection( Incidence * ); 427 void processMainViewSelection( Incidence * );
428 void processTodoListSelection( Incidence * ); 428 void processTodoListSelection( Incidence * );
429 429
430 void processIncidenceSelection( Incidence * ); 430 void processIncidenceSelection( Incidence * );
431 431
432 void purgeCompleted(); 432 void purgeCompleted();
433 bool removeCompletedSubTodos( Todo* ); 433 bool removeCompletedSubTodos( Todo* );
434 void slotCalendarChanged(); 434 void slotCalendarChanged();
435 bool importBday(); 435 bool importBday();
436 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 436 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
437 bool importQtopia( const QString &categoriesFile, 437 bool importQtopia( const QString &categoriesFile,
438 const QString &datebookFile, 438 const QString &datebookFile,
439 const QString &tasklistFile ); 439 const QString &tasklistFile );
440 void syncExternal( int mode ); 440 void syncExternal( int mode );
441 void slotSelectPickerDate( QDate ) ; 441 void slotSelectPickerDate( QDate ) ;
442 void showDatePicker( ) ; 442 void showDatePicker( ) ;
443 void moveIncidence(Incidence *) ; 443 void moveIncidence(Incidence *) ;
444 void beamIncidence(Incidence *) ; 444 void beamIncidence(Incidence *) ;
445 void beamCalendar() ; 445 void beamCalendar() ;
446 void beamFilteredCalendar() ; 446 void beamFilteredCalendar() ;
447 void beamIncidenceList(QPtrList<Incidence>) ; 447 void beamIncidenceList(QPtrList<Incidence>) ;
448 void manageCategories(); 448 void manageCategories();
449 int addCategories(); 449 int addCategories();
450 void removeCategories(); 450 void removeCategories();
451 void setSyncDevice( QString ); 451 void setSyncDevice( QString );
452 void setSyncName( QString ); 452 void setSyncName( QString );
453 void showDay( QDate );
454 void undo_delete();
453 protected slots: 455 protected slots:
454 void timerAlarm(); 456 void timerAlarm();
455 void suspendAlarm(); 457 void suspendAlarm();
456 void beamDone( Ir *ir ); 458 void beamDone( Ir *ir );
457 /** Select a view or adapt the current view to display the specified dates. */ 459 /** Select a view or adapt the current view to display the specified dates. */
458 void showDates( const KCal::DateList & ); 460 void showDates( const KCal::DateList & );
459 void selectWeekNum ( int ); 461 void selectWeekNum ( int );
460 462
461 public: 463 public:
462 // show a standard warning 464 // show a standard warning
463 // returns KMsgBox::yesNoCancel() 465 // returns KMsgBox::yesNoCancel()
464 int msgCalModified(); 466 int msgCalModified();
465 virtual bool sync(KSyncManager* manager, QString filename, int mode); 467 virtual bool sync(KSyncManager* manager, QString filename, int mode);
466 468
467 virtual bool syncExternal(KSyncManager* manager, QString resource); 469 virtual bool syncExternal(KSyncManager* manager, QString resource);
468 virtual void removeSyncInfo( QString syncProfile); 470 virtual void removeSyncInfo( QString syncProfile);
469 void setSyncManager(KSyncManager* manager); 471 void setSyncManager(KSyncManager* manager);
470 void setLoadedFileVersion(QDateTime); 472 void setLoadedFileVersion(QDateTime);
471 bool checkFileVersion(QString fn); 473 bool checkFileVersion(QString fn);
472 bool checkFileChanged(QString fn); 474 bool checkFileChanged(QString fn);
473 Event* getLastSyncEvent(); 475 Event* getLastSyncEvent();
474 /** Adapt navigation units correpsonding to step size of navigation of the 476 /** Adapt navigation units correpsonding to step size of navigation of the
475 * current view. 477 * current view.
476 */ 478 */
477 void adaptNavigationUnits(); 479 void adaptNavigationUnits();
478 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); 480 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
479 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); 481 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
480 //Attendee* getYourAttendee(Event *event); 482 //Attendee* getYourAttendee(Event *event);
481 protected: 483 protected:
482 void schedule(Scheduler::Method, Incidence *incidence = 0); 484 void schedule(Scheduler::Method, Incidence *incidence = 0);
483 485
484 // returns KMsgBox::OKCandel() 486 // returns KMsgBox::OKCandel()
485 int msgItemDelete(); 487 int msgItemDelete();
486 void showEventEditor(); 488 void showEventEditor();
487 void showTodoEditor(); 489 void showTodoEditor();
488 void writeLocale(); 490 void writeLocale();
489 Todo *selectedTodo(); 491 Todo *selectedTodo();
490 492
491 private: 493 private:
492 KSyncManager* mSyncManager; 494 KSyncManager* mSyncManager;
493 AlarmDialog * mAlarmDialog; 495 AlarmDialog * mAlarmDialog;
494 QString mAlarmNotification; 496 QString mAlarmNotification;
495 QString mSuspendAlarmNotification; 497 QString mSuspendAlarmNotification;
496 QTimer* mSuspendTimer; 498 QTimer* mSuspendTimer;
497 QTimer* mAlarmTimer; 499 QTimer* mAlarmTimer;
498 QTimer* mRecheckAlarmTimer; 500 QTimer* mRecheckAlarmTimer;
499 void computeAlarm( QString ); 501 void computeAlarm( QString );
500 void startAlarm( QString, QString ); 502 void startAlarm( QString, QString );
@@ -509,96 +511,97 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
509 KOBeamPrefs* beamDialog; 511 KOBeamPrefs* beamDialog;
510 void init(); 512 void init();
511 int mDatePickerMode; 513 int mDatePickerMode;
512 bool mFlagEditDescription; 514 bool mFlagEditDescription;
513 QDateTime mLastCalendarSync; 515 QDateTime mLastCalendarSync;
514 void createPrinter(); 516 void createPrinter();
515 517
516 void calendarModified( bool, Calendar * ); 518 void calendarModified( bool, Calendar * );
517 519
518 CalPrinter *mCalPrinter; 520 CalPrinter *mCalPrinter;
519 521
520 QSplitter *mPanner; 522 QSplitter *mPanner;
521 QSplitter *mLeftSplitter; 523 QSplitter *mLeftSplitter;
522 QWidget *mLeftFrame; 524 QWidget *mLeftFrame;
523 QWidgetStack *mRightFrame; 525 QWidgetStack *mRightFrame;
524 526
525 KDatePicker* mDatePicker; 527 KDatePicker* mDatePicker;
526 QVBox* mDateFrame; 528 QVBox* mDateFrame;
527 NavigatorBar *mNavigatorBar; 529 NavigatorBar *mNavigatorBar;
528 530
529 KDateNavigator *mDateNavigator; // widget showing small month view. 531 KDateNavigator *mDateNavigator; // widget showing small month view.
530 532
531 KOFilterView *mFilterView; 533 KOFilterView *mFilterView;
532 534
533 ResourceView *mResourceView; 535 ResourceView *mResourceView;
534 536
535 // calendar object for this viewing instance 537 // calendar object for this viewing instance
536 Calendar *mCalendar; 538 Calendar *mCalendar;
537 539
538 CalendarResourceManager *mResourceManager; 540 CalendarResourceManager *mResourceManager;
539 541
540 FileStorage *mStorage; 542 FileStorage *mStorage;
541 543
542 DateNavigator *mNavigator; 544 DateNavigator *mNavigator;
543 545
544 KOViewManager *mViewManager; 546 KOViewManager *mViewManager;
545 KODialogManager *mDialogManager; 547 KODialogManager *mDialogManager;
546 548
547 // Calendar filters 549 // Calendar filters
548 QPtrList<CalFilter> mFilters; 550 QPtrList<CalFilter> mFilters;
549 551
550 // various housekeeping variables. 552 // various housekeeping variables.
551 bool mModified; // flag indicating if calendar is modified 553 bool mModified; // flag indicating if calendar is modified
552 bool mReadOnly; // flag indicating if calendar is read-only 554 bool mReadOnly; // flag indicating if calendar is read-only
553 QDate mSaveSingleDate; 555 QDate mSaveSingleDate;
554 556
555 Incidence *mSelectedIncidence; 557 Incidence *mSelectedIncidence;
556 Incidence *mMoveIncidence; 558 Incidence *mMoveIncidence;
559 QDate mMoveIncidenceOldDate;
557 KOTodoView *mTodoList; 560 KOTodoView *mTodoList;
558 KOEventEditor * mEventEditor; 561 KOEventEditor * mEventEditor;
559 KOTodoEditor * mTodoEditor; 562 KOTodoEditor * mTodoEditor;
560 KOEventViewerDialog * mEventViewerDialog; 563 KOEventViewerDialog * mEventViewerDialog;
561 void keyPressEvent ( QKeyEvent *e) ; 564 void keyPressEvent ( QKeyEvent *e) ;
562 //QMap<Incidence*,KOIncidenceEditor*> mDialogList; 565 //QMap<Incidence*,KOIncidenceEditor*> mDialogList;
563}; 566};
564 567
565 568
566class CalendarViewVisitor : public Incidence::Visitor 569class CalendarViewVisitor : public Incidence::Visitor
567{ 570{
568 public: 571 public:
569 CalendarViewVisitor() : mView( 0 ) {} 572 CalendarViewVisitor() : mView( 0 ) {}
570 573
571 bool act( Incidence *incidence, CalendarView *view ) 574 bool act( Incidence *incidence, CalendarView *view )
572 { 575 {
573 mView = view; 576 mView = view;
574 return incidence->accept( *this ); 577 return incidence->accept( *this );
575 } 578 }
576 579
577 protected: 580 protected:
578 CalendarView *mView; 581 CalendarView *mView;
579}; 582};
580 583
581class ShowIncidenceVisitor : public CalendarViewVisitor 584class ShowIncidenceVisitor : public CalendarViewVisitor
582{ 585{
583 protected: 586 protected:
584 bool visit( Event *event ) { mView->showEvent( event ); return true; } 587 bool visit( Event *event ) { mView->showEvent( event ); return true; }
585 bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } 588 bool visit( Todo *todo ) { mView->showTodo( todo ); return true; }
586 bool visit( Journal * j ) { mView->showJournal( j );return true; } 589 bool visit( Journal * j ) { mView->showJournal( j );return true; }
587}; 590};
588 591
589class EditIncidenceVisitor : public CalendarViewVisitor 592class EditIncidenceVisitor : public CalendarViewVisitor
590{ 593{
591 protected: 594 protected:
592 bool visit( Event *event ) { mView->editEvent( event ); return true; } 595 bool visit( Event *event ) { mView->editEvent( event ); return true; }
593 bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } 596 bool visit( Todo *todo ) { mView->editTodo( todo ); return true; }
594 bool visit( Journal *j ) { mView->editJournal( j); return true; } 597 bool visit( Journal *j ) { mView->editJournal( j); return true; }
595}; 598};
596 599
597class DeleteIncidenceVisitor : public CalendarViewVisitor 600class DeleteIncidenceVisitor : public CalendarViewVisitor
598{ 601{
599 protected: 602 protected:
600 bool visit( Event *event ) { mView->deleteEvent( event ); return true; } 603 bool visit( Event *event ) { mView->deleteEvent( event ); return true; }
601 bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } 604 bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; }
602 bool visit( Journal * j) {mView->deleteJournal( j ); return true; } 605 bool visit( Journal * j) {mView->deleteJournal( j ); return true; }
603}; 606};
604 607
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index f027343..46184ac 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -105,107 +105,109 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
105 setBackgroundColor( mBackgroundColor ); 105 setBackgroundColor( mBackgroundColor );
106 106
107 setCellXY(0,0,1); 107 setCellXY(0,0,1);
108 setCellXWidth(0); 108 setCellXWidth(0);
109 setSubCell(0); 109 setSubCell(0);
110 setSubCells(1); 110 setSubCells(1);
111 setMultiItem(0,0,0); 111 setMultiItem(0,0,0);
112 startMove(); 112 startMove();
113 mSelected = true; 113 mSelected = true;
114 select(false); 114 select(false);
115 QString tipText = mIncidence->summary(); 115 QString tipText = mIncidence->summary();
116 // QToolTip::add(this,tipText); 116 // QToolTip::add(this,tipText);
117 QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); 117 QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
118 if ( !mIncidence->doesFloat() ) 118 if ( !mIncidence->doesFloat() )
119 if ( mIncidence->type() == "Event" ) { 119 if ( mIncidence->type() == "Event" ) {
120 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { 120 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
121 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); 121 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
122 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); 122 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
123 } 123 }
124 else { 124 else {
125 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); 125 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr();
126 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); 126 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr();
127 } 127 }
128 } 128 }
129 else if ( mIncidence->type() == "Todo" ) { 129 else if ( mIncidence->type() == "Todo" ) {
130 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueTimeStr(); 130 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueTimeStr();
131 } 131 }
132 132
133 if (!mIncidence->location().isEmpty()) { 133 if (!mIncidence->location().isEmpty()) {
134 tipText += "\n"+i18n("Location: ")+mIncidence->location(); 134 tipText += "\n"+i18n("Location: ")+mIncidence->location();
135 } 135 }
136 QToolTip::add(this,tipText,toolTipGroup(),""); 136 QToolTip::add(this,tipText,toolTipGroup(),"");
137 QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); 137 QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont);
138 mFontPixelSize = fontinf.height();; 138 mFontPixelSize = fontinf.height();;
139 hide(); 139 hide();
140 xPaintCoord = -1; 140 xPaintCoord = -1;
141 yPaintCoord = -1; 141 yPaintCoord = -1;
142} 142}
143 143
144 144
145KOAgendaItem::~KOAgendaItem() 145KOAgendaItem::~KOAgendaItem()
146{ 146{
147 // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); 147 // qDebug("deleteKOAgendaItem::~KOAgendaItem( ");
148 148
149} 149}
150 150
151void KOAgendaItem::recreateIncidence() 151void KOAgendaItem::recreateIncidence()
152{ 152{
153#if 0
153 Incidence* newInc = mIncidence->clone(); 154 Incidence* newInc = mIncidence->clone();
154 newInc->recreate(); 155 newInc->recreate();
155 if ( mIncidence->doesRecur() ) { 156 if ( mIncidence->doesRecur() ) {
156 mIncidence->addExDate( mDate ); 157 mIncidence->addExDate( mDate );
157 newInc->recurrence()->unsetRecurs(); 158 newInc->recurrence()->unsetRecurs();
158 int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); 159 int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd());
159 QTime tim = mIncidence->dtStart().time(); 160 QTime tim = mIncidence->dtStart().time();
160 newInc->setDtStart( QDateTime(mDate, tim) ); 161 newInc->setDtStart( QDateTime(mDate, tim) );
161 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 162 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
162 } 163 }
163 mIncidence = newInc; 164#endif
165 mIncidence = mIncidence->recreateCloneException( mDate );
164} 166}
165bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) 167bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
166{ 168{
167 int size = AGENDA_ICON_SIZE; 169 int size = AGENDA_ICON_SIZE;
168 170
169 int yOff = 0; 171 int yOff = 0;
170 int xOff = 0; 172 int xOff = 0;
171 int x = pos().x() +3; 173 int x = pos().x() +3;
172 int y; 174 int y;
173 if ( mAllDay ) 175 if ( mAllDay )
174 y = pos().y()+3; 176 y = pos().y()+3;
175 else 177 else
176 y = mCellYTop * ( height() / cellHeight() ) +3; 178 y = mCellYTop * ( height() / cellHeight() ) +3;
177 if (mIncidence->cancelled()) { 179 if (mIncidence->cancelled()) {
178 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; 180 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
179 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; 181 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
180 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); 182 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
181 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); 183 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
182 if ( horLayout ) 184 if ( horLayout )
183 ++xOff; 185 ++xOff;
184 else 186 else
185 ++yOff; 187 ++yOff;
186 } 188 }
187 if (mIncidence->isAlarmEnabled()) { 189 if (mIncidence->isAlarmEnabled()) {
188 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); 190 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
189 if ( horLayout ) 191 if ( horLayout )
190 ++xOff; 192 ++xOff;
191 else 193 else
192 ++yOff; 194 ++yOff;
193 } 195 }
194 if (mIncidence->recurrence()->doesRecur()) { 196 if (mIncidence->recurrence()->doesRecur()) {
195 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); 197 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue );
196 if ( horLayout ) 198 if ( horLayout )
197 ++xOff; 199 ++xOff;
198 else 200 else
199 ++yOff; 201 ++yOff;
200 } 202 }
201 if (mIncidence->description().length() > 0) { 203 if (mIncidence->description().length() > 0) {
202 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); 204 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen );
203 if ( horLayout ) 205 if ( horLayout )
204 ++xOff; 206 ++xOff;
205 else 207 else
206 ++yOff; 208 ++yOff;
207 } 209 }
208 if (mIncidence->isReadOnly()) { 210 if (mIncidence->isReadOnly()) {
209 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); 211 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white );
210 if ( horLayout ) 212 if ( horLayout )
211 ++xOff; 213 ++xOff;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 7d1e82f..08232e2 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -236,98 +236,98 @@ int MonthViewItem::height(const QListBox *lb) const
236int MonthViewItem::width(const QListBox *lb) const 236int MonthViewItem::width(const QListBox *lb) const
237{ 237{
238 int size = PIXMAP_SIZE; 238 int size = PIXMAP_SIZE;
239 if ( QApplication::desktop()->width() < 300 ) 239 if ( QApplication::desktop()->width() < 300 )
240 size = 3; 240 size = 3;
241 int x = 1; 241 int x = 1;
242 if ( mInfo ) { 242 if ( mInfo ) {
243 x += size + 1; 243 x += size + 1;
244 } 244 }
245 if( mRecur ) { 245 if( mRecur ) {
246 x += size+1; 246 x += size+1;
247 } 247 }
248 if( mAlarm ) { 248 if( mAlarm ) {
249 x += size+1; 249 x += size+1;
250 } 250 }
251 if( mReply ) { 251 if( mReply ) {
252 x += size+1; 252 x += size+1;
253 } 253 }
254 254
255 return( x + lb->fontMetrics().width( text() ) + 1 ); 255 return( x + lb->fontMetrics().width( text() ) + 1 );
256} 256}
257 257
258 258
259MonthViewCell::MonthViewCell( KOMonthView *parent) 259MonthViewCell::MonthViewCell( KOMonthView *parent)
260 : QWidget( parent ), 260 : QWidget( parent ),
261 mMonthView( parent ) 261 mMonthView( parent )
262{ 262{
263 263
264 QVBoxLayout *topLayout = new QVBoxLayout( this ); 264 QVBoxLayout *topLayout = new QVBoxLayout( this );
265 265
266 // mLabel = new QLabel( this );QPushButton 266 // mLabel = new QLabel( this );QPushButton
267 mLabel = new QPushButton( this ); 267 mLabel = new QPushButton( this );
268 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); 268 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain );
269 //mLabel->setLineWidth( 1 ); 269 //mLabel->setLineWidth( 1 );
270 //mLabel->setAlignment( AlignCenter ); 270 //mLabel->setAlignment( AlignCenter );
271 mLabel->setFlat( true ); 271 mLabel->setFlat( true );
272 mItemList = new KNoScrollListBox( this ); 272 mItemList = new KNoScrollListBox( this );
273 mItemList->setMinimumSize( 10, 10 ); 273 mItemList->setMinimumSize( 10, 10 );
274 mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain ); 274 mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain );
275 mItemList->setLineWidth( 1 ); 275 mItemList->setLineWidth( 1 );
276 topLayout->addWidget( mItemList ); 276 topLayout->addWidget( mItemList );
277 mLabel->raise(); 277 mLabel->raise();
278 // QColor( 0,0,255 ) QColor( 160,1600,255 ) 278 // QColor( 0,0,255 ) QColor( 160,1600,255 )
279 mStandardPalette = palette(); 279 mStandardPalette = palette();
280 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); 280 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) );
281 281
282 enableScrollBars( false ); 282 enableScrollBars( false );
283 updateConfig(); 283 updateConfig();
284 connect( mLabel, SIGNAL( clicked( )), 284 //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() ));
285 SLOT( newEvent() )); 285 connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() ));
286 connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ), 286 connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ),
287 SLOT( defaultAction( QListBoxItem * ) ) ); 287 SLOT( defaultAction( QListBoxItem * ) ) );
288 connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *, 288 connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *,
289 const QPoint &) ), 289 const QPoint &) ),
290 SLOT( contextMenu( QListBoxItem * ) ) ); 290 SLOT( contextMenu( QListBoxItem * ) ) );
291 connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ), 291 connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ),
292 SLOT( selection( QListBoxItem * ) ) ); 292 SLOT( selection( QListBoxItem * ) ) );
293 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), 293 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ),
294 SLOT( cellClicked( QListBoxItem * ) ) ); 294 SLOT( cellClicked( QListBoxItem * ) ) );
295 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), 295 connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ),
296 SLOT( selection( QListBoxItem * ) ) ); 296 SLOT( selection( QListBoxItem * ) ) );
297} 297}
298 298
299void MonthViewCell::setDate( const QDate &date ) 299void MonthViewCell::setDate( const QDate &date )
300{ 300{
301// kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; 301// kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl;
302 302
303 mDate = date; 303 mDate = date;
304 304
305 QString text; 305 QString text;
306 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; 306 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
307 if ( KOGlobals::self()->calendarSystem()->day( date ) == 1 || (date.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { 307 if ( KOGlobals::self()->calendarSystem()->day( date ) == 1 || (date.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
308 text = KOGlobals::self()->calendarSystem()->monthName( date, true ) + " "; 308 text = KOGlobals::self()->calendarSystem()->monthName( date, true ) + " ";
309 mLabel->resize( mLabelBigSize ); 309 mLabel->resize( mLabelBigSize );
310 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 310 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
311 } else { 311 } else {
312 mLabel->resize( mLabelSize ); 312 mLabel->resize( mLabelSize );
313 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 313 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
314 } 314 }
315 mLabel->setText( text ); 315 mLabel->setText( text );
316 316
317 //resizeEvent( 0 ); 317 //resizeEvent( 0 );
318} 318}
319 319
320QDate MonthViewCell::date() const 320QDate MonthViewCell::date() const
321{ 321{
322 return mDate; 322 return mDate;
323} 323}
324 324
325void MonthViewCell::setPrimary( bool primary ) 325void MonthViewCell::setPrimary( bool primary )
326{ 326{
327 mPrimary = primary; 327 mPrimary = primary;
328 //setMyPalette(); 328 //setMyPalette();
329} 329}
330void MonthViewCell::setMyPalette() 330void MonthViewCell::setMyPalette()
331{ 331{
332 332
333 if ( mHoliday) { 333 if ( mHoliday) {
@@ -584,96 +584,100 @@ Incidence *MonthViewCell::selectedIncidence()
584 return item->incidence(); 584 return item->incidence();
585} 585}
586 586
587QDate MonthViewCell::selectedIncidenceDate() 587QDate MonthViewCell::selectedIncidenceDate()
588{ 588{
589 QDate qd; 589 QDate qd;
590 int index = mItemList->currentItem(); 590 int index = mItemList->currentItem();
591 if ( index < 0 ) return qd; 591 if ( index < 0 ) return qd;
592 592
593 MonthViewItem *item = 593 MonthViewItem *item =
594 static_cast<MonthViewItem *>( mItemList->item( index ) ); 594 static_cast<MonthViewItem *>( mItemList->item( index ) );
595 595
596 if ( !item ) return qd; 596 if ( !item ) return qd;
597 597
598 return item->incidenceDate(); 598 return item->incidenceDate();
599} 599}
600 600
601void MonthViewCell::deselect() 601void MonthViewCell::deselect()
602{ 602{
603 mItemList->clearSelection(); 603 mItemList->clearSelection();
604 enableScrollBars( false ); 604 enableScrollBars( false );
605 // updateCell(); 605 // updateCell();
606} 606}
607void MonthViewCell::select() 607void MonthViewCell::select()
608{ 608{
609 ;// updateCell(); 609 ;// updateCell();
610} 610}
611 611
612void MonthViewCell::resizeEvent ( QResizeEvent * ) 612void MonthViewCell::resizeEvent ( QResizeEvent * )
613{ 613{
614 int size = height() - mLabel->height(); 614 int size = height() - mLabel->height();
615 if ( size > 0 ) 615 if ( size > 0 )
616 mItemList->verticalScrollBar()->setMaximumHeight( size ); 616 mItemList->verticalScrollBar()->setMaximumHeight( size );
617 size = width() - mLabel->width(); 617 size = width() - mLabel->width();
618 if ( size > 0 ) 618 if ( size > 0 )
619 mItemList->horizontalScrollBar()->setMaximumWidth( size ); 619 mItemList->horizontalScrollBar()->setMaximumWidth( size );
620 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); 620 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() );
621 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 621 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
622} 622}
623 623
624void MonthViewCell::defaultAction( QListBoxItem *item ) 624void MonthViewCell::defaultAction( QListBoxItem *item )
625{ 625{
626 if ( !item ) return; 626 if ( !item ) return;
627 627
628 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 628 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
629 Incidence *incidence = eventItem->incidence(); 629 Incidence *incidence = eventItem->incidence();
630 if ( incidence ) mMonthView->defaultAction( incidence ); 630 if ( incidence ) mMonthView->defaultAction( incidence );
631} 631}
632void MonthViewCell::showDay()
633{
634 emit showDaySignal( date() );
635}
632void MonthViewCell::newEvent() 636void MonthViewCell::newEvent()
633{ 637{
634 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 638 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
635 emit newEventSignal( dt ); 639 emit newEventSignal( dt );
636} 640}
637void MonthViewCell::cellClicked( QListBoxItem *item ) 641void MonthViewCell::cellClicked( QListBoxItem *item )
638{ 642{
639 static QListBoxItem * lastClicked = 0; 643 static QListBoxItem * lastClicked = 0;
640 if ( item == 0 ) { 644 if ( item == 0 ) {
641 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 645 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
642 emit newEventSignal( dt ); 646 emit newEventSignal( dt );
643 return; 647 return;
644 } 648 }
645 /* 649 /*
646 if ( lastClicked ) 650 if ( lastClicked )
647 if ( ! item ) { 651 if ( ! item ) {
648 if ( lastClicked->listBox() != item->listBox() ) 652 if ( lastClicked->listBox() != item->listBox() )
649 lastClicked->listBox()->clearSelection(); 653 lastClicked->listBox()->clearSelection();
650 } 654 }
651 */ 655 */
652 656
653 mMonthView->setSelectedCell( this ); 657 mMonthView->setSelectedCell( this );
654 if( KOPrefs::instance()->mEnableMonthScroll ) enableScrollBars( true ); 658 if( KOPrefs::instance()->mEnableMonthScroll ) enableScrollBars( true );
655 select(); 659 select();
656} 660}
657 661
658void MonthViewCell::contextMenu( QListBoxItem *item ) 662void MonthViewCell::contextMenu( QListBoxItem *item )
659{ 663{
660 if ( !item ) return; 664 if ( !item ) return;
661 665
662 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 666 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
663 Incidence *incidence = eventItem->incidence(); 667 Incidence *incidence = eventItem->incidence();
664 if ( incidence ) mMonthView->showContextMenu( incidence ); 668 if ( incidence ) mMonthView->showContextMenu( incidence );
665} 669}
666 670
667void MonthViewCell::selection( QListBoxItem *item ) 671void MonthViewCell::selection( QListBoxItem *item )
668{ 672{
669 if ( !item ) return; 673 if ( !item ) return;
670 674
671 mMonthView->setSelectedCell( this ); 675 mMonthView->setSelectedCell( this );
672} 676}
673 677
674 678
675// ******************************************************************************* 679// *******************************************************************************
676// ******************************************************************************* 680// *******************************************************************************
677// ******************************************************************************* 681// *******************************************************************************
678 682
679 683
@@ -684,96 +688,98 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
684{ 688{
685 mCells.setAutoDelete( true ); 689 mCells.setAutoDelete( true );
686 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 690 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
687 // mDayLayout = new QGridLayout( this ); 691 // mDayLayout = new QGridLayout( this );
688 // create the day of the week labels (Sun, Mon, etc) and add them to 692 // create the day of the week labels (Sun, Mon, etc) and add them to
689 // the layout. 693 // the layout.
690 mDayLabels.resize( mDaysPerWeek ); 694 mDayLabels.resize( mDaysPerWeek );
691 QFont bfont = font(); 695 QFont bfont = font();
692 if ( QApplication::desktop()->width() < 650 ) { 696 if ( QApplication::desktop()->width() < 650 ) {
693 bfont.setPointSize( bfont.pointSize() - 2 ); 697 bfont.setPointSize( bfont.pointSize() - 2 );
694 } 698 }
695 bfont.setBold( true ); 699 bfont.setBold( true );
696 int i; 700 int i;
697 701
698 for( i = 0; i < mDaysPerWeek; i++ ) { 702 for( i = 0; i < mDaysPerWeek; i++ ) {
699 QLabel *label = new QLabel( this ); 703 QLabel *label = new QLabel( this );
700 label->setFont(bfont); 704 label->setFont(bfont);
701 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 705 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
702 label->setLineWidth(1); 706 label->setLineWidth(1);
703 label->setAlignment(AlignCenter); 707 label->setAlignment(AlignCenter);
704 mDayLabels.insert( i, label ); 708 mDayLabels.insert( i, label );
705 } 709 }
706 710
707 bfont.setBold( false ); 711 bfont.setBold( false );
708 mWeekLabels.resize( mNumWeeks+1 ); 712 mWeekLabels.resize( mNumWeeks+1 );
709 for( i = 0; i < mNumWeeks+1; i++ ) { 713 for( i = 0; i < mNumWeeks+1; i++ ) {
710 KOWeekButton *label = new KOWeekButton( this ); 714 KOWeekButton *label = new KOWeekButton( this );
711 label->setFont(bfont); 715 label->setFont(bfont);
712 connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) ); 716 connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) );
713 label->setFlat(true); 717 label->setFlat(true);
714 QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view")); 718 QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view"));
715 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 719 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
716 //label->setLineWidth(1); 720 //label->setLineWidth(1);
717 //label->setAlignment(AlignCenter); 721 //label->setAlignment(AlignCenter);
718 mWeekLabels.insert( i, label ); 722 mWeekLabels.insert( i, label );
719 } 723 }
720 mWeekLabels[mNumWeeks]->setText( i18n("W")); 724 mWeekLabels[mNumWeeks]->setText( i18n("W"));
721 int row, col; 725 int row, col;
722 mCells.resize( mNumCells ); 726 mCells.resize( mNumCells );
723 for( row = 0; row < mNumWeeks; ++row ) { 727 for( row = 0; row < mNumWeeks; ++row ) {
724 for( col = 0; col < mDaysPerWeek; ++col ) { 728 for( col = 0; col < mDaysPerWeek; ++col ) {
725 MonthViewCell *cell = new MonthViewCell( this ); 729 MonthViewCell *cell = new MonthViewCell( this );
726 mCells.insert( row * mDaysPerWeek + col, cell ); 730 mCells.insert( row * mDaysPerWeek + col, cell );
727 731
728 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 732 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
729 SLOT( defaultAction( Incidence * ) ) ); 733 SLOT( defaultAction( Incidence * ) ) );
730 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 734 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
731 SIGNAL( newEventSignal( QDateTime ) ) ); 735 SIGNAL( newEventSignal( QDateTime ) ) );
736 connect( cell, SIGNAL( showDaySignal( QDate ) ),
737 SIGNAL( showDaySignal( QDate ) ) );
732 } 738 }
733 } 739 }
734 740
735 mContextMenu = eventPopup(); 741 mContextMenu = eventPopup();
736 // updateConfig(); //useless here 742 // updateConfig(); //useless here
737 743
738 emit incidenceSelected( 0 ); 744 emit incidenceSelected( 0 );
739} 745}
740 746
741KOMonthView::~KOMonthView() 747KOMonthView::~KOMonthView()
742{ 748{
743 delete mContextMenu; 749 delete mContextMenu;
744} 750}
745 751
746int KOMonthView::maxDatesHint() 752int KOMonthView::maxDatesHint()
747{ 753{
748 return mNumCells; 754 return mNumCells;
749} 755}
750 756
751int KOMonthView::currentDateCount() 757int KOMonthView::currentDateCount()
752{ 758{
753 return mNumCells; 759 return mNumCells;
754} 760}
755 761
756QPtrList<Incidence> KOMonthView::selectedIncidences() 762QPtrList<Incidence> KOMonthView::selectedIncidences()
757{ 763{
758 QPtrList<Incidence> selected; 764 QPtrList<Incidence> selected;
759 765
760 if ( mSelectedCell ) { 766 if ( mSelectedCell ) {
761 Incidence *incidence = mSelectedCell->selectedIncidence(); 767 Incidence *incidence = mSelectedCell->selectedIncidence();
762 if ( incidence ) selected.append( incidence ); 768 if ( incidence ) selected.append( incidence );
763 } 769 }
764 770
765 return selected; 771 return selected;
766} 772}
767 773
768DateList KOMonthView::selectedDates() 774DateList KOMonthView::selectedDates()
769{ 775{
770 DateList selected; 776 DateList selected;
771 777
772 if ( mSelectedCell ) { 778 if ( mSelectedCell ) {
773 QDate qd = mSelectedCell->selectedIncidenceDate(); 779 QDate qd = mSelectedCell->selectedIncidenceDate();
774 if ( qd.isValid() ) selected.append( qd ); 780 if ( qd.isValid() ) selected.append( qd );
775 } 781 }
776 782
777 return selected; 783 return selected;
778} 784}
779 785
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index e94952f..5124057 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -98,156 +98,159 @@ class MonthViewItem: public QListBoxItem
98 virtual int height(const QListBox *) const; 98 virtual int height(const QListBox *) const;
99 virtual int width(const QListBox *) const; 99 virtual int width(const QListBox *) const;
100 100
101 private: 101 private:
102 bool mRecur; 102 bool mRecur;
103 bool mAlarm; 103 bool mAlarm;
104 bool mReply; 104 bool mReply;
105 bool mInfo; 105 bool mInfo;
106 106
107 QPalette mPalette; 107 QPalette mPalette;
108 QDate mDate; 108 QDate mDate;
109 109
110 Incidence *mIncidence; 110 Incidence *mIncidence;
111}; 111};
112 112
113 113
114class KOMonthView; 114class KOMonthView;
115 115
116class MonthViewCell : public QWidget 116class MonthViewCell : public QWidget
117{ 117{
118 Q_OBJECT 118 Q_OBJECT
119 public: 119 public:
120 MonthViewCell( KOMonthView * ); 120 MonthViewCell( KOMonthView * );
121 121
122 void setDate( const QDate & ); 122 void setDate( const QDate & );
123 QDate date() const; 123 QDate date() const;
124 124
125 void setPrimary( bool ); 125 void setPrimary( bool );
126 bool isPrimary() const; 126 bool isPrimary() const;
127 127
128 void setHoliday( bool ); 128 void setHoliday( bool );
129 void setHoliday( const QString & ); 129 void setHoliday( const QString & );
130 130
131 void updateCell(); 131 void updateCell();
132 132
133 void updateConfig(); 133 void updateConfig();
134 134
135 void enableScrollBars( bool ); 135 void enableScrollBars( bool );
136 136
137 Incidence *selectedIncidence(); 137 Incidence *selectedIncidence();
138 QDate selectedIncidenceDate(); 138 QDate selectedIncidenceDate();
139 139
140 void deselect(); 140 void deselect();
141 void select(); 141 void select();
142 142
143 signals: 143 signals:
144 void defaultAction( Incidence * ); 144 void defaultAction( Incidence * );
145 void newEventSignal( QDateTime ); 145 void newEventSignal( QDateTime );
146 void showDaySignal( QDate );
146 147
147 protected: 148 protected:
148 void resizeEvent( QResizeEvent * ); 149 void resizeEvent( QResizeEvent * );
149 150
150 protected slots: 151 protected slots:
151 void defaultAction( QListBoxItem * ); 152 void defaultAction( QListBoxItem * );
152 void contextMenu( QListBoxItem * ); 153 void contextMenu( QListBoxItem * );
153 void selection( QListBoxItem * ); 154 void selection( QListBoxItem * );
154 void cellClicked( QListBoxItem * ); 155 void cellClicked( QListBoxItem * );
155 void newEvent(); 156 void newEvent();
157 void showDay();
156 158
157 private: 159 private:
158 KOMonthView *mMonthView; 160 KOMonthView *mMonthView;
159 161
160 QDate mDate; 162 QDate mDate;
161 bool mPrimary; 163 bool mPrimary;
162 bool mHoliday; 164 bool mHoliday;
163 QString mHolidayString; 165 QString mHolidayString;
164 166
165 //QLabel *mLabel; 167 //QLabel *mLabel;
166 QPushButton *mLabel; 168 QPushButton *mLabel;
167 QListBox *mItemList; 169 QListBox *mItemList;
168 170
169 QSize mLabelSize; 171 QSize mLabelSize;
170 QSize mLabelBigSize; 172 QSize mLabelBigSize;
171 QPalette mHolidayPalette; 173 QPalette mHolidayPalette;
172 QPalette mStandardPalette; 174 QPalette mStandardPalette;
173 QPalette mPrimaryPalette; 175 QPalette mPrimaryPalette;
174 QPalette mNonPrimaryPalette; 176 QPalette mNonPrimaryPalette;
175 void setMyPalette(); 177 void setMyPalette();
176 QPalette getPalette (); 178 QPalette getPalette ();
177 void keyPressEvent ( QKeyEvent * ) ; 179 void keyPressEvent ( QKeyEvent * ) ;
178 180
179}; 181};
180 182
181 183
182class KOMonthView: public KOEventView 184class KOMonthView: public KOEventView
183{ 185{
184 Q_OBJECT 186 Q_OBJECT
185 public: 187 public:
186 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 188 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
187 ~KOMonthView(); 189 ~KOMonthView();
188 190
189 /** Returns maximum number of days supported by the komonthview */ 191 /** Returns maximum number of days supported by the komonthview */
190 virtual int maxDatesHint(); 192 virtual int maxDatesHint();
191 193
192 /** Returns number of currently shown dates. */ 194 /** Returns number of currently shown dates. */
193 virtual int currentDateCount(); 195 virtual int currentDateCount();
194 196
195 /** returns the currently selected events */ 197 /** returns the currently selected events */
196 virtual QPtrList<Incidence> selectedIncidences(); 198 virtual QPtrList<Incidence> selectedIncidences();
197 199
198 /** returns dates of the currently selected events */ 200 /** returns dates of the currently selected events */
199 virtual DateList selectedDates(); 201 virtual DateList selectedDates();
200 202
201 virtual void printPreview(CalPrinter *calPrinter, 203 virtual void printPreview(CalPrinter *calPrinter,
202 const QDate &, const QDate &); 204 const QDate &, const QDate &);
203 bool isMonthView() { return true; } 205 bool isMonthView() { return true; }
204 206
205 MonthViewCell * selectedCell(); 207 MonthViewCell * selectedCell();
206 public slots: 208 public slots:
207 virtual void updateView(); 209 virtual void updateView();
208 virtual void updateConfig(); 210 virtual void updateConfig();
209 virtual void showDates(const QDate &start, const QDate &end); 211 virtual void showDates(const QDate &start, const QDate &end);
210 virtual void showEvents(QPtrList<Event> eventList); 212 virtual void showEvents(QPtrList<Event> eventList);
211 213
212 void changeEventDisplay(Event *, int); 214 void changeEventDisplay(Event *, int);
213 215
214 void clearSelection(); 216 void clearSelection();
215 217
216 void showContextMenu( Incidence * ); 218 void showContextMenu( Incidence * );
217 219
218 void setSelectedCell( MonthViewCell * ); 220 void setSelectedCell( MonthViewCell * );
219 221
220 protected slots: 222 protected slots:
221 void processSelectionChange(); 223 void processSelectionChange();
222 signals: 224 signals:
223 void selectWeekNum ( int ); 225 void selectWeekNum ( int );
226 void showDaySignal( QDate );
224 protected: 227 protected:
225 void resizeEvent(QResizeEvent *); 228 void resizeEvent(QResizeEvent *);
226 void viewChanged(); 229 void viewChanged();
227 void updateDayLabels(); 230 void updateDayLabels();
228 231
229 private: 232 private:
230 int mDaysPerWeek; 233 int mDaysPerWeek;
231 int mNumWeeks; 234 int mNumWeeks;
232 int mNumCells; 235 int mNumCells;
233 bool mWeekStartsMonday; 236 bool mWeekStartsMonday;
234 bool mShowSatSunComp; 237 bool mShowSatSunComp;
235 void computeLayout(); 238 void computeLayout();
236 239
237 QPtrVector<MonthViewCell> mCells; 240 QPtrVector<MonthViewCell> mCells;
238 QPtrVector<QLabel> mDayLabels; 241 QPtrVector<QLabel> mDayLabels;
239 QPtrVector<KOWeekButton> mWeekLabels; 242 QPtrVector<KOWeekButton> mWeekLabels;
240 243
241 bool mShortDayLabels; 244 bool mShortDayLabels;
242 int mWidthLongDayLabel; 245 int mWidthLongDayLabel;
243 246
244 QDate mStartDate; 247 QDate mStartDate;
245 248
246 MonthViewCell *mSelectedCell; 249 MonthViewCell *mSelectedCell;
247 250
248 KOEventPopupMenu *mContextMenu; 251 KOEventPopupMenu *mContextMenu;
249 void keyPressEvent ( QKeyEvent * ) ; 252 void keyPressEvent ( QKeyEvent * ) ;
250 253
251}; 254};
252 255
253#endif 256#endif
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 391f98c..6e151f9 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -1,82 +1,83 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2001 4 Copyright (c) 2001
5 Cornelius Schumacher <schumacher@kde.org> 5 Cornelius Schumacher <schumacher@kde.org>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <qwidgetstack.h> 26#include <qwidgetstack.h>
27 27
28#include <kconfig.h> 28#include <kconfig.h>
29#include <kglobal.h> 29#include <kglobal.h>
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#else 32#else
33#include <qapplication.h> 33#include <qapplication.h>
34#endif 34#endif
35#include <qdatetime.h>
35#include "calendarview.h" 36#include "calendarview.h"
36#include "datenavigator.h" 37#include "datenavigator.h"
37#include "kotodoview.h" 38#include "kotodoview.h"
38#include "koagendaview.h" 39#include "koagendaview.h"
39#include "kodialogmanager.h" 40#include "kodialogmanager.h"
40#include "komonthview.h" 41#include "komonthview.h"
41#include "kolistview.h" 42#include "kolistview.h"
42#include "kowhatsnextview.h" 43#include "kowhatsnextview.h"
43#include "kojournalview.h" 44#include "kojournalview.h"
44#include "kotimespanview.h" 45#include "kotimespanview.h"
45#include "koprefs.h" 46#include "koprefs.h"
46#include "navigatorbar.h" 47#include "navigatorbar.h"
47 48
48#include "koviewmanager.h" 49#include "koviewmanager.h"
49//extern bool externFlagMonthviewBlockPainting; 50//extern bool externFlagMonthviewBlockPainting;
50 51
51//bool globalFlagBlockPainting = false; 52//bool globalFlagBlockPainting = false;
52int globalFlagBlockAgenda = 0; 53int globalFlagBlockAgenda = 0;
53int globalFlagBlockLabel = 0; 54int globalFlagBlockLabel = 0;
54int globalFlagBlockAgendaItemPaint = 1; 55int globalFlagBlockAgendaItemPaint = 1;
55int globalFlagBlockAgendaItemUpdate = 1; 56int globalFlagBlockAgendaItemUpdate = 1;
56 57
57 58
58KOViewManager::KOViewManager( CalendarView *mainView ) : 59KOViewManager::KOViewManager( CalendarView *mainView ) :
59 QObject(), mMainView( mainView ) 60 QObject(), mMainView( mainView )
60{ 61{
61 mCurrentView = 0; 62 mCurrentView = 0;
62 63
63 mWhatsNextView = 0; 64 mWhatsNextView = 0;
64 mTodoView = 0; 65 mTodoView = 0;
65 mAgendaView = 0; 66 mAgendaView = 0;
66 mMonthView = 0; 67 mMonthView = 0;
67 mListView = 0; 68 mListView = 0;
68 mJournalView = 0; 69 mJournalView = 0;
69 mTimeSpanView = 0; 70 mTimeSpanView = 0;
70 mCurrentAgendaView = 0 ; 71 mCurrentAgendaView = 0 ;
71 mFlagShowNextxDays = false; 72 mFlagShowNextxDays = false;
72} 73}
73 74
74KOViewManager::~KOViewManager() 75KOViewManager::~KOViewManager()
75{ 76{
76} 77}
77 78
78 79
79KOrg::BaseView *KOViewManager::currentView() 80KOrg::BaseView *KOViewManager::currentView()
80{ 81{
81 return mCurrentView; 82 return mCurrentView;
82} 83}
@@ -399,96 +400,98 @@ void KOViewManager::showWeekView()
399void KOViewManager::showNextXView() 400void KOViewManager::showNextXView()
400{ 401{
401 402
402 globalFlagBlockAgenda = 1; 403 globalFlagBlockAgenda = 1;
403 if ( mCurrentAgendaView != 3 ) 404 if ( mCurrentAgendaView != 3 )
404 mCurrentAgendaView = -1; 405 mCurrentAgendaView = -1;
405 showAgendaView(KOPrefs::instance()->mFullViewMonth); 406 showAgendaView(KOPrefs::instance()->mFullViewMonth);
406 globalFlagBlockAgenda = 2; 407 globalFlagBlockAgenda = 2;
407 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 408 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
408 KOPrefs::instance()->mNextXDays ); 409 KOPrefs::instance()->mNextXDays );
409 mFlagShowNextxDays = true; 410 mFlagShowNextxDays = true;
410 mCurrentAgendaView = 3 ; 411 mCurrentAgendaView = 3 ;
411} 412}
412bool KOViewManager::showsNextDays() 413bool KOViewManager::showsNextDays()
413{ 414{
414 return mFlagShowNextxDays; 415 return mFlagShowNextxDays;
415} 416}
416void KOViewManager::showMonthView() 417void KOViewManager::showMonthView()
417{ 418{
418 if (!mMonthView) { 419 if (!mMonthView) {
419 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 420 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
420 421
421 addView(mMonthView); 422 addView(mMonthView);
422 // mMonthView->show(); 423 // mMonthView->show();
423 // SIGNALS/SLOTS FOR MONTH VIEW 424 // SIGNALS/SLOTS FOR MONTH VIEW
424 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 425 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
425 mMainView, SLOT(newEvent(QDateTime))); 426 mMainView, SLOT(newEvent(QDateTime)));
426 427
427 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 428 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
428 mMainView, SLOT(showIncidence(Incidence *))); 429 mMainView, SLOT(showIncidence(Incidence *)));
429 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 430 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
430 mMainView, SLOT(editIncidence(Incidence *))); 431 mMainView, SLOT(editIncidence(Incidence *)));
431 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 432 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
432 mMainView, SLOT(deleteIncidence(Incidence *))); 433 mMainView, SLOT(deleteIncidence(Incidence *)));
433 434
434 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 435 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
435 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 436 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
436 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 437 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
437 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 438 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
438 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 439 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
439 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 440 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
440 441
441 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 442 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
442 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 443 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
443 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 444 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
444 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 445 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
445 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 446 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
446 mMainView, SLOT ( selectWeekNum( int ) ) ); 447 mMainView, SLOT ( selectWeekNum( int ) ) );
448 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
449 mMainView, SLOT ( showDay( QDate ) ) );
447 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 450 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
448 mMonthView->updateConfig(); 451 mMonthView->updateConfig();
449 } 452 }
450 453
451 globalFlagBlockAgenda = 1; 454 globalFlagBlockAgenda = 1;
452 //mFlagShowNextxDays = false; 455 //mFlagShowNextxDays = false;
453 // if(mMonthView == mCurrentView) return; 456 // if(mMonthView == mCurrentView) return;
454 mMainView->dateNavigator()->selectMonth(); 457 mMainView->dateNavigator()->selectMonth();
455 // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); 458 // DateList tmpList = mMainView->dateNavigator()->selectedDates( );
456 //mMonthView->showDates(tmpList.first(), tmpList.last()); 459 //mMonthView->showDates(tmpList.first(), tmpList.last());
457 460
458 showView(mMonthView, true ); 461 showView(mMonthView, true );
459 462
460} 463}
461 464
462void KOViewManager::showTodoView() 465void KOViewManager::showTodoView()
463{ 466{
464 //mFlagShowNextxDays = false; 467 //mFlagShowNextxDays = false;
465 if ( !mTodoView ) { 468 if ( !mTodoView ) {
466 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 469 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
467 "KOViewManager::TodoView" ); 470 "KOViewManager::TodoView" );
468 471
469 addView( mTodoView ); 472 addView( mTodoView );
470 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 473 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
471 474
472 // SIGNALS/SLOTS FOR TODO VIEW 475 // SIGNALS/SLOTS FOR TODO VIEW
473 connect( mTodoView, SIGNAL( newTodoSignal() ), 476 connect( mTodoView, SIGNAL( newTodoSignal() ),
474 mMainView, SLOT( newTodo() ) ); 477 mMainView, SLOT( newTodo() ) );
475 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 478 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
476 mMainView, SLOT( newSubTodo( Todo *) ) ); 479 mMainView, SLOT( newSubTodo( Todo *) ) );
477 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 480 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
478 mMainView, SLOT( showTodo( Todo * ) ) ); 481 mMainView, SLOT( showTodo( Todo * ) ) );
479 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 482 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
480 mMainView, SLOT( editTodo( Todo * ) ) ); 483 mMainView, SLOT( editTodo( Todo * ) ) );
481 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 484 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
482 mMainView, SLOT( deleteTodo( Todo * ) ) ); 485 mMainView, SLOT( deleteTodo( Todo * ) ) );
483 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 486 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
484 mMainView, SLOT( purgeCompleted() ) ); 487 mMainView, SLOT( purgeCompleted() ) );
485 488
486 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 489 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
487 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 490 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
488 491
489 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 492 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
490 SLOT( updateConfig() ) ); 493 SLOT( updateConfig() ) );
491 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, 494 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
492 SLOT( updateTodo( Todo *, int ) ) ); 495 SLOT( updateTodo( Todo *, int ) ) );
493 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), 496 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
494 mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); 497 mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 46ae6a0..a652c05 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -531,96 +531,103 @@ void MainWindow::initActions()
531 menuBar1 = new QPEMenuBar( iconToolBar ); 531 menuBar1 = new QPEMenuBar( iconToolBar );
532 QPopupMenu *menuBar = new QPopupMenu( this ); 532 QPopupMenu *menuBar = new QPopupMenu( this );
533 menuBar1->insertItem( i18n("ME"), menuBar); 533 menuBar1->insertItem( i18n("ME"), menuBar);
534 menuBar->insertItem( i18n("File"), importMenu ); 534 menuBar->insertItem( i18n("File"), importMenu );
535 menuBar->insertItem( i18n("View"), viewMenu ); 535 menuBar->insertItem( i18n("View"), viewMenu );
536 menuBar->insertItem( i18n("Actions"), actionMenu ); 536 menuBar->insertItem( i18n("Actions"), actionMenu );
537 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 537 menuBar->insertItem( i18n("Synchronize"), syncMenu );
538 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 538 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
539 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 539 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
540 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 540 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
541 menuBar->insertItem( i18n("Help"), helpMenu ); 541 menuBar->insertItem( i18n("Help"), helpMenu );
542 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 542 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
543 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 543 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
544 } 544 }
545 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 545 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
546 connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); 546 connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) );
547 547
548 // ****************** 548 // ******************
549 QAction *action; 549 QAction *action;
550 QIconSet icon; 550 QIconSet icon;
551 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 551 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
552 configureToolBarMenu->setCheckable( true ); 552 configureToolBarMenu->setCheckable( true );
553 553
554 QString pathString = ""; 554 QString pathString = "";
555 if ( !p->mToolBarMiniIcons ) { 555 if ( !p->mToolBarMiniIcons ) {
556 if ( QApplication::desktop()->width() < 480 ) 556 if ( QApplication::desktop()->width() < 480 )
557 pathString += "icons16/"; 557 pathString += "icons16/";
558 } else 558 } else
559 pathString += "iconsmini/"; 559 pathString += "iconsmini/";
560 configureAgendaMenu->setCheckable( true ); 560 configureAgendaMenu->setCheckable( true );
561 configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); 561 configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 );
562 configureAgendaMenu->insertSeparator(); 562 configureAgendaMenu->insertSeparator();
563 configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); 563 configureAgendaMenu->insertItem(i18n("Tiny"), 4 );
564 configureAgendaMenu->insertItem(i18n("Small"), 6 ); 564 configureAgendaMenu->insertItem(i18n("Small"), 6 );
565 configureAgendaMenu->insertItem(i18n("Medium"), 8 ); 565 configureAgendaMenu->insertItem(i18n("Medium"), 8 );
566 configureAgendaMenu->insertItem(i18n("Normal"), 10 ); 566 configureAgendaMenu->insertItem(i18n("Normal"), 10 );
567 configureAgendaMenu->insertItem(i18n("Large"), 12 ); 567 configureAgendaMenu->insertItem(i18n("Large"), 12 );
568 configureAgendaMenu->insertItem(i18n("Big"), 14 ); 568 configureAgendaMenu->insertItem(i18n("Big"), 14 );
569 configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); 569 configureAgendaMenu->insertItem(i18n("Bigger"), 16 );
570 configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); 570 configureAgendaMenu->insertItem(i18n("Biggest"), 18 );
571 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 571 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
572 572
573 icon = loadPixmap( pathString + "configure" ); 573 icon = loadPixmap( pathString + "configure" );
574 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); 574 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
575 action->addTo( actionMenu ); 575 action->addTo( actionMenu );
576 connect( action, SIGNAL( activated() ), 576 connect( action, SIGNAL( activated() ),
577 mView, SLOT( edit_options() ) ); 577 mView, SLOT( edit_options() ) );
578 actionMenu->insertSeparator(); 578 actionMenu->insertSeparator();
579
580 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
581 action->addTo( actionMenu );
582 connect( action, SIGNAL( activated() ),
583 mView, SLOT( undo_delete() ) );
584 actionMenu->insertSeparator();
585
579 icon = loadPixmap( pathString + "newevent" ); 586 icon = loadPixmap( pathString + "newevent" );
580 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 587 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
581 configureToolBarMenu->insertSeparator(); 588 configureToolBarMenu->insertSeparator();
582 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 589 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
583 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 590 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
584 ne_action->addTo( actionMenu ); 591 ne_action->addTo( actionMenu );
585 connect( ne_action, SIGNAL( activated() ), 592 connect( ne_action, SIGNAL( activated() ),
586 mView, SLOT( newEvent() ) ); 593 mView, SLOT( newEvent() ) );
587 icon = loadPixmap( pathString + "newtodo" ); 594 icon = loadPixmap( pathString + "newtodo" );
588 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 595 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
589 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 596 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
590 nt_action->addTo( actionMenu ); 597 nt_action->addTo( actionMenu );
591 connect( nt_action, SIGNAL( activated() ), 598 connect( nt_action, SIGNAL( activated() ),
592 mView, SLOT( newTodo() ) ); 599 mView, SLOT( newTodo() ) );
593 icon = loadPixmap( pathString + "navi" ); 600 icon = loadPixmap( pathString + "navi" );
594 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 601 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
595 action->addTo( viewMenu ); 602 action->addTo( viewMenu );
596 connect( action, SIGNAL( activated() ), 603 connect( action, SIGNAL( activated() ),
597 mView, SLOT( toggleDateNavigatorWidget() ) ); 604 mView, SLOT( toggleDateNavigatorWidget() ) );
598 icon = loadPixmap( pathString + "filter" ); 605 icon = loadPixmap( pathString + "filter" );
599 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 606 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
600 action->addTo( viewMenu ); 607 action->addTo( viewMenu );
601 connect( action, SIGNAL( activated() ), 608 connect( action, SIGNAL( activated() ),
602 mView, SLOT( toggleFilter() ) ); 609 mView, SLOT( toggleFilter() ) );
603 610
604 611
605 viewMenu->insertSeparator(); 612 viewMenu->insertSeparator();
606 icon = loadPixmap( pathString + "picker" ); 613 icon = loadPixmap( pathString + "picker" );
607 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 614 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
608 action->addTo( viewMenu ); 615 action->addTo( viewMenu );
609 connect( action, SIGNAL( activated() ), 616 connect( action, SIGNAL( activated() ),
610 mView, SLOT( showDatePicker() ) ); 617 mView, SLOT( showDatePicker() ) );
611 action->addTo( iconToolBar ); 618 action->addTo( iconToolBar );
612 viewMenu->insertSeparator(); 619 viewMenu->insertSeparator();
613 icon = loadPixmap( pathString + "list" ); 620 icon = loadPixmap( pathString + "list" );
614 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 621 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
615 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 622 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
616 showlist_action->addTo( viewMenu ); 623 showlist_action->addTo( viewMenu );
617 connect( showlist_action, SIGNAL( activated() ), 624 connect( showlist_action, SIGNAL( activated() ),
618 mView->viewManager(), SLOT( showListView() ) ); 625 mView->viewManager(), SLOT( showListView() ) );
619 626
620 627
621 icon = loadPixmap( pathString + "day" ); 628 icon = loadPixmap( pathString + "day" );
622 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 629 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
623 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 630 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
624 day1_action->addTo( viewMenu ); 631 day1_action->addTo( viewMenu );
625 // action->addTo( toolBar ); 632 // action->addTo( toolBar );
626 connect( day1_action, SIGNAL( activated() ), 633 connect( day1_action, SIGNAL( activated() ),
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 52daaaa..88351eb 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -7,160 +7,169 @@
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <stdlib.h> 22#include <stdlib.h>
23#include <time.h> 23#include <time.h>
24 24
25#include <kdebug.h> 25#include <kdebug.h>
26#include <kglobal.h> 26#include <kglobal.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29#include "exceptions.h" 29#include "exceptions.h"
30#include "calfilter.h" 30#include "calfilter.h"
31 31
32#include "calendar.h" 32#include "calendar.h"
33#include "syncdefines.h" 33#include "syncdefines.h"
34 34
35using namespace KCal; 35using namespace KCal;
36 36
37Calendar::Calendar() 37Calendar::Calendar()
38{ 38{
39 39
40 init(); 40 init();
41 setTimeZoneId( i18n (" 00:00 Europe/London(UTC)") ); 41 setTimeZoneId( i18n (" 00:00 Europe/London(UTC)") );
42} 42}
43 43
44Calendar::Calendar( const QString &timeZoneId ) 44Calendar::Calendar( const QString &timeZoneId )
45{ 45{
46 46
47 init(); 47 init();
48 setTimeZoneId(timeZoneId); 48 setTimeZoneId(timeZoneId);
49} 49}
50 50
51void Calendar::init() 51void Calendar::init()
52{ 52{
53 mObserver = 0; 53 mObserver = 0;
54 mNewObserver = false; 54 mNewObserver = false;
55 55 mUndoIncidence = 0;
56 mModified = false; 56 mModified = false;
57 57
58 // Setup default filter, which does nothing 58 // Setup default filter, which does nothing
59 mDefaultFilter = new CalFilter; 59 mDefaultFilter = new CalFilter;
60 mFilter = mDefaultFilter; 60 mFilter = mDefaultFilter;
61 mFilter->setEnabled(false); 61 mFilter->setEnabled(false);
62 62
63 // initialize random numbers. This is a hack, and not 63 // initialize random numbers. This is a hack, and not
64 // even that good of one at that. 64 // even that good of one at that.
65// srandom(time(0)); 65// srandom(time(0));
66 66
67 // user information... 67 // user information...
68 setOwner(i18n("Unknown Name")); 68 setOwner(i18n("Unknown Name"));
69 setEmail(i18n("unknown@nowhere")); 69 setEmail(i18n("unknown@nowhere"));
70 70
71#if 0 71#if 0
72 tmpStr = KOPrefs::instance()->mTimeZone; 72 tmpStr = KOPrefs::instance()->mTimeZone;
73// kdDebug(5800) << "Calendar::Calendar(): TimeZone: " << tmpStr << endl; 73// kdDebug(5800) << "Calendar::Calendar(): TimeZone: " << tmpStr << endl;
74 int dstSetting = KOPrefs::instance()->mDaylightSavings; 74 int dstSetting = KOPrefs::instance()->mDaylightSavings;
75 extern long int timezone; 75 extern long int timezone;
76 struct tm *now; 76 struct tm *now;
77 time_t curtime; 77 time_t curtime;
78 curtime = time(0); 78 curtime = time(0);
79 now = localtime(&curtime); 79 now = localtime(&curtime);
80 int hourOff = - ((timezone / 60) / 60); 80 int hourOff = - ((timezone / 60) / 60);
81 if (now->tm_isdst) 81 if (now->tm_isdst)
82 hourOff += 1; 82 hourOff += 1;
83 QString tzStr; 83 QString tzStr;
84 tzStr.sprintf("%.2d%.2d", 84 tzStr.sprintf("%.2d%.2d",
85 hourOff, 85 hourOff,
86 abs((timezone / 60) % 60)); 86 abs((timezone / 60) % 60));
87 87
88 // if no time zone was in the config file, write what we just discovered. 88 // if no time zone was in the config file, write what we just discovered.
89 if (tmpStr.isEmpty()) { 89 if (tmpStr.isEmpty()) {
90// KOPrefs::instance()->mTimeZone = tzStr; 90// KOPrefs::instance()->mTimeZone = tzStr;
91 } else { 91 } else {
92 tzStr = tmpStr; 92 tzStr = tmpStr;
93 } 93 }
94 94
95 // if daylight savings has changed since last load time, we need 95 // if daylight savings has changed since last load time, we need
96 // to rewrite these settings to the config file. 96 // to rewrite these settings to the config file.
97 if ((now->tm_isdst && !dstSetting) || 97 if ((now->tm_isdst && !dstSetting) ||
98 (!now->tm_isdst && dstSetting)) { 98 (!now->tm_isdst && dstSetting)) {
99 KOPrefs::instance()->mTimeZone = tzStr; 99 KOPrefs::instance()->mTimeZone = tzStr;
100 KOPrefs::instance()->mDaylightSavings = now->tm_isdst; 100 KOPrefs::instance()->mDaylightSavings = now->tm_isdst;
101 } 101 }
102 102
103 setTimeZone(tzStr); 103 setTimeZone(tzStr);
104#endif 104#endif
105 105
106// KOPrefs::instance()->writeConfig(); 106// KOPrefs::instance()->writeConfig();
107} 107}
108 108
109Calendar::~Calendar() 109Calendar::~Calendar()
110{ 110{
111 delete mDefaultFilter; 111 delete mDefaultFilter;
112 if ( mUndoIncidence )
113 delete mUndoIncidence;
112} 114}
113 115
114const QString &Calendar::getOwner() const 116const QString &Calendar::getOwner() const
115{ 117{
116 return mOwner; 118 return mOwner;
117} 119}
118 120
121bool Calendar::undoDeleteIncidence()
122{
123 if (!mUndoIncidence)
124 return false;
125 addIncidence(mUndoIncidence);
126 mUndoIncidence = 0;
127}
119void Calendar::setOwner(const QString &os) 128void Calendar::setOwner(const QString &os)
120{ 129{
121 int i; 130 int i;
122 mOwner = os; 131 mOwner = os;
123 i = mOwner.find(','); 132 i = mOwner.find(',');
124 if (i != -1) 133 if (i != -1)
125 mOwner = mOwner.left(i); 134 mOwner = mOwner.left(i);
126 135
127 setModified( true ); 136 setModified( true );
128} 137}
129 138
130void Calendar::setTimeZone(const QString & tz) 139void Calendar::setTimeZone(const QString & tz)
131{ 140{
132 bool neg = FALSE; 141 bool neg = FALSE;
133 int hours, minutes; 142 int hours, minutes;
134 QString tmpStr(tz); 143 QString tmpStr(tz);
135 144
136 if (tmpStr.left(1) == "-") 145 if (tmpStr.left(1) == "-")
137 neg = TRUE; 146 neg = TRUE;
138 if (tmpStr.left(1) == "-" || tmpStr.left(1) == "+") 147 if (tmpStr.left(1) == "-" || tmpStr.left(1) == "+")
139 tmpStr.remove(0, 1); 148 tmpStr.remove(0, 1);
140 hours = tmpStr.left(2).toInt(); 149 hours = tmpStr.left(2).toInt();
141 if (tmpStr.length() > 2) 150 if (tmpStr.length() > 2)
142 minutes = tmpStr.right(2).toInt(); 151 minutes = tmpStr.right(2).toInt();
143 else 152 else
144 minutes = 0; 153 minutes = 0;
145 mTimeZone = (60*hours+minutes); 154 mTimeZone = (60*hours+minutes);
146 if (neg) 155 if (neg)
147 mTimeZone = -mTimeZone; 156 mTimeZone = -mTimeZone;
148 mLocalTime = false; 157 mLocalTime = false;
149 158
150 setModified( true ); 159 setModified( true );
151} 160}
152 161
153QString Calendar::getTimeZoneStr() const 162QString Calendar::getTimeZoneStr() const
154{ 163{
155 if (mLocalTime) 164 if (mLocalTime)
156 return ""; 165 return "";
157 QString tmpStr; 166 QString tmpStr;
158 int hours = abs(mTimeZone / 60); 167 int hours = abs(mTimeZone / 60);
159 int minutes = abs(mTimeZone % 60); 168 int minutes = abs(mTimeZone % 60);
160 bool neg = mTimeZone < 0; 169 bool neg = mTimeZone < 0;
161 170
162 tmpStr.sprintf("%c%.2d%.2d", 171 tmpStr.sprintf("%c%.2d%.2d",
163 (neg ? '-' : '+'), 172 (neg ? '-' : '+'),
164 hours, minutes); 173 hours, minutes);
165 return tmpStr; 174 return tmpStr;
166} 175}
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index b7d6a1f..2f2c3aa 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -20,96 +20,98 @@
20*/ 20*/
21 21
22#ifndef CALENDAR_H 22#ifndef CALENDAR_H
23#define CALENDAR_H 23#define CALENDAR_H
24 24
25#include <qobject.h> 25#include <qobject.h>
26#include <qstring.h> 26#include <qstring.h>
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qptrlist.h> 28#include <qptrlist.h>
29#include <qdict.h> 29#include <qdict.h>
30 30
31#include "customproperties.h" 31#include "customproperties.h"
32#include "event.h" 32#include "event.h"
33#include "todo.h" 33#include "todo.h"
34#include "journal.h" 34#include "journal.h"
35#include "calfilter.h" 35#include "calfilter.h"
36 36
37//#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */ 37//#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */
38 38
39class KConfig; 39class KConfig;
40 40
41namespace KCal { 41namespace KCal {
42 42
43 43
44/** 44/**
45 This is the main "calendar" object class for KOrganizer. It holds 45 This is the main "calendar" object class for KOrganizer. It holds
46 information like all appointments/events, user information, etc. etc. 46 information like all appointments/events, user information, etc. etc.
47 one calendar is associated with each CalendarView (@see calendarview.h). 47 one calendar is associated with each CalendarView (@see calendarview.h).
48 This is an abstract base class defining the interface to a calendar. It is 48 This is an abstract base class defining the interface to a calendar. It is
49 implemented by subclasses like @see CalendarLocal, which use different 49 implemented by subclasses like @see CalendarLocal, which use different
50 methods to store and access the data. 50 methods to store and access the data.
51 51
52 Ownership of events etc. is handled by the following policy: As soon as an 52 Ownership of events etc. is handled by the following policy: As soon as an
53 event (or any other subclass of IncidenceBase) object is added to the 53 event (or any other subclass of IncidenceBase) object is added to the
54 Calendar by addEvent() it is owned by the Calendar object. The Calendar takes 54 Calendar by addEvent() it is owned by the Calendar object. The Calendar takes
55 care of deleting it. All Events returned by the query functions are returned 55 care of deleting it. All Events returned by the query functions are returned
56 as pointers, that means all changes to the returned events are immediately 56 as pointers, that means all changes to the returned events are immediately
57 visible in the Calendar. You shouldn't delete any Event object you get from 57 visible in the Calendar. You shouldn't delete any Event object you get from
58 Calendar. 58 Calendar.
59*/ 59*/
60class Calendar : public QObject, public CustomProperties, 60class Calendar : public QObject, public CustomProperties,
61 public IncidenceBase::Observer 61 public IncidenceBase::Observer
62{ 62{
63 Q_OBJECT 63 Q_OBJECT
64public: 64public:
65 Calendar(); 65 Calendar();
66 Calendar(const QString &timeZoneId); 66 Calendar(const QString &timeZoneId);
67 virtual ~Calendar(); 67 virtual ~Calendar();
68 Incidence * undoIncidence() { return mUndoIncidence; };
69 bool undoDeleteIncidence();
68 void deleteIncidence(Incidence *in); 70 void deleteIncidence(Incidence *in);
69 void resetTempSyncStat(); 71 void resetTempSyncStat();
70 void resetPilotStat(int id); 72 void resetPilotStat(int id);
71 /** 73 /**
72 Clears out the current calendar, freeing all used memory etc. 74 Clears out the current calendar, freeing all used memory etc.
73 */ 75 */
74 virtual void close() = 0; 76 virtual void close() = 0;
75 77
76 /** 78 /**
77 Sync changes in memory to persistant storage. 79 Sync changes in memory to persistant storage.
78 */ 80 */
79 virtual void save() = 0; 81 virtual void save() = 0;
80 virtual QPtrList<Event> getExternLastSyncEvents() = 0; 82 virtual QPtrList<Event> getExternLastSyncEvents() = 0;
81 virtual void removeSyncInfo( QString syncProfile) = 0; 83 virtual void removeSyncInfo( QString syncProfile) = 0;
82 virtual bool isSaving() { return false; } 84 virtual bool isSaving() { return false; }
83 85
84 /** 86 /**
85 Return the owner of the calendar's full name. 87 Return the owner of the calendar's full name.
86 */ 88 */
87 const QString &getOwner() const; 89 const QString &getOwner() const;
88 /** 90 /**
89 Set the owner of the calendar. Should be owner's full name. 91 Set the owner of the calendar. Should be owner's full name.
90 */ 92 */
91 void setOwner( const QString &os ); 93 void setOwner( const QString &os );
92 /** 94 /**
93 Return the email address of the calendar owner. 95 Return the email address of the calendar owner.
94 */ 96 */
95 const QString &getEmail(); 97 const QString &getEmail();
96 /** 98 /**
97 Set the email address of the calendar owner. 99 Set the email address of the calendar owner.
98 */ 100 */
99 void setEmail( const QString & ); 101 void setEmail( const QString & );
100 102
101 /** 103 /**
102 Set time zone from a timezone string (e.g. -2:00) 104 Set time zone from a timezone string (e.g. -2:00)
103 */ 105 */
104 void setTimeZone( const QString &tz ); 106 void setTimeZone( const QString &tz );
105 /** 107 /**
106 Set time zone from a minutes value (e.g. -60) 108 Set time zone from a minutes value (e.g. -60)
107 */ 109 */
108 void setTimeZone( int tz ); 110 void setTimeZone( int tz );
109 /** 111 /**
110 Return time zone as offest in minutes. 112 Return time zone as offest in minutes.
111 */ 113 */
112 int getTimeZone() const; 114 int getTimeZone() const;
113 /** 115 /**
114 Compute an ISO 8601 format string from the time zone. 116 Compute an ISO 8601 format string from the time zone.
115 */ 117 */
@@ -277,77 +279,78 @@ public:
277 */ 279 */
278 virtual Alarm::List alarms( const QDateTime &from, 280 virtual Alarm::List alarms( const QDateTime &from,
279 const QDateTime &to ) = 0; 281 const QDateTime &to ) = 0;
280 282
281 class Observer { 283 class Observer {
282 public: 284 public:
283 virtual void calendarModified( bool, Calendar * ) = 0; 285 virtual void calendarModified( bool, Calendar * ) = 0;
284 }; 286 };
285 287
286 void registerObserver( Observer * ); 288 void registerObserver( Observer * );
287 289
288 void setModified( bool ); 290 void setModified( bool );
289 291
290 /** 292 /**
291 Set product id returned by loadedProductId(). This function is only 293 Set product id returned by loadedProductId(). This function is only
292 useful for the calendar loading code. 294 useful for the calendar loading code.
293 */ 295 */
294 void setLoadedProductId( const QString & ); 296 void setLoadedProductId( const QString & );
295 /** 297 /**
296 Return product id taken from file that has been loaded. Returns 298 Return product id taken from file that has been loaded. Returns
297 QString::null, if no calendar has been loaded. 299 QString::null, if no calendar has been loaded.
298 */ 300 */
299 QString loadedProductId(); 301 QString loadedProductId();
300 302
301 signals: 303 signals:
302 void calendarChanged(); 304 void calendarChanged();
303 void calendarSaved(); 305 void calendarSaved();
304 void calendarLoaded(); 306 void calendarLoaded();
305 void addAlarm(const QDateTime &qdt, const QString &noti ); 307 void addAlarm(const QDateTime &qdt, const QString &noti );
306 void removeAlarm(const QDateTime &qdt, const QString &noti ); 308 void removeAlarm(const QDateTime &qdt, const QString &noti );
307 309
308 protected: 310 protected:
309 /** 311 /**
310 Get unfiltered events, which occur on the given date. 312 Get unfiltered events, which occur on the given date.
311 */ 313 */
312 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; 314 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0;
313 /** 315 /**
314 Get unfiltered events, which occur on the given date. 316 Get unfiltered events, which occur on the given date.
315 */ 317 */
316 virtual QPtrList<Event> rawEventsForDate( const QDate &date, 318 virtual QPtrList<Event> rawEventsForDate( const QDate &date,
317 bool sorted = false ) = 0; 319 bool sorted = false ) = 0;
318 /** 320 /**
319 Get events in a range of dates. If inclusive is set to true, only events 321 Get events in a range of dates. If inclusive is set to true, only events
320 are returned, which are completely included in the range. 322 are returned, which are completely included in the range.
321 */ 323 */
322 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 324 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
323 bool inclusive = false ) = 0; 325 bool inclusive = false ) = 0;
324 Incidence *mNextAlarmIncidence; 326 Incidence *mNextAlarmIncidence;
327 Incidence *mUndoIncidence;
325 328
326private: 329private:
327 void init(); 330 void init();
328 331
329 QString mOwner; // who the calendar belongs to 332 QString mOwner; // who the calendar belongs to
330 QString mOwnerEmail; // email address of the owner 333 QString mOwnerEmail; // email address of the owner
331 int mTimeZone; // timezone OFFSET from GMT (MINUTES) 334 int mTimeZone; // timezone OFFSET from GMT (MINUTES)
332 bool mLocalTime; // use local time, not UTC or a time zone 335 bool mLocalTime; // use local time, not UTC or a time zone
333 336
334 CalFilter *mFilter; 337 CalFilter *mFilter;
335 CalFilter *mDefaultFilter; 338 CalFilter *mDefaultFilter;
336 339
337 QString mTimeZoneId; 340 QString mTimeZoneId;
338 341
339 Observer *mObserver; 342 Observer *mObserver;
340 bool mNewObserver; 343 bool mNewObserver;
341 344
342 bool mModified; 345 bool mModified;
343 346
344 QString mLoadedProductId; 347 QString mLoadedProductId;
345 348
346 // This list is used to put together related todos 349 // This list is used to put together related todos
347 QDict<Incidence> mOrphans; 350 QDict<Incidence> mOrphans;
348 QDict<Incidence> mOrphanUids; 351 QDict<Incidence> mOrphanUids;
349}; 352};
350 353
351} 354}
352 355
353#endif 356#endif
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 3f46d53..12294c0 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -107,145 +107,147 @@ bool CalendarLocal::addAnniversaryNoDup( Event *event )
107 } else if( event->categoriesStr() == i18n( "Birthday" ) ) { 107 } else if( event->categoriesStr() == i18n( "Birthday" ) ) {
108 isBirthday = true; 108 isBirthday = true;
109 cat = i18n( "Birthday" ); 109 cat = i18n( "Birthday" );
110 } else { 110 } else {
111 qDebug("addAnniversaryNoDup called without fitting category! "); 111 qDebug("addAnniversaryNoDup called without fitting category! ");
112 return false; 112 return false;
113 } 113 }
114 Event * eve; 114 Event * eve;
115 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { 115 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) {
116 if ( !(eve->categories().contains( cat ) )) 116 if ( !(eve->categories().contains( cat ) ))
117 continue; 117 continue;
118 // now we have an event with fitting category 118 // now we have an event with fitting category
119 if ( eve->dtStart().date() != event->dtStart().date() ) 119 if ( eve->dtStart().date() != event->dtStart().date() )
120 continue; 120 continue;
121 // now we have an event with fitting category+date 121 // now we have an event with fitting category+date
122 if ( eve->summary() != event->summary() ) 122 if ( eve->summary() != event->summary() )
123 continue; 123 continue;
124 // now we have an event with fitting category+date+summary 124 // now we have an event with fitting category+date+summary
125 return false; 125 return false;
126 } 126 }
127 return addEvent( event ); 127 return addEvent( event );
128 128
129} 129}
130bool CalendarLocal::addEventNoDup( Event *event ) 130bool CalendarLocal::addEventNoDup( Event *event )
131{ 131{
132 Event * eve; 132 Event * eve;
133 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { 133 for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) {
134 if ( *eve == *event ) { 134 if ( *eve == *event ) {
135 //qDebug("CalendarLocal::Duplicate event found! Not inserted! "); 135 //qDebug("CalendarLocal::Duplicate event found! Not inserted! ");
136 return false; 136 return false;
137 } 137 }
138 } 138 }
139 return addEvent( event ); 139 return addEvent( event );
140} 140}
141 141
142bool CalendarLocal::addEvent( Event *event ) 142bool CalendarLocal::addEvent( Event *event )
143{ 143{
144 insertEvent( event ); 144 insertEvent( event );
145 145
146 event->registerObserver( this ); 146 event->registerObserver( this );
147 147
148 setModified( true ); 148 setModified( true );
149 149
150 return true; 150 return true;
151} 151}
152 152
153void CalendarLocal::deleteEvent( Event *event ) 153void CalendarLocal::deleteEvent( Event *event )
154{ 154{
155 155 if ( mUndoIncidence ) delete mUndoIncidence;
156 156 mUndoIncidence = event->clone();
157 if ( mEventList.removeRef( event ) ) { 157 if ( mEventList.removeRef( event ) ) {
158 setModified( true ); 158 setModified( true );
159 } 159 }
160} 160}
161 161
162 162
163Event *CalendarLocal::event( const QString &uid ) 163Event *CalendarLocal::event( const QString &uid )
164{ 164{
165 165
166 Event *event; 166 Event *event;
167 167
168 for ( event = mEventList.first(); event; event = mEventList.next() ) { 168 for ( event = mEventList.first(); event; event = mEventList.next() ) {
169 if ( event->uid() == uid ) { 169 if ( event->uid() == uid ) {
170 return event; 170 return event;
171 } 171 }
172 } 172 }
173 173
174 return 0; 174 return 0;
175} 175}
176bool CalendarLocal::addTodoNoDup( Todo *todo ) 176bool CalendarLocal::addTodoNoDup( Todo *todo )
177{ 177{
178 Todo * eve; 178 Todo * eve;
179 for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) { 179 for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) {
180 if ( *eve == *todo ) { 180 if ( *eve == *todo ) {
181 //qDebug("duplicate todo found! not inserted! "); 181 //qDebug("duplicate todo found! not inserted! ");
182 return false; 182 return false;
183 } 183 }
184 } 184 }
185 return addTodo( todo ); 185 return addTodo( todo );
186} 186}
187bool CalendarLocal::addTodo( Todo *todo ) 187bool CalendarLocal::addTodo( Todo *todo )
188{ 188{
189 mTodoList.append( todo ); 189 mTodoList.append( todo );
190 190
191 todo->registerObserver( this ); 191 todo->registerObserver( this );
192 192
193 // Set up subtask relations 193 // Set up subtask relations
194 setupRelations( todo ); 194 setupRelations( todo );
195 195
196 setModified( true ); 196 setModified( true );
197 197
198 return true; 198 return true;
199} 199}
200 200
201void CalendarLocal::deleteTodo( Todo *todo ) 201void CalendarLocal::deleteTodo( Todo *todo )
202{ 202{
203 // Handle orphaned children 203 // Handle orphaned children
204 if ( mUndoIncidence ) delete mUndoIncidence;
205 mUndoIncidence = todo->clone();
204 removeRelations( todo ); 206 removeRelations( todo );
205 207
206 if ( mTodoList.removeRef( todo ) ) { 208 if ( mTodoList.removeRef( todo ) ) {
207 setModified( true ); 209 setModified( true );
208 } 210 }
209} 211}
210 212
211QPtrList<Todo> CalendarLocal::rawTodos() 213QPtrList<Todo> CalendarLocal::rawTodos()
212{ 214{
213 return mTodoList; 215 return mTodoList;
214} 216}
215Todo *CalendarLocal::todo( QString syncProf, QString id ) 217Todo *CalendarLocal::todo( QString syncProf, QString id )
216{ 218{
217 Todo *todo; 219 Todo *todo;
218 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { 220 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
219 if ( todo->getID( syncProf ) == id ) return todo; 221 if ( todo->getID( syncProf ) == id ) return todo;
220 } 222 }
221 223
222 return 0; 224 return 0;
223} 225}
224void CalendarLocal::removeSyncInfo( QString syncProfile) 226void CalendarLocal::removeSyncInfo( QString syncProfile)
225{ 227{
226 QPtrList<Incidence> all = rawIncidences() ; 228 QPtrList<Incidence> all = rawIncidences() ;
227 Incidence *inc; 229 Incidence *inc;
228 for ( inc = all.first(); inc; inc = all.next() ) { 230 for ( inc = all.first(); inc; inc = all.next() ) {
229 inc->removeID( syncProfile ); 231 inc->removeID( syncProfile );
230 } 232 }
231 if ( syncProfile.isEmpty() ) { 233 if ( syncProfile.isEmpty() ) {
232 QPtrList<Event> el; 234 QPtrList<Event> el;
233 Event *todo; 235 Event *todo;
234 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 236 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
235 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) 237 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
236 el.append( todo ); 238 el.append( todo );
237 } 239 }
238 for ( todo = el.first(); todo; todo = el.next() ) { 240 for ( todo = el.first(); todo; todo = el.next() ) {
239 deleteIncidence ( todo ); 241 deleteIncidence ( todo );
240 } 242 }
241 } else { 243 } else {
242 Event *lse = event( "last-syncEvent-"+ syncProfile); 244 Event *lse = event( "last-syncEvent-"+ syncProfile);
243 deleteIncidence ( lse ); 245 deleteIncidence ( lse );
244 } 246 }
245} 247}
246QPtrList<Event> CalendarLocal::getExternLastSyncEvents() 248QPtrList<Event> CalendarLocal::getExternLastSyncEvents()
247{ 249{
248 QPtrList<Event> el; 250 QPtrList<Event> el;
249 Event *todo; 251 Event *todo;
250 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 252 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
251 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) 253 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
@@ -642,78 +644,81 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
642 if ( found ) eventList.append( event ); 644 if ( found ) eventList.append( event );
643 } else { 645 } else {
644 QDate s = event->dtStart().date(); 646 QDate s = event->dtStart().date();
645 QDate e = event->dtEnd().date(); 647 QDate e = event->dtEnd().date();
646 648
647 if ( inclusive ) { 649 if ( inclusive ) {
648 if ( s >= start && e <= end ) { 650 if ( s >= start && e <= end ) {
649 eventList.append( event ); 651 eventList.append( event );
650 } 652 }
651 } else { 653 } else {
652 if ( ( s >= start && s <= end ) || ( e >= start && e <= end ) ) { 654 if ( ( s >= start && s <= end ) || ( e >= start && e <= end ) ) {
653 eventList.append( event ); 655 eventList.append( event );
654 } 656 }
655 } 657 }
656 } 658 }
657 } 659 }
658 660
659 return eventList; 661 return eventList;
660} 662}
661 663
662QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) 664QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt )
663{ 665{
664 return rawEventsForDate( qdt.date() ); 666 return rawEventsForDate( qdt.date() );
665} 667}
666 668
667QPtrList<Event> CalendarLocal::rawEvents() 669QPtrList<Event> CalendarLocal::rawEvents()
668{ 670{
669 return mEventList; 671 return mEventList;
670} 672}
671 673
672bool CalendarLocal::addJournal(Journal *journal) 674bool CalendarLocal::addJournal(Journal *journal)
673{ 675{
674 if ( journal->dtStart().isValid()) 676 if ( journal->dtStart().isValid())
675 kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl; 677 kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl;
676 else 678 else
677 kdDebug(5800) << "Adding Journal without a DTSTART" << endl; 679 kdDebug(5800) << "Adding Journal without a DTSTART" << endl;
678 680
679 mJournalList.append(journal); 681 mJournalList.append(journal);
680 682
681 journal->registerObserver( this ); 683 journal->registerObserver( this );
682 684
683 setModified( true ); 685 setModified( true );
684 686
685 return true; 687 return true;
686} 688}
687 689
688void CalendarLocal::deleteJournal( Journal *journal ) 690void CalendarLocal::deleteJournal( Journal *journal )
689{ 691{
692 if ( mUndoIncidence ) delete mUndoIncidence;
693 mUndoIncidence = journal->clone();
694 mUndoIncidence->setSummary( mUndoIncidence->description().left(25));
690 if ( mJournalList.removeRef(journal) ) { 695 if ( mJournalList.removeRef(journal) ) {
691 setModified( true ); 696 setModified( true );
692 } 697 }
693} 698}
694 699
695Journal *CalendarLocal::journal( const QDate &date ) 700Journal *CalendarLocal::journal( const QDate &date )
696{ 701{
697// kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; 702// kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl;
698 703
699 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 704 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
700 if ( it->dtStart().date() == date ) 705 if ( it->dtStart().date() == date )
701 return it; 706 return it;
702 707
703 return 0; 708 return 0;
704} 709}
705 710
706Journal *CalendarLocal::journal( const QString &uid ) 711Journal *CalendarLocal::journal( const QString &uid )
707{ 712{
708 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 713 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
709 if ( it->uid() == uid ) 714 if ( it->uid() == uid )
710 return it; 715 return it;
711 716
712 return 0; 717 return 0;
713} 718}
714 719
715QPtrList<Journal> CalendarLocal::journals() 720QPtrList<Journal> CalendarLocal::journals()
716{ 721{
717 return mJournalList; 722 return mJournalList;
718} 723}
719 724
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 5a9ef0e..28402ae 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -128,96 +128,110 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
128 { 128 {
129 qDebug("alarm not equal "); 129 qDebug("alarm not equal ");
130 return false; 130 return false;
131 } 131 }
132 } 132 }
133#if 0 133#if 0
134 QPtrListIterator<Alarm> a1( i1.alarms() ); 134 QPtrListIterator<Alarm> a1( i1.alarms() );
135 QPtrListIterator<Alarm> a2( i2.alarms() ); 135 QPtrListIterator<Alarm> a2( i2.alarms() );
136 for( ; a1.current() && a2.current(); ++a1, ++a2 ) { 136 for( ; a1.current() && a2.current(); ++a1, ++a2 ) {
137 if( *a1.current() == *a2.current() ) { 137 if( *a1.current() == *a2.current() ) {
138 continue; 138 continue;
139 } 139 }
140 else { 140 else {
141 return false; 141 return false;
142 } 142 }
143 } 143 }
144#endif 144#endif
145 145
146 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) ) 146 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) )
147 return false; 147 return false;
148 if ( i1.hasStartDate() == i2.hasStartDate() ) { 148 if ( i1.hasStartDate() == i2.hasStartDate() ) {
149 if ( i1.hasStartDate() ) { 149 if ( i1.hasStartDate() ) {
150 if ( i1.dtStart() != i2.dtStart() ) 150 if ( i1.dtStart() != i2.dtStart() )
151 return false; 151 return false;
152 } 152 }
153 } else { 153 } else {
154 return false; 154 return false;
155 } 155 }
156 if (!( *i1.recurrence() == *i2.recurrence()) ) { 156 if (!( *i1.recurrence() == *i2.recurrence()) ) {
157 qDebug("recurrence is NOT equal "); 157 qDebug("recurrence is NOT equal ");
158 return false; 158 return false;
159 } 159 }
160 return 160 return
161 // i1.created() == i2.created() && 161 // i1.created() == i2.created() &&
162 stringCompare( i1.description(), i2.description() ) && 162 stringCompare( i1.description(), i2.description() ) &&
163 stringCompare( i1.summary(), i2.summary() ) && 163 stringCompare( i1.summary(), i2.summary() ) &&
164 i1.categories() == i2.categories() && 164 i1.categories() == i2.categories() &&
165 // no need to compare mRelatedTo 165 // no need to compare mRelatedTo
166 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && 166 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) &&
167 // i1.relations() == i2.relations() && 167 // i1.relations() == i2.relations() &&
168 i1.exDates() == i2.exDates() && 168 i1.exDates() == i2.exDates() &&
169 i1.attachments() == i2.attachments() && 169 i1.attachments() == i2.attachments() &&
170 i1.resources() == i2.resources() && 170 i1.resources() == i2.resources() &&
171 i1.secrecy() == i2.secrecy() && 171 i1.secrecy() == i2.secrecy() &&
172 i1.priority() == i2.priority() && 172 i1.priority() == i2.priority() &&
173 stringCompare( i1.location(), i2.location() ); 173 stringCompare( i1.location(), i2.location() );
174} 174}
175 175
176Incidence* Incidence::recreateCloneException( QDate d )
177{
178 Incidence* newInc = clone();
179 newInc->recreate();
180 if ( doesRecur() ) {
181 addExDate( d );
182 newInc->recurrence()->unsetRecurs();
183 int len = dtStart().secsTo( ((Event*)this)->dtEnd());
184 QTime tim = dtStart().time();
185 newInc->setDtStart( QDateTime(d, tim) );
186 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
187 }
188 return newInc;
189}
176 190
177void Incidence::recreate() 191void Incidence::recreate()
178{ 192{
179 setCreated(QDateTime::currentDateTime()); 193 setCreated(QDateTime::currentDateTime());
180 194
181 setUid(CalFormat::createUniqueId()); 195 setUid(CalFormat::createUniqueId());
182 196
183 setRevision(0); 197 setRevision(0);
184 setIDStr( ":" ); 198 setIDStr( ":" );
185 setLastModified(QDateTime::currentDateTime()); 199 setLastModified(QDateTime::currentDateTime());
186} 200}
187 201
188void Incidence::setReadOnly( bool readOnly ) 202void Incidence::setReadOnly( bool readOnly )
189{ 203{
190 IncidenceBase::setReadOnly( readOnly ); 204 IncidenceBase::setReadOnly( readOnly );
191 recurrence()->setRecurReadOnly( readOnly); 205 recurrence()->setRecurReadOnly( readOnly);
192} 206}
193 207
194void Incidence::setCreated(QDateTime created) 208void Incidence::setCreated(QDateTime created)
195{ 209{
196 if (mReadOnly) return; 210 if (mReadOnly) return;
197 mCreated = getEvenTime(created); 211 mCreated = getEvenTime(created);
198} 212}
199 213
200QDateTime Incidence::created() const 214QDateTime Incidence::created() const
201{ 215{
202 return mCreated; 216 return mCreated;
203} 217}
204 218
205void Incidence::setRevision(int rev) 219void Incidence::setRevision(int rev)
206{ 220{
207 if (mReadOnly) return; 221 if (mReadOnly) return;
208 mRevision = rev; 222 mRevision = rev;
209 223
210 updated(); 224 updated();
211} 225}
212 226
213int Incidence::revision() const 227int Incidence::revision() const
214{ 228{
215 return mRevision; 229 return mRevision;
216} 230}
217 231
218void Incidence::setDtStart(const QDateTime &dtStart) 232void Incidence::setDtStart(const QDateTime &dtStart)
219{ 233{
220 234
221 QDateTime dt = getEvenTime(dtStart); 235 QDateTime dt = getEvenTime(dtStart);
222 recurrence()->setRecurStart( dt); 236 recurrence()->setRecurStart( dt);
223 IncidenceBase::setDtStart( dt ); 237 IncidenceBase::setDtStart( dt );
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index 7dc6f10..1807bc4 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -77,96 +77,97 @@ class Incidence : public IncidenceBase
77 /** Constructor is protected to prevent direct creation of visitor base class. */ 77 /** Constructor is protected to prevent direct creation of visitor base class. */
78 Visitor() {} 78 Visitor() {}
79 }; 79 };
80 80
81 /** 81 /**
82 This class implements a visitor for adding an Incidence to a resource 82 This class implements a visitor for adding an Incidence to a resource
83 supporting addEvent(), addTodo() and addJournal() calls. 83 supporting addEvent(), addTodo() and addJournal() calls.
84 */ 84 */
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 115
116 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; 116 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0;
117 void setReadOnly( bool ); 117 void setReadOnly( bool );
118 118
119 /** 119 /**
120 Recreate event. The event is made a new unique event, but already stored 120 Recreate event. The event is made a new unique event, but already stored
121 event information is preserved. Sets uniquie id, creation date, last 121 event information is preserved. Sets uniquie id, creation date, last
122 modification date and revision number. 122 modification date and revision number.
123 */ 123 */
124 void recreate(); 124 void recreate();
125 Incidence* recreateCloneException(QDate);
125 126
126 /** set creation date */ 127 /** set creation date */
127 void setCreated(QDateTime); 128 void setCreated(QDateTime);
128 /** return time and date of creation. */ 129 /** return time and date of creation. */
129 QDateTime created() const; 130 QDateTime created() const;
130 131
131 /** set the number of revisions this event has seen */ 132 /** set the number of revisions this event has seen */
132 void setRevision(int rev); 133 void setRevision(int rev);
133 /** return the number of revisions this event has seen */ 134 /** return the number of revisions this event has seen */
134 int revision() const; 135 int revision() const;
135 136
136 /** Set starting date/time. */ 137 /** Set starting date/time. */
137 virtual void setDtStart(const QDateTime &dtStart); 138 virtual void setDtStart(const QDateTime &dtStart);
138 /** Return the incidence's ending date/time as a QDateTime. */ 139 /** Return the incidence's ending date/time as a QDateTime. */
139 virtual QDateTime dtEnd() const { return QDateTime(); } 140 virtual QDateTime dtEnd() const { return QDateTime(); }
140 141
141 /** sets the event's lengthy description. */ 142 /** sets the event's lengthy description. */
142 void setDescription(const QString &description); 143 void setDescription(const QString &description);
143 /** returns a reference to the event's description. */ 144 /** returns a reference to the event's description. */
144 QString description() const; 145 QString description() const;
145 146
146 /** sets the event's short summary. */ 147 /** sets the event's short summary. */
147 void setSummary(const QString &summary); 148 void setSummary(const QString &summary);
148 /** returns a reference to the event's summary. */ 149 /** returns a reference to the event's summary. */
149 QString summary() const; 150 QString summary() const;
150 151
151 /** set event's applicable categories */ 152 /** set event's applicable categories */
152 void setCategories(const QStringList &categories); 153 void setCategories(const QStringList &categories);
153 /** set event's categories based on a comma delimited string */ 154 /** set event's categories based on a comma delimited string */
154 void setCategories(const QString &catStr); 155 void setCategories(const QString &catStr);
155 /** return categories in a list */ 156 /** return categories in a list */
156 QStringList categories() const; 157 QStringList categories() const;
157 /** return categories as a comma separated string */ 158 /** return categories as a comma separated string */
158 QString categoriesStr(); 159 QString categoriesStr();
159 160
160 /** point at some other event to which the event relates. This function should 161 /** point at some other event to which the event relates. This function should
161 * only be used when constructing a calendar before the related Event 162 * only be used when constructing a calendar before the related Event
162 * exists. */ 163 * exists. */
163 void setRelatedToUid(const QString &); 164 void setRelatedToUid(const QString &);
164 /** what event does this one relate to? This function should 165 /** what event does this one relate to? This function should
165 * only be used when constructing a calendar before the related Event 166 * only be used when constructing a calendar before the related Event
166 * exists. */ 167 * exists. */
167 QString relatedToUid() const; 168 QString relatedToUid() const;
168 /** point at some other event to which the event relates */ 169 /** point at some other event to which the event relates */
169 void setRelatedTo(Incidence *relatedTo); 170 void setRelatedTo(Incidence *relatedTo);
170 /** what event does this one relate to? */ 171 /** what event does this one relate to? */
171 Incidence *relatedTo() const; 172 Incidence *relatedTo() const;
172 /** All events that are related to this event */ 173 /** All events that are related to this event */
diff --git a/version b/version
index 0343cbb..ef03779 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "1.9.14"; version = "1.9.15";