summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Unidiff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 43e1113..517677c 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -393,97 +393,98 @@ QString KOListView::getWhatsThisText(QPoint p)
393 KOPrefs::instance()->mWTshowChanged); 393 KOPrefs::instance()->mWTshowChanged);
394 return i18n("That is the list view" ); 394 return i18n("That is the list view" );
395 395
396} 396}
397 397
398void KOListView::setCalendar( int c ) 398void KOListView::setCalendar( int c )
399{ 399{
400 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), 400 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
401 i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ), 401 i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ),
402 i18n("Continue"), i18n("Cancel"), 0, 402 i18n("Continue"), i18n("Cancel"), 0,
403 0, 1 ); 403 0, 1 );
404 if ( result != 0 ) { 404 if ( result != 0 ) {
405 return; 405 return;
406 } 406 }
407 407
408 QPtrList<Incidence> delSel = getSelectedIncidences() ; 408 QPtrList<Incidence> delSel = getSelectedIncidences() ;
409 int icount = delSel.count(); 409 int icount = delSel.count();
410 if ( icount ) { 410 if ( icount ) {
411 Incidence *incidence = delSel.first(); 411 Incidence *incidence = delSel.first();
412 while ( incidence ) { 412 while ( incidence ) {
413 incidence->setCalID( c ); 413 incidence->setCalID( c );
414 KOListViewItem * item = getItemForEvent( incidence ); 414 KOListViewItem * item = getItemForEvent( incidence );
415 if ( item ) { 415 if ( item ) {
416 ListItemVisitor v(item, mStartDate ); 416 ListItemVisitor v(item, mStartDate );
417 incidence->accept(v); 417 incidence->accept(v);
418 } 418 }
419 incidence = delSel.next(); 419 incidence = delSel.next();
420 } 420 }
421 } 421 }
422 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 422 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
423 KopiCalendarFile * cal = calendars.first(); 423 KopiCalendarFile * cal = calendars.first();
424 while ( cal ) { 424 while ( cal ) {
425 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 425 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
426 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 426 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
427 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 427 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
428 if ( cal->isStandard ) 428 if ( cal->isStandard )
429 mCalendar->setDefaultCalendar( cal->mCalNumber ); 429 mCalendar->setDefaultCalendar( cal->mCalNumber );
430 cal = calendars.next(); 430 cal = calendars.next();
431 } 431 }
432 mCalendar->setSyncEventsReadOnly(); 432 mCalendar->setSyncEventsReadOnly();
433 mCalendar->reInitAlarmSettings(); 433 mCalendar->reInitAlarmSettings();
434 434
435} 435}
436void KOListView::populateCalPopup() 436void KOListView::populateCalPopup()
437{ 437{
438 mCalPopup->clear(); 438 mCalPopup->clear();
439 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 439 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
440 while ( kkf ) { 440 while ( kkf ) {
441 mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); 441 int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
442 mCalPopup->setItemEnabled( index, !kkf->isReadOnly );
442 kkf = KOPrefs::instance()->mCalendars.next(); 443 kkf = KOPrefs::instance()->mCalendars.next();
443 } 444 }
444} 445}
445void KOListView::updateList() 446void KOListView::updateList()
446{ 447{
447 // qDebug(" KOListView::updateList() "); 448 // qDebug(" KOListView::updateList() ");
448 449
449} 450}
450 451
451void KOListView::clearList() 452void KOListView::clearList()
452{ 453{
453 clear (); 454 clear ();
454} 455}
455void KOListView::addCat( ) 456void KOListView::addCat( )
456{ 457{
457 setCategories( false ); 458 setCategories( false );
458} 459}
459void KOListView::setCat() 460void KOListView::setCat()
460{ 461{
461 setCategories( true ); 462 setCategories( true );
462} 463}
463 464
464void KOListView::setAlarm() 465void KOListView::setAlarm()
465{ 466{
466 KOAlarmPrefs kap( this); 467 KOAlarmPrefs kap( this);
467 if ( !kap.exec() ) 468 if ( !kap.exec() )
468 return; 469 return;
469 QStringList itemList; 470 QStringList itemList;
470 QPtrList<KOListViewItem> sel ; 471 QPtrList<KOListViewItem> sel ;
471 QListViewItem *qitem = mListView->firstChild (); 472 QListViewItem *qitem = mListView->firstChild ();
472 while ( qitem ) { 473 while ( qitem ) {
473 if ( qitem->isSelected() ) { 474 if ( qitem->isSelected() ) {
474 Incidence* inc = ((KOListViewItem *) qitem)->data(); 475 Incidence* inc = ((KOListViewItem *) qitem)->data();
475 if ( inc->typeID() != journalID ) { 476 if ( inc->typeID() != journalID ) {
476 if ( inc->typeID() == todoID ) { 477 if ( inc->typeID() == todoID ) {
477 if ( ((Todo*)inc)->hasDueDate() ) 478 if ( ((Todo*)inc)->hasDueDate() )
478 sel.append(((KOListViewItem *)qitem)); 479 sel.append(((KOListViewItem *)qitem));
479 } else 480 } else
480 sel.append(((KOListViewItem *)qitem)); 481 sel.append(((KOListViewItem *)qitem));
481 } 482 }
482 } 483 }
483 qitem = qitem->nextSibling(); 484 qitem = qitem->nextSibling();
484 } 485 }
485 int count = 0; 486 int count = 0;
486 KOListViewItem * item, *temp; 487 KOListViewItem * item, *temp;
487 item = sel.first(); 488 item = sel.first();
488 Incidence* inc; 489 Incidence* inc;
489 while ( item ) { 490 while ( item ) {