summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp16
-rw-r--r--korganizer/koviewmanager.cpp5
2 files changed, 20 insertions, 1 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 83a57ca..1474e4b 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -78,16 +78,17 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
78 78
79 int i; 79 int i;
80 80
81 // Set up the heading fields. 81 // Set up the heading fields.
82 for( i = 0; i < 7; i++ ) { 82 for( i = 0; i < 7; i++ ) {
83 headings[i] = new QLabel("",this); 83 headings[i] = new QLabel("",this);
84 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); 84 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
85 headings[i]->setAlignment(AlignCenter); 85 headings[i]->setAlignment(AlignCenter);
86 headings[i]->installEventFilter(this);
86 87
87 topLayout->addWidget(headings[i],1,i+1); 88 topLayout->addWidget(headings[i],1,i+1);
88 } 89 }
89 90
90 // Create the weeknumber labels 91 // Create the weeknumber labels
91 for( i = 0; i < 6; i++ ) { 92 for( i = 0; i < 6; i++ ) {
92 weeknos[i] = new QLabel(this); 93 weeknos[i] = new QLabel(this);
93 weeknos[i]->setAlignment(AlignCenter); 94 weeknos[i]->setAlignment(AlignCenter);
@@ -434,15 +435,30 @@ bool KDateNavigator::eventFilter (QObject *o,QEvent *e)
434 int i; 435 int i;
435 for(i=0;i<6;++i) { 436 for(i=0;i<6;++i) {
436 if (o == weeknos[i]) { 437 if (o == weeknos[i]) {
437 QDate weekstart = daymatrix->getDate(i*7); 438 QDate weekstart = daymatrix->getDate(i*7);
438 emit weekClicked(weekstart); 439 emit weekClicked(weekstart);
439 break; 440 break;
440 } 441 }
441 } 442 }
443 for(i=0;i<7;++i) {
444 if (o == headings[i]) {
445 KCal::DateList selDays;
446 QDate date = daymatrix->getDate(14);
447 int dio = date.daysInMonth();
448 int j;
449 int ye = date.year();
450 int mo = date.month();
451 for ( j = 1; j <= dio; ++j ) {
452 selDays.append( QDate( ye, mo, j ) );
453 }
454 emit datesSelected( selDays );
455 break;
456 }
457 }
442 return true; 458 return true;
443 } else { 459 } else {
444 return false; 460 return false;
445 } 461 }
446} 462}
447 463
448//#include "kdatenavigator.moc" 464//#include "kdatenavigator.moc"
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index a9f5a41..cc0ce9b 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -415,33 +415,35 @@ void KOViewManager::showAgendaView( bool fullScreen )
415 mAgendaView->updateConfig(); 415 mAgendaView->updateConfig();
416 } 416 }
417 417
418 showView( mAgendaView, full); 418 showView( mAgendaView, full);
419 419
420} 420}
421 421
422void KOViewManager::showDayView() 422void KOViewManager::showDayView()
423{ 423{
424 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
424 mFlagShowNextxDays = false; 425 mFlagShowNextxDays = false;
425 globalFlagBlockLabel = 1; 426 globalFlagBlockLabel = 1;
426 globalFlagBlockAgenda = 1; 427 globalFlagBlockAgenda = 1;
427 if ( mCurrentAgendaView != 1 ) 428 if ( mCurrentAgendaView != 1 )
428 mCurrentAgendaView = -1; 429 mCurrentAgendaView = -1;
429 showAgendaView(); 430 showAgendaView();
430 qApp->processEvents(); 431 qApp->processEvents();
431 globalFlagBlockAgenda = 2; 432 globalFlagBlockAgenda = 2;
432 globalFlagBlockLabel = 0; 433 globalFlagBlockLabel = 0;
433 mMainView->dateNavigator()->selectDates( 1 ); 434 mMainView->dateNavigator()->selectDates( 1 );
434 mCurrentAgendaView = 1 ; 435 mCurrentAgendaView = 1 ;
435 436
436} 437}
437 438
438void KOViewManager::showWorkWeekView() 439void KOViewManager::showWorkWeekView()
439{ 440{
441 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
440 mFlagShowNextxDays = false; 442 mFlagShowNextxDays = false;
441 globalFlagBlockAgenda = 1; 443 globalFlagBlockAgenda = 1;
442 globalFlagBlockLabel = 1; 444 globalFlagBlockLabel = 1;
443 if ( mCurrentAgendaView != 5 ) 445 if ( mCurrentAgendaView != 5 )
444 mCurrentAgendaView = -1; 446 mCurrentAgendaView = -1;
445 showAgendaView(); 447 showAgendaView();
446 qApp->processEvents(); 448 qApp->processEvents();
447 globalFlagBlockAgenda = 2; 449 globalFlagBlockAgenda = 2;
@@ -457,16 +459,17 @@ void KOViewManager::showWeekView()
457 globalFlagBlockAgenda = 2; 459 globalFlagBlockAgenda = 2;
458 qDebug("4globalFlagBlockAgenda = 2; "); 460 qDebug("4globalFlagBlockAgenda = 2; ");
459 //globalFlagBlockPainting = true; 461 //globalFlagBlockPainting = true;
460 mMainView->dateNavigator()->selectWeek(); 462 mMainView->dateNavigator()->selectWeek();
461 showAgendaView(); 463 showAgendaView();
462 */ 464 */
463 465
464 466
467 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
465 mFlagShowNextxDays = false; 468 mFlagShowNextxDays = false;
466 globalFlagBlockAgenda = 1; 469 globalFlagBlockAgenda = 1;
467 globalFlagBlockLabel = 1; 470 globalFlagBlockLabel = 1;
468 if ( mCurrentAgendaView != 7 ) 471 if ( mCurrentAgendaView != 7 )
469 mCurrentAgendaView = -1; 472 mCurrentAgendaView = -1;
470 showAgendaView(); 473 showAgendaView();
471 qApp->processEvents(); 474 qApp->processEvents();
472 globalFlagBlockAgenda = 2; 475 globalFlagBlockAgenda = 2;