-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 24 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 66 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 28 | ||||
-rw-r--r-- | libkcal/incidence.h | 3 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 4 | ||||
-rw-r--r-- | libkcal/incidencebase.h | 1 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 1 |
9 files changed, 117 insertions, 24 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index ea7071d..6723dc5 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1517,19 +1517,27 @@ | |||
1517 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, | 1517 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, |
1518 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, | 1518 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, |
1519 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, | 1519 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, |
1520 | { "Receiving file from remote...","Empfange entfernte Datei..." }, | 1520 | { "Receiving file from remote...","Empfange entfernte Datei..." }, |
1521 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, | 1521 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, |
1522 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, | 1522 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, |
1523 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, | 1523 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, |
1524 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, | 1524 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, |
1525 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, | 1525 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, |
1526 | { "Writing back file ...","Schreibe Datei zurück..." }, | 1526 | { "Writing back file ...","Schreibe Datei zurück..." }, |
1527 | { "Sending back file ...","Sende Datei zurück..." }, | 1527 | { "Sending back file ...","Sende Datei zurück..." }, |
1528 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, | 1528 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, |
1529 | { "Created","Angelegt" }, | ||
1530 | { "Last Modified Sub","Zuletzt geändertes Sub" }, | ||
1531 | { "","" }, | ||
1532 | { "","" }, | ||
1533 | { "","" }, | ||
1534 | { "","" }, | ||
1535 | { "","" }, | ||
1536 | { "","" }, | ||
1529 | { "","" }, | 1537 | { "","" }, |
1530 | { "","" }, | 1538 | { "","" }, |
1531 | { "","" }, | 1539 | { "","" }, |
1532 | { "","" }, | 1540 | { "","" }, |
1533 | { "","" }, | 1541 | { "","" }, |
1534 | { "","" }, | 1542 | { "","" }, |
1535 | { "","" }, | 1543 | { "","" }, |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7044e90..f9685e9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -358,25 +358,25 @@ CalendarView::CalendarView( Calendar *calendar, | |||
358 | mCalendar( calendar ), | 358 | mCalendar( calendar ), |
359 | mResourceManager( 0 ) | 359 | mResourceManager( 0 ) |
360 | { | 360 | { |
361 | 361 | ||
362 | mEventEditor = 0; | 362 | mEventEditor = 0; |
363 | mTodoEditor = 0; | 363 | mTodoEditor = 0; |
364 | init(); | 364 | init(); |
365 | } | 365 | } |
366 | 366 | ||
367 | void CalendarView::init() | 367 | void CalendarView::init() |
368 | { | 368 | { |
369 | mNextAlarmDateTime = QDateTime::currentDateTime(); | 369 | mNextAlarmDateTime = QDateTime::currentDateTime(); |
370 | setFocusPolicy ( NoFocus ); | 370 | //setFocusPolicy ( NoFocus ); |
371 | mViewerCallerIsSearchDialog = false; | 371 | mViewerCallerIsSearchDialog = false; |
372 | mBlockShowDates = false; | 372 | mBlockShowDates = false; |
373 | 373 | ||
374 | mDatePickerMode = 0; | 374 | mDatePickerMode = 0; |
375 | mCurrentSyncDevice = ""; | 375 | mCurrentSyncDevice = ""; |
376 | mViewManager = new KOViewManager( this ); | 376 | mViewManager = new KOViewManager( this ); |
377 | mDialogManager = new KODialogManager( this ); | 377 | mDialogManager = new KODialogManager( this ); |
378 | mEventViewerDialog = 0; | 378 | mEventViewerDialog = 0; |
379 | mModified = false; | 379 | mModified = false; |
380 | mReadOnly = false; | 380 | mReadOnly = false; |
381 | mSelectedIncidence = 0; | 381 | mSelectedIncidence = 0; |
382 | mCalPrinter = 0; | 382 | mCalPrinter = 0; |
@@ -4678,26 +4678,26 @@ void CalendarView::purgeCompleted() | |||
4678 | 4678 | ||
4679 | updateView(); | 4679 | updateView(); |
4680 | } | 4680 | } |
4681 | } | 4681 | } |
4682 | 4682 | ||
4683 | void CalendarView::slotCalendarChanged() | 4683 | void CalendarView::slotCalendarChanged() |
4684 | { | 4684 | { |
4685 | ; | 4685 | ; |
4686 | } | 4686 | } |
4687 | 4687 | ||
4688 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 4688 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
4689 | { | 4689 | { |
4690 | //qDebug(" alendarView::keyPressEvent "); | 4690 | //qDebug("CalendarView::keyPressEvent "); |
4691 | e->ignore(); | 4691 | e->ignore(); |
4692 | } | 4692 | } |
4693 | 4693 | ||
4694 | 4694 | ||
4695 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 4695 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
4696 | { | 4696 | { |
4697 | 4697 | ||
4698 | if ( manager != mSyncManager) | 4698 | if ( manager != mSyncManager) |
4699 | qDebug("KO: Internal error-1. SyncManager mismatch "); | 4699 | qDebug("KO: Internal error-1. SyncManager mismatch "); |
4700 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 4700 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
4701 | qDebug("KO: SyncKDE request detected!"); | 4701 | qDebug("KO: SyncKDE request detected!"); |
4702 | } | 4702 | } |
4703 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4703 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index add1819..94f35e6 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -423,32 +423,34 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | |||
423 | ci->setOn( false ); | 423 | ci->setOn( false ); |
424 | else | 424 | else |
425 | ci->setOn( true ); | 425 | ci->setOn( true ); |
426 | cn = cn->itemBelow(); | 426 | cn = cn->itemBelow(); |
427 | if ( cn ) { | 427 | if ( cn ) { |
428 | setCurrentItem ( cn ); | 428 | setCurrentItem ( cn ); |
429 | ensureItemVisible ( cn ); | 429 | ensureItemVisible ( cn ); |
430 | } | 430 | } |
431 | 431 | ||
432 | } | 432 | } |
433 | } | 433 | } |
434 | 434 | ||
435 | e->accept(); | ||
435 | return; | 436 | return; |
436 | } | 437 | } |
437 | 438 | ||
438 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { | 439 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { |
439 | switch ( e->key() ) { | 440 | switch ( e->key() ) { |
440 | case Qt::Key_Down: | 441 | case Qt::Key_Down: |
441 | case Qt::Key_Up: | 442 | case Qt::Key_Up: |
442 | QListView::keyPressEvent ( e ); | 443 | QListView::keyPressEvent ( e ); |
444 | e->accept(); | ||
443 | break; | 445 | break; |
444 | case Qt::Key_Left: | 446 | case Qt::Key_Left: |
445 | case Qt::Key_Right: | 447 | case Qt::Key_Right: |
446 | QListView::keyPressEvent ( e ); | 448 | QListView::keyPressEvent ( e ); |
447 | e->accept(); | 449 | e->accept(); |
448 | return; | 450 | return; |
449 | break; | 451 | break; |
450 | default: | 452 | default: |
451 | e->ignore(); | 453 | e->ignore(); |
452 | break; | 454 | break; |
453 | } | 455 | } |
454 | return; | 456 | return; |
@@ -505,48 +507,49 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
505 | mPendingUpdateBeforeRepaint = false; | 507 | mPendingUpdateBeforeRepaint = false; |
506 | isFlatDisplay = false; | 508 | isFlatDisplay = false; |
507 | mNavigator = 0; | 509 | mNavigator = 0; |
508 | QBoxLayout *topLayout = new QVBoxLayout(this); | 510 | QBoxLayout *topLayout = new QVBoxLayout(this); |
509 | mName = QString ( name ); | 511 | mName = QString ( name ); |
510 | mBlockUpdate = false; | 512 | mBlockUpdate = false; |
511 | mQuickBar = new QWidget( this ); | 513 | mQuickBar = new QWidget( this ); |
512 | topLayout->addWidget(mQuickBar); | 514 | topLayout->addWidget(mQuickBar); |
513 | 515 | ||
514 | mQuickAdd = new KOQuickTodo(mQuickBar); | 516 | mQuickAdd = new KOQuickTodo(mQuickBar); |
515 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); | 517 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); |
516 | quickLayout->addWidget( mQuickAdd ); | 518 | quickLayout->addWidget( mQuickAdd ); |
519 | mNewSubBut = new QPushButton( "sub",mQuickBar ); | ||
520 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); | ||
521 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); | ||
522 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); | ||
523 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); | ||
517 | QPushButton * flat = new QPushButton( "F",mQuickBar ); | 524 | QPushButton * flat = new QPushButton( "F",mQuickBar ); |
525 | |||
518 | int fixwid = flat->sizeHint().height(); | 526 | int fixwid = flat->sizeHint().height(); |
519 | if ( QApplication::desktop()->width() >= 800 ) | 527 | if ( QApplication::desktop()->width() >= 800 ) |
520 | fixwid *= 2; | 528 | fixwid *= 2; |
521 | flat->setFixedWidth( fixwid ); | 529 | flat->setFixedWidth( fixwid ); |
522 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); | 530 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); |
523 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); | ||
524 | allopen->setFixedWidth( fixwid ); | 531 | allopen->setFixedWidth( fixwid ); |
525 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); | 532 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); |
526 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); | ||
527 | allclose->setFixedWidth( fixwid ); | 533 | allclose->setFixedWidth( fixwid ); |
528 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); | 534 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); |
529 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); | ||
530 | s_done->setPixmap( SmallIcon("greenhook16")); | 535 | s_done->setPixmap( SmallIcon("greenhook16")); |
531 | s_done->setFixedWidth( fixwid ); | 536 | s_done->setFixedWidth( fixwid ); |
532 | s_done->setFixedHeight( flat->sizeHint().height() ); | 537 | s_done->setFixedHeight( flat->sizeHint().height() ); |
533 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); | 538 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); |
534 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); | ||
535 | s_run->setPixmap( SmallIcon("ko16old")); | 539 | s_run->setPixmap( SmallIcon("ko16old")); |
536 | s_run->setFixedWidth( fixwid ); | 540 | s_run->setFixedWidth( fixwid ); |
537 | s_run->setFixedHeight( flat->sizeHint().height() ); | 541 | s_run->setFixedHeight( flat->sizeHint().height() ); |
538 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); | 542 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); |
539 | 543 | ||
540 | mNewSubBut = new QPushButton( "sub",mQuickBar ); | ||
541 | mNewSubBut->setFixedWidth( fixwid*3/2 ); | 544 | mNewSubBut->setFixedWidth( fixwid*3/2 ); |
542 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); | 545 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); |
543 | mNewSubBut->setEnabled( false ); | 546 | mNewSubBut->setEnabled( false ); |
544 | quickLayout->addWidget( mNewSubBut ); | 547 | quickLayout->addWidget( mNewSubBut ); |
545 | quickLayout->addWidget( s_done ); | 548 | quickLayout->addWidget( s_done ); |
546 | quickLayout->addWidget( s_run ); | 549 | quickLayout->addWidget( s_run ); |
547 | 550 | ||
548 | quickLayout->addWidget( allopen ); | 551 | quickLayout->addWidget( allopen ); |
549 | quickLayout->addWidget( allclose ); | 552 | quickLayout->addWidget( allclose ); |
550 | quickLayout->addWidget( flat ); | 553 | quickLayout->addWidget( flat ); |
551 | 554 | ||
552 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); | 555 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); |
@@ -566,38 +569,41 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
566 | mTodoListView->setColumnAlignment(2,AlignCenter); | 569 | mTodoListView->setColumnAlignment(2,AlignCenter); |
567 | 570 | ||
568 | mTodoListView->addColumn(i18n("Due Date")); | 571 | mTodoListView->addColumn(i18n("Due Date")); |
569 | mTodoListView->setColumnAlignment(3,AlignLeft); | 572 | mTodoListView->setColumnAlignment(3,AlignLeft); |
570 | mTodoListView->addColumn(i18n("Due Time")); | 573 | mTodoListView->addColumn(i18n("Due Time")); |
571 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 574 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
572 | 575 | ||
573 | mTodoListView->addColumn(i18n("Start Date")); | 576 | mTodoListView->addColumn(i18n("Start Date")); |
574 | mTodoListView->setColumnAlignment(5,AlignLeft); | 577 | mTodoListView->setColumnAlignment(5,AlignLeft); |
575 | mTodoListView->addColumn(i18n("Start Time")); | 578 | mTodoListView->addColumn(i18n("Start Time")); |
576 | mTodoListView->setColumnAlignment(6,AlignHCenter); | 579 | mTodoListView->setColumnAlignment(6,AlignHCenter); |
577 | 580 | ||
578 | mTodoListView->addColumn(i18n("Cancelled")); | 581 | //mTodoListView->addColumn(i18n("Cancelled")); |
579 | mTodoListView->addColumn(i18n("Categories")); | 582 | mTodoListView->addColumn(i18n("Categories")); |
580 | mTodoListView->addColumn(i18n("Calendar")); | 583 | mTodoListView->addColumn(i18n("Calendar")); |
584 | mTodoListView->addColumn(i18n("Last Modified")); | ||
585 | mTodoListView->addColumn(i18n("Created")); | ||
586 | mTodoListView->addColumn(i18n("Last Modified Sub")); | ||
581 | #if 0 | 587 | #if 0 |
582 | mTodoListView->addColumn(i18n("Sort Id")); | 588 | mTodoListView->addColumn(i18n("Sort Id")); |
583 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 589 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
584 | #endif | 590 | #endif |
585 | 591 | ||
586 | mTodoListView->setMinimumHeight( 60 ); | 592 | mTodoListView->setMinimumHeight( 60 ); |
587 | mTodoListView->setItemsRenameable( true ); | 593 | mTodoListView->setItemsRenameable( true ); |
588 | mTodoListView->setRenameable( 0 ); | 594 | mTodoListView->setRenameable( 0 ); |
589 | mTodoListView->setColumnWidth( 0, 120 ); | 595 | mTodoListView->setColumnWidth( 0, 120 ); |
590 | int iii = 0; | 596 | int iii = 0; |
591 | for ( iii = 0; iii< 10 ; ++iii ) | 597 | for ( iii = 0; iii< 12 ; ++iii ) |
592 | mTodoListView->setColumnWidthMode( iii, QListView::Manual ); | 598 | mTodoListView->setColumnWidthMode( iii, QListView::Manual ); |
593 | 599 | ||
594 | 600 | ||
595 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); | 601 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); |
596 | 602 | ||
597 | mPriorityPopupMenu = new QPopupMenu(this); | 603 | mPriorityPopupMenu = new QPopupMenu(this); |
598 | for (int i = 1; i <= 5; i++) { | 604 | for (int i = 1; i <= 5; i++) { |
599 | QString label = QString ("%1").arg (i); | 605 | QString label = QString ("%1").arg (i); |
600 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; | 606 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; |
601 | } | 607 | } |
602 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); | 608 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); |
603 | 609 | ||
@@ -1594,33 +1600,33 @@ void KOTodoView::addQuickTodoPar( Todo * parentTodo) | |||
1594 | } | 1600 | } |
1595 | } | 1601 | } |
1596 | mCalendar->addTodo(todo); | 1602 | mCalendar->addTodo(todo); |
1597 | mQuickAdd->setText(""); | 1603 | mQuickAdd->setText(""); |
1598 | todoModified (todo, KOGlobals::EVENTADDED ); | 1604 | todoModified (todo, KOGlobals::EVENTADDED ); |
1599 | updateView(); | 1605 | updateView(); |
1600 | 1606 | ||
1601 | } | 1607 | } |
1602 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1608 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1603 | { | 1609 | { |
1604 | // e->ignore(); | 1610 | // e->ignore(); |
1605 | //return; | 1611 | //return; |
1606 | //qDebug("KOTodoView::keyPressEvent "); | ||
1607 | if ( !isVisible() ) { | 1612 | if ( !isVisible() ) { |
1608 | e->ignore(); | 1613 | e->ignore(); |
1609 | return; | 1614 | return; |
1610 | } | 1615 | } |
1611 | switch ( e->key() ) { | 1616 | switch ( e->key() ) { |
1612 | case Qt::Key_Down: | 1617 | case Qt::Key_Down: |
1613 | case Qt::Key_Up: | 1618 | case Qt::Key_Up: |
1614 | QWidget::keyPressEvent ( e ); | 1619 | // KOrg::BaseView::keyPressEvent ( e ); |
1620 | e->ignore(); | ||
1615 | break; | 1621 | break; |
1616 | 1622 | ||
1617 | case Qt::Key_Q: | 1623 | case Qt::Key_Q: |
1618 | 1624 | ||
1619 | 1625 | ||
1620 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) { | 1626 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) { |
1621 | e->ignore(); | 1627 | e->ignore(); |
1622 | break; | 1628 | break; |
1623 | } | 1629 | } |
1624 | toggleQuickTodo(); | 1630 | toggleQuickTodo(); |
1625 | break; | 1631 | break; |
1626 | case Qt::Key_U: | 1632 | case Qt::Key_U: |
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 0cf6e4c..bdef94c 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -144,28 +144,44 @@ void KOTodoViewItem::construct() | |||
144 | QTime t = mTodo->dtStart().time(); | 144 | QTime t = mTodo->dtStart().time(); |
145 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); | 145 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); |
146 | 146 | ||
147 | } | 147 | } |
148 | 148 | ||
149 | } | 149 | } |
150 | } | 150 | } |
151 | setText(5,keyd); | 151 | setText(5,keyd); |
152 | setText(6,keyt); | 152 | setText(6,keyt); |
153 | setSortKey(5,skeyd); | 153 | setSortKey(5,skeyd); |
154 | setSortKey(6,skeyt); | 154 | setSortKey(6,skeyt); |
155 | 155 | ||
156 | setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); | 156 | //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); |
157 | setText(8,mTodo->categoriesStr()); | 157 | setText(7,mTodo->categoriesStr()); |
158 | setText(9,KOPrefs::instance()->calName( mTodo->calID())); | 158 | setText(8,KOPrefs::instance()->calName( mTodo->calID())); |
159 | 159 | setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true )); | |
160 | setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); | ||
161 | setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); | ||
162 | QString key; | ||
163 | QDate d = mTodo->lastModified().date(); | ||
164 | QTime t = mTodo->lastModified().time(); | ||
165 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
166 | setSortKey(9,key); | ||
167 | d = mTodo->created().date(); | ||
168 | t = mTodo->created().time(); | ||
169 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
170 | setSortKey(10,key); | ||
171 | d = mTodo->lastModifiedSub().date(); | ||
172 | t = mTodo->lastModifiedSub().time(); | ||
173 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
174 | setSortKey(11,key); | ||
175 | |||
160 | #if 0 | 176 | #if 0 |
161 | // Find sort id in description. It's the text behind the last '#' character | 177 | // Find sort id in description. It's the text behind the last '#' character |
162 | // found in the description. White spaces are removed from beginning and end | 178 | // found in the description. White spaces are removed from beginning and end |
163 | // of sort id. | 179 | // of sort id. |
164 | int pos = mTodo->description().findRev('#'); | 180 | int pos = mTodo->description().findRev('#'); |
165 | if (pos < 0) { | 181 | if (pos < 0) { |
166 | setText(6,""); | 182 | setText(6,""); |
167 | } else { | 183 | } else { |
168 | QString str = mTodo->description().mid(pos+1); | 184 | QString str = mTodo->description().mid(pos+1); |
169 | str.stripWhiteSpace(); | 185 | str.stripWhiteSpace(); |
170 | setText(6,str); | 186 | setText(6,str); |
171 | } | 187 | } |
@@ -308,61 +324,95 @@ void KOTodoViewItem::stateChange(bool state) | |||
308 | } else { | 324 | } else { |
309 | QListViewItem * myChild = parent(); | 325 | QListViewItem * myChild = parent(); |
310 | if ( myChild ) | 326 | if ( myChild ) |
311 | (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); | 327 | (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); |
312 | } | 328 | } |
313 | mTodoView->modified(true); | 329 | mTodoView->modified(true); |
314 | setMyPixmap(); | 330 | setMyPixmap(); |
315 | mTodoView->setTodoModified( mTodo ); | 331 | mTodoView->setTodoModified( mTodo ); |
316 | } | 332 | } |
317 | 333 | ||
318 | bool KOTodoViewItem::isAlternate() | 334 | bool KOTodoViewItem::isAlternate() |
319 | { | 335 | { |
320 | 336 | #if 0 | |
337 | //if ( m_known ) return m_odd; | ||
338 | //qDebug("test "); | ||
339 | KOTodoViewItem *item = static_cast<KOTodoViewItem *>(itemAbove()); | ||
340 | if ( item ) { | ||
341 | m_known = item->m_known; | ||
342 | if ( m_known ) { | ||
343 | m_odd = !item->m_odd ; | ||
344 | return m_odd; | ||
345 | } | ||
346 | } else { | ||
347 | item = static_cast<KOTodoViewItem *>(itemBelow()); | ||
348 | if ( item ) { | ||
349 | m_known = item->m_known; | ||
350 | if ( m_known ) { | ||
351 | m_odd = !item->m_odd ; | ||
352 | return m_odd; | ||
353 | } | ||
354 | } | ||
355 | } | ||
321 | KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); | 356 | KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); |
322 | if (lv && lv->alternateBackground().isValid()) | 357 | item = static_cast<KOTodoViewItem *>(lv->firstChild()); |
358 | bool previous = true; | ||
359 | qDebug("WHILE "); | ||
360 | while ( item ) { | ||
361 | item->m_odd = !previous; | ||
362 | item->m_known = true; | ||
363 | previous = !previous; | ||
364 | item = static_cast<KOTodoViewItem *>(item->itemBelow()); | ||
365 | } | ||
366 | return m_odd; | ||
367 | |||
368 | #else | ||
369 | |||
370 | //KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); | ||
371 | //if (lv && lv->alternateBackground().isValid()) | ||
323 | { | 372 | { |
324 | KOTodoViewItem *above = 0; | 373 | KOTodoViewItem *above = static_cast<KOTodoViewItem *>(itemAbove()); |
325 | above = static_cast<KOTodoViewItem *>(itemAbove()); | ||
326 | m_known = above ? above->m_known : true; | 374 | m_known = above ? above->m_known : true; |
327 | if (m_known) | 375 | if (m_known) |
328 | { | 376 | { |
329 | m_odd = above ? !above->m_odd : false; | 377 | m_odd = above ? !above->m_odd : false; |
330 | } | 378 | } |
331 | else | 379 | else |
332 | { | 380 | { |
333 | KOTodoViewItem *item; | 381 | KOTodoViewItem *item; |
334 | bool previous = true; | 382 | bool previous = true; |
335 | if (QListViewItem::parent()) | 383 | if (QListViewItem::parent()) |
336 | { | 384 | { |
337 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); | 385 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); |
338 | if (item) | 386 | if (item) |
339 | previous = item->m_odd; | 387 | previous = item->m_odd; |
340 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); | 388 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); |
341 | } | 389 | } |
342 | else | 390 | else |
343 | { | 391 | { |
392 | KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); | ||
344 | item = static_cast<KOTodoViewItem *>(lv->firstChild()); | 393 | item = static_cast<KOTodoViewItem *>(lv->firstChild()); |
345 | } | 394 | } |
346 | 395 | ||
347 | while(item) | 396 | while(item) |
348 | { | 397 | { |
349 | item->m_odd = previous = !previous; | 398 | item->m_odd = previous = !previous; |
350 | item->m_known = true; | 399 | item->m_known = true; |
351 | item = static_cast<KOTodoViewItem *>(item->nextSibling()); | 400 | item = static_cast<KOTodoViewItem *>(item->nextSibling()); |
352 | } | 401 | } |
353 | } | 402 | } |
354 | return m_odd; | 403 | return m_odd; |
355 | } | 404 | } |
356 | return false; | 405 | return false; |
406 | #endif | ||
357 | } | 407 | } |
358 | 408 | ||
359 | void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) | 409 | void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) |
360 | { | 410 | { |
361 | QColorGroup _cg = cg; | 411 | QColorGroup _cg = cg; |
362 | QColorGroup::ColorRole role; | 412 | QColorGroup::ColorRole role; |
363 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor && !mTodo->isRunning()) | 413 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor && !mTodo->isRunning()) |
364 | role = QColorGroup::Text; | 414 | role = QColorGroup::Text; |
365 | else | 415 | else |
366 | role = QColorGroup::Base; | 416 | role = QColorGroup::Base; |
367 | //#ifndef KORG_NOLVALTERNATION | 417 | //#ifndef KORG_NOLVALTERNATION |
368 | if (isAlternate()) | 418 | if (isAlternate()) |
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 11f7ecc..e4bcc5e 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -272,25 +272,45 @@ void Incidence::cloneRelations( Incidence * newInc ) | |||
272 | for (inc=Relations.first();inc;inc=Relations.next()) { | 272 | for (inc=Relations.first();inc;inc=Relations.next()) { |
273 | cloneInc = inc->clone(); | 273 | cloneInc = inc->clone(); |
274 | cloneInc->recreate(); | 274 | cloneInc->recreate(); |
275 | cloneInc->setRelatedTo( newInc ); | 275 | cloneInc->setRelatedTo( newInc ); |
276 | inc->cloneRelations( cloneInc ); | 276 | inc->cloneRelations( cloneInc ); |
277 | } | 277 | } |
278 | } | 278 | } |
279 | void Incidence::setReadOnly( bool readOnly ) | 279 | void Incidence::setReadOnly( bool readOnly ) |
280 | { | 280 | { |
281 | IncidenceBase::setReadOnly( readOnly ); | 281 | IncidenceBase::setReadOnly( readOnly ); |
282 | recurrence()->setRecurReadOnly( readOnly); | 282 | recurrence()->setRecurReadOnly( readOnly); |
283 | } | 283 | } |
284 | 284 | void Incidence::setLastModifiedSubInvalid() | |
285 | { | ||
286 | mLastModifiedSub = QDateTime(); | ||
287 | if ( mRelatedTo ) | ||
288 | mRelatedTo->setLastModifiedSubInvalid(); | ||
289 | } | ||
290 | QDateTime Incidence::lastModifiedSub() | ||
291 | { | ||
292 | if ( !mRelations.count() ) | ||
293 | return lastModified(); | ||
294 | if ( mLastModifiedSub.isValid() ) | ||
295 | return mLastModifiedSub; | ||
296 | mLastModifiedSub = lastModified(); | ||
297 | Incidence * inc; | ||
298 | QPtrList<Incidence> Relations = relations(); | ||
299 | for (inc=Relations.first();inc;inc=Relations.next()) { | ||
300 | if ( inc->lastModifiedSub() > mLastModifiedSub ) | ||
301 | mLastModifiedSub = inc->lastModifiedSub(); | ||
302 | } | ||
303 | return mLastModifiedSub; | ||
304 | } | ||
285 | void Incidence::setCreated(QDateTime created) | 305 | void Incidence::setCreated(QDateTime created) |
286 | { | 306 | { |
287 | if (mReadOnly) return; | 307 | if (mReadOnly) return; |
288 | mCreated = getEvenTime(created); | 308 | mCreated = getEvenTime(created); |
289 | } | 309 | } |
290 | 310 | ||
291 | QDateTime Incidence::created() const | 311 | QDateTime Incidence::created() const |
292 | { | 312 | { |
293 | return mCreated; | 313 | return mCreated; |
294 | } | 314 | } |
295 | 315 | ||
296 | void Incidence::setRevision(int rev) | 316 | void Incidence::setRevision(int rev) |
@@ -459,35 +479,35 @@ void Incidence::addRelationsToList(QPtrList<Incidence> *rel) | |||
459 | { | 479 | { |
460 | Incidence* inc; | 480 | Incidence* inc; |
461 | QPtrList<Incidence> Relations = relations(); | 481 | QPtrList<Incidence> Relations = relations(); |
462 | for (inc=Relations.first();inc;inc=Relations.next()) { | 482 | for (inc=Relations.first();inc;inc=Relations.next()) { |
463 | inc->addRelationsToList( rel ); | 483 | inc->addRelationsToList( rel ); |
464 | } | 484 | } |
465 | if ( rel->findRef( this ) == -1 ) | 485 | if ( rel->findRef( this ) == -1 ) |
466 | rel->append( this ); | 486 | rel->append( this ); |
467 | } | 487 | } |
468 | 488 | ||
469 | void Incidence::addRelation(Incidence *event) | 489 | void Incidence::addRelation(Incidence *event) |
470 | { | 490 | { |
491 | setLastModifiedSubInvalid(); | ||
471 | if( mRelations.findRef( event ) == -1 ) { | 492 | if( mRelations.findRef( event ) == -1 ) { |
472 | mRelations.append(event); | 493 | mRelations.append(event); |
473 | //updated(); | 494 | //updated(); |
474 | } | 495 | } |
475 | } | 496 | } |
476 | 497 | ||
477 | void Incidence::removeRelation(Incidence *event) | 498 | void Incidence::removeRelation(Incidence *event) |
478 | { | 499 | { |
479 | 500 | setLastModifiedSubInvalid(); | |
480 | mRelations.removeRef(event); | 501 | mRelations.removeRef(event); |
481 | |||
482 | // if (event->getRelatedTo() == this) event->setRelatedTo(0); | 502 | // if (event->getRelatedTo() == this) event->setRelatedTo(0); |
483 | } | 503 | } |
484 | 504 | ||
485 | bool Incidence::recursOn(const QDate &qd) const | 505 | bool Incidence::recursOn(const QDate &qd) const |
486 | { | 506 | { |
487 | if (recurrence()->recursOnPure(qd) && !isException(qd)) return true; | 507 | if (recurrence()->recursOnPure(qd) && !isException(qd)) return true; |
488 | else return false; | 508 | else return false; |
489 | } | 509 | } |
490 | 510 | ||
491 | void Incidence::setExDates(const DateList &exDates) | 511 | void Incidence::setExDates(const DateList &exDates) |
492 | { | 512 | { |
493 | if (mReadOnly) return; | 513 | if (mReadOnly) return; |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index c88ba2f..d4af9f0 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -268,39 +268,42 @@ class Incidence : public IncidenceBase | |||
268 | bool cancelled() const; | 268 | bool cancelled() const; |
269 | void setCancelled( bool b ); | 269 | void setCancelled( bool b ); |
270 | 270 | ||
271 | bool hasRecurrenceID() const; | 271 | bool hasRecurrenceID() const; |
272 | void setHasRecurrenceID( bool b ); | 272 | void setHasRecurrenceID( bool b ); |
273 | 273 | ||
274 | void setRecurrenceID(QDateTime); | 274 | void setRecurrenceID(QDateTime); |
275 | QDateTime recurrenceID () const; | 275 | QDateTime recurrenceID () const; |
276 | QDateTime dtStart() const; | 276 | QDateTime dtStart() const; |
277 | bool isHoliday() const; | 277 | bool isHoliday() const; |
278 | bool isBirthday() const; | 278 | bool isBirthday() const; |
279 | bool isAnniversary() const; | 279 | bool isAnniversary() const; |
280 | QDateTime lastModifiedSub(); | ||
281 | void setLastModifiedSubInvalid(); | ||
280 | 282 | ||
281 | 283 | ||
282 | protected: | 284 | protected: |
283 | QPtrList<Alarm> mAlarms; | 285 | QPtrList<Alarm> mAlarms; |
284 | QPtrList<Incidence> mRelations; | 286 | QPtrList<Incidence> mRelations; |
285 | QDateTime mRecurrenceID; | 287 | QDateTime mRecurrenceID; |
286 | bool mHasRecurrenceID; | 288 | bool mHasRecurrenceID; |
287 | private: | 289 | private: |
288 | void checkCategories(); | 290 | void checkCategories(); |
289 | bool mHoliday, mBirthday, mAnniversary; | 291 | bool mHoliday, mBirthday, mAnniversary; |
290 | int mRevision; | 292 | int mRevision; |
291 | bool mCancelled; | 293 | bool mCancelled; |
292 | 294 | ||
293 | // base components of jounal, event and todo | 295 | // base components of jounal, event and todo |
294 | QDateTime mCreated; | 296 | QDateTime mCreated; |
297 | QDateTime mLastModifiedSub; | ||
295 | QString mDescription; | 298 | QString mDescription; |
296 | QString mSummary; | 299 | QString mSummary; |
297 | QStringList mCategories; | 300 | QStringList mCategories; |
298 | Incidence *mRelatedTo; | 301 | Incidence *mRelatedTo; |
299 | QString mRelatedToUid; | 302 | QString mRelatedToUid; |
300 | DateList mExDates; | 303 | DateList mExDates; |
301 | QPtrList<Attachment> mAttachments; | 304 | QPtrList<Attachment> mAttachments; |
302 | QStringList mResources; | 305 | QStringList mResources; |
303 | bool mHasStartDate; // if todo has associated start date | 306 | bool mHasStartDate; // if todo has associated start date |
304 | 307 | ||
305 | int mSecrecy; | 308 | int mSecrecy; |
306 | int mPriority; // 1 = highest, 2 = less, etc. | 309 | int mPriority; // 1 = highest, 2 = less, etc. |
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 1a19f3e..022dead 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -182,31 +182,35 @@ bool IncidenceBase::alarmEnabled() const | |||
182 | 182 | ||
183 | 183 | ||
184 | void IncidenceBase::setUid(const QString &uid) | 184 | void IncidenceBase::setUid(const QString &uid) |
185 | { | 185 | { |
186 | mUid = uid; | 186 | mUid = uid; |
187 | updated(); | 187 | updated(); |
188 | } | 188 | } |
189 | 189 | ||
190 | QString IncidenceBase::uid() const | 190 | QString IncidenceBase::uid() const |
191 | { | 191 | { |
192 | return mUid; | 192 | return mUid; |
193 | } | 193 | } |
194 | void IncidenceBase::setLastModifiedSubInvalid() | ||
195 | { | ||
194 | 196 | ||
197 | } | ||
195 | void IncidenceBase::setLastModified(const QDateTime &lm) | 198 | void IncidenceBase::setLastModified(const QDateTime &lm) |
196 | { | 199 | { |
197 | if ( blockLastModified ) return; | 200 | if ( blockLastModified ) return; |
198 | // DON'T! updated() because we call this from | 201 | // DON'T! updated() because we call this from |
199 | // Calendar::updateEvent(). | 202 | // Calendar::updateEvent(). |
200 | mLastModified = getEvenTime(lm); | 203 | mLastModified = getEvenTime(lm); |
204 | setLastModifiedSubInvalid(); | ||
201 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); | 205 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); |
202 | } | 206 | } |
203 | 207 | ||
204 | QDateTime IncidenceBase::lastModified() const | 208 | QDateTime IncidenceBase::lastModified() const |
205 | { | 209 | { |
206 | return mLastModified; | 210 | return mLastModified; |
207 | } | 211 | } |
208 | 212 | ||
209 | void IncidenceBase::setOrganizer(const QString &o) | 213 | void IncidenceBase::setOrganizer(const QString &o) |
210 | { | 214 | { |
211 | // we don't check for readonly here, because it is | 215 | // we don't check for readonly here, because it is |
212 | // possible that by setting the organizer we are changing | 216 | // possible that by setting the organizer we are changing |
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index bed73db..665c1f6 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h | |||
@@ -140,24 +140,25 @@ class IncidenceBase : public CustomProperties | |||
140 | 140 | ||
141 | void registerObserver( Observer * ); | 141 | void registerObserver( Observer * ); |
142 | void unRegisterObserver( Observer * ); | 142 | void unRegisterObserver( Observer * ); |
143 | void updated(); | 143 | void updated(); |
144 | void setCalID( int id ); | 144 | void setCalID( int id ); |
145 | int calID() const; | 145 | int calID() const; |
146 | void setCalEnabled( bool ); | 146 | void setCalEnabled( bool ); |
147 | bool calEnabled() const; | 147 | bool calEnabled() const; |
148 | void setAlarmEnabled( bool ); | 148 | void setAlarmEnabled( bool ); |
149 | bool alarmEnabled() const; | 149 | bool alarmEnabled() const; |
150 | bool isTagged() const; | 150 | bool isTagged() const; |
151 | void setTagged( bool ); | 151 | void setTagged( bool ); |
152 | virtual void setLastModifiedSubInvalid(); | ||
152 | protected: | 153 | protected: |
153 | bool blockLastModified; | 154 | bool blockLastModified; |
154 | bool mIsTagged; | 155 | bool mIsTagged; |
155 | QDateTime mDtStart; | 156 | QDateTime mDtStart; |
156 | bool mReadOnly; | 157 | bool mReadOnly; |
157 | QDateTime getEvenTime( QDateTime ); | 158 | QDateTime getEvenTime( QDateTime ); |
158 | 159 | ||
159 | private: | 160 | private: |
160 | // base components | 161 | // base components |
161 | QString mOrganizer; | 162 | QString mOrganizer; |
162 | QString mUid; | 163 | QString mUid; |
163 | int mCalID; | 164 | int mCalID; |
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 5d83511..7f352d6 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp | |||
@@ -467,22 +467,23 @@ void KDatePicker::keyPressEvent ( QKeyEvent * e ) | |||
467 | break; | 467 | break; |
468 | 468 | ||
469 | case Qt::Key_Down: | 469 | case Qt::Key_Down: |
470 | yearForwardClicked(); | 470 | yearForwardClicked(); |
471 | 471 | ||
472 | break; | 472 | break; |
473 | 473 | ||
474 | case Qt::Key_Up: | 474 | case Qt::Key_Up: |
475 | yearBackwardClicked(); | 475 | yearBackwardClicked(); |
476 | break; | 476 | break; |
477 | 477 | ||
478 | case Qt::Key_Return: | 478 | case Qt::Key_Return: |
479 | case Qt::Key_Enter: | ||
479 | tableClickedSlot(); | 480 | tableClickedSlot(); |
480 | break; | 481 | break; |
481 | case Qt::Key_Escape: | 482 | case Qt::Key_Escape: |
482 | e->ignore(); | 483 | e->ignore(); |
483 | break; | 484 | break; |
484 | default: | 485 | default: |
485 | break; | 486 | break; |
486 | } | 487 | } |
487 | 488 | ||
488 | } | 489 | } |