summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-19 22:57:42 (UTC)
committer zautrix <zautrix>2005-01-19 22:57:42 (UTC)
commitade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e (patch) (unidiff)
tree990ed560fbf9126fba2abdaf98c036cddad2d94f /korganizer
parenta9f8ad6916ea1a849a43fe49c4085f6c44b5c47b (diff)
downloadkdepimpi-ade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e.zip
kdepimpi-ade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e.tar.gz
kdepimpi-ade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e.tar.bz2
many view fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp22
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/komonthview.cpp89
-rw-r--r--korganizer/komonthview.h8
-rw-r--r--korganizer/koviewmanager.cpp6
5 files changed, 85 insertions, 42 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 12af655..f9af769 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -230,12 +230,13 @@ CalendarView::CalendarView( Calendar *calendar,
230 mEventEditor = 0; 230 mEventEditor = 0;
231 mTodoEditor = 0; 231 mTodoEditor = 0;
232 init();} 232 init();}
233 233
234void CalendarView::init() 234void CalendarView::init()
235{ 235{
236 mBlockShowDates = false;
236 beamDialog = new KOBeamPrefs(); 237 beamDialog = new KOBeamPrefs();
237 mDatePickerMode = 0; 238 mDatePickerMode = 0;
238 mCurrentSyncDevice = ""; 239 mCurrentSyncDevice = "";
239 writeLocale(); 240 writeLocale();
240 mViewManager = new KOViewManager( this ); 241 mViewManager = new KOViewManager( this );
241 mDialogManager = new KODialogManager( this ); 242 mDialogManager = new KODialogManager( this );
@@ -343,27 +344,27 @@ void CalendarView::init()
343 mDateNavigator->hide(); 344 mDateNavigator->hide();
344 //qDebug("Calendarview Size %d %d ", width(), height()); 345 //qDebug("Calendarview Size %d %d ", width(), height());
345#endif 346#endif
346 347
347 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 348 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
348 SLOT( showDates( const KCal::DateList & ) ) ); 349 SLOT( showDates( const KCal::DateList & ) ) );
350
349 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 351 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
350 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 352 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
351
352 connect( mNavigatorBar, SIGNAL( goPrevYear() ), 353 connect( mNavigatorBar, SIGNAL( goPrevYear() ),
353 mNavigator, SLOT( selectPreviousYear() ) ); 354 mNavigator, SLOT( selectPreviousYear() ) );
354 connect( mNavigatorBar, SIGNAL( goNextYear() ), 355 connect( mNavigatorBar, SIGNAL( goNextYear() ),
355 mNavigator, SLOT( selectNextYear() ) ); 356 mNavigator, SLOT( selectNextYear() ) );
356 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), 357 connect( mNavigatorBar, SIGNAL( goPrevMonth() ),
357 mNavigator, SLOT( selectPreviousMonth() ) ); 358 mNavigator, SLOT( selectPreviousMonth() ) );
358 connect( mNavigatorBar, SIGNAL( goNextMonth() ), 359 connect( mNavigatorBar, SIGNAL( goNextMonth() ),
359 mNavigator, SLOT( selectNextMonth() ) ); 360 mNavigator, SLOT( selectNextMonth() ) );
360 361
361 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 362 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
362 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); 363 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) );
363 364
364 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 365 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
365 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 366 mNavigator, SLOT( selectWeek( const QDate & ) ) );
366 367
367 connect( mDateNavigator, SIGNAL( goPrevYear() ), 368 connect( mDateNavigator, SIGNAL( goPrevYear() ),
368 mNavigator, SLOT( selectPreviousYear() ) ); 369 mNavigator, SLOT( selectPreviousYear() ) );
369 connect( mDateNavigator, SIGNAL( goNextYear() ), 370 connect( mDateNavigator, SIGNAL( goNextYear() ),
@@ -494,13 +495,15 @@ CalendarView::~CalendarView()
494 delete beamDialog; 495 delete beamDialog;
495 //kdDebug() << "~CalendarView() done" << endl; 496 //kdDebug() << "~CalendarView() done" << endl;
496} 497}
497 498
498void CalendarView::showDay( QDate d ) 499void CalendarView::showDay( QDate d )
499{ 500{
501 dateNavigator()->blockSignals( true );
500 dateNavigator()->selectDate( d ); 502 dateNavigator()->selectDate( d );
503 dateNavigator()->blockSignals( false );
501 mViewManager->showWeekView(); 504 mViewManager->showWeekView();
502 dateNavigator()->selectDate( d ); 505 dateNavigator()->selectDate( d );
503} 506}
504void CalendarView::timerAlarm() 507void CalendarView::timerAlarm()
505{ 508{
506 //qDebug("CalendarView::timerAlarm() "); 509 //qDebug("CalendarView::timerAlarm() ");
@@ -669,13 +672,15 @@ void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
669 return; 672 return;
670 } 673 }
671 mAlarmTimer->stop(); 674 mAlarmTimer->stop();
672} 675}
673void CalendarView::selectWeekNum ( int num ) 676void CalendarView::selectWeekNum ( int num )
674{ 677{
678 dateNavigator()->blockSignals( true );
675 dateNavigator()->selectWeek( num ); 679 dateNavigator()->selectWeek( num );
680 dateNavigator()->blockSignals( false );
676 mViewManager->showWeekView(); 681 mViewManager->showWeekView();
677} 682}
678KOViewManager *CalendarView::viewManager() 683KOViewManager *CalendarView::viewManager()
679{ 684{
680 return mViewManager; 685 return mViewManager;
681} 686}
@@ -3462,16 +3467,19 @@ void CalendarView::checkClipboard()
3462} 3467}
3463 3468
3464void CalendarView::showDates(const DateList &selectedDates) 3469void CalendarView::showDates(const DateList &selectedDates)
3465{ 3470{
3466 // kdDebug() << "CalendarView::selectDates()" << endl; 3471 // kdDebug() << "CalendarView::selectDates()" << endl;
3467 3472
3468 if ( mViewManager->currentView() ) { 3473
3469 updateView( selectedDates.first(), selectedDates.last() ); 3474 if ( !mBlockShowDates ) {
3470 } else { 3475 if ( mViewManager->currentView() ) {
3471 mViewManager->showAgendaView(); 3476 updateView( selectedDates.first(), selectedDates.last() );
3477 } else {
3478 mViewManager->showAgendaView();
3479 }
3472 } 3480 }
3473 3481
3474 QString selDates; 3482 QString selDates;
3475 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); 3483 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true);
3476 if (selectedDates.first() < selectedDates.last() ) 3484 if (selectedDates.first() < selectedDates.last() )
3477 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 3485 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 646973d..e27da9a 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -477,23 +477,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
477 * current view. 477 * current view.
478 */ 478 */
479 void adaptNavigationUnits(); 479 void adaptNavigationUnits();
480 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); 480 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
481 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); 481 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
482 //Attendee* getYourAttendee(Event *event); 482 //Attendee* getYourAttendee(Event *event);
483 void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
483 protected: 484 protected:
484 void schedule(Scheduler::Method, Incidence *incidence = 0); 485 void schedule(Scheduler::Method, Incidence *incidence = 0);
485 486
486 // returns KMsgBox::OKCandel() 487 // returns KMsgBox::OKCandel()
487 int msgItemDelete(); 488 int msgItemDelete();
488 void showEventEditor(); 489 void showEventEditor();
489 void showTodoEditor(); 490 void showTodoEditor();
490 void writeLocale(); 491 void writeLocale();
491 Todo *selectedTodo(); 492 Todo *selectedTodo();
492 493
493 private: 494 private:
495 bool mBlockShowDates;
494 KSyncManager* mSyncManager; 496 KSyncManager* mSyncManager;
495 AlarmDialog * mAlarmDialog; 497 AlarmDialog * mAlarmDialog;
496 QString mAlarmNotification; 498 QString mAlarmNotification;
497 QString mSuspendAlarmNotification; 499 QString mSuspendAlarmNotification;
498 QTimer* mSuspendTimer; 500 QTimer* mSuspendTimer;
499 QTimer* mAlarmTimer; 501 QTimer* mAlarmTimer;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 9344567..842f6eb 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -76,15 +76,18 @@ private:
76KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 76KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
77 : QListBox(parent, name) 77 : QListBox(parent, name)
78{ 78{
79#ifndef DESKTOP_VERSION 79#ifndef DESKTOP_VERSION
80 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 80 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
81#endif 81#endif
82 new KNOWhatsThis(this); 82 mWT = new KNOWhatsThis(this);
83}
84KNoScrollListBox::~KNoScrollListBox()
85{
86 delete mWT;
83} 87}
84
85QString KNoScrollListBox::getWhatsThisText(QPoint p) 88QString KNoScrollListBox::getWhatsThisText(QPoint p)
86{ 89{
87 QListBoxItem* item = itemAt ( p ); 90 QListBoxItem* item = itemAt ( p );
88 if ( ! item ) { 91 if ( ! item ) {
89 return i18n("Click in the cell\nto add an event!"); 92 return i18n("Click in the cell\nto add an event!");
90 } 93 }
@@ -305,26 +308,15 @@ QToolTipGroup *MonthViewCell::toolTipGroup()
305} 308}
306#endif 309#endif
307 310
308void MonthViewCell::setDate( const QDate &date ) 311void MonthViewCell::setDate( const QDate &date )
309{ 312{
310// kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; 313// kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl;
311
312 mDate = date; 314 mDate = date;
313 315
314 QString text; 316
315 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
316 if ( KOGlobals::self()->calendarSystem()->day( date ) == 1 || (date.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
317 text = KOGlobals::self()->calendarSystem()->monthName( date, true ) + " ";
318 mLabel->resize( mLabelBigSize );
319 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
320 } else {
321 mLabel->resize( mLabelSize );
322 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
323 }
324 mLabel->setText( text );
325 317
326 //resizeEvent( 0 ); 318 //resizeEvent( 0 );
327} 319}
328 320
329QDate MonthViewCell::date() const 321QDate MonthViewCell::date() const
330{ 322{
@@ -389,21 +381,28 @@ void MonthViewCell::keyPressEvent ( QKeyEvent * e )
389 381
390 e->ignore(); 382 e->ignore();
391 383
392} 384}
393void MonthViewCell::updateCell() 385void MonthViewCell::updateCell()
394{ 386{
395 387 if ( !mMonthView->isUpdatePossible() )
388 return;
389 if ( !isVisible() ){
390 return;
391 }
396 setPrimary( mDate.month()%2 ); 392 setPrimary( mDate.month()%2 );
397 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); 393 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays);
398 if ( mDate == QDate::currentDate() ) { 394 if ( mDate == QDate::currentDate() ) {
399 mItemList->setLineWidth( 3 ); 395 mItemList->setLineWidth( 3 );
400 } else { 396 } else {
401 mItemList->setLineWidth( 1 ); 397 mItemList->setLineWidth( 1 );
402 } 398 }
403 mItemList->clear(); 399 mItemList->clear();
400
401
402
404#ifdef DESKTOP_VERSION 403#ifdef DESKTOP_VERSION
405 QToolTip::remove(this); 404 QToolTip::remove(this);
406#endif 405#endif
407 QString tipText(""); 406 QString tipText("");
408 //qApp->processEvents(); 407 //qApp->processEvents();
409 if ( !mHolidayString.isEmpty() ) { 408 if ( !mHolidayString.isEmpty() ) {
@@ -412,13 +411,22 @@ void MonthViewCell::updateCell()
412 mItemList->insertItem( item ); 411 mItemList->insertItem( item );
413 tipText += mHolidayString+"\n"; 412 tipText += mHolidayString+"\n";
414 } 413 }
415 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 414 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
416 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); 415 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
417 Event *event; 416 Event *event;
418 for( event = events.first(); event; event = events.next() ) { 417 for( event = events.first(); event; event = events.next() ) { // for event
418
419 if ( !(event->doesRecur() == Recurrence::rNone) ) {
420 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
421 continue;
422 else
423 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
424 continue;
425 }
426
419 if ( event->categories().contains("Holiday") || 427 if ( event->categories().contains("Holiday") ||
420 event->categories().contains(i18n("Holiday"))) { 428 event->categories().contains(i18n("Holiday"))) {
421 setHoliday( true ); 429 setHoliday( true );
422 if ( mDate.dayOfWeek() == 7 ) 430 if ( mDate.dayOfWeek() == 7 )
423 mItemList->setLineWidth( 3 ); 431 mItemList->setLineWidth( 3 );
424 } 432 }
@@ -480,35 +488,26 @@ void MonthViewCell::updateCell()
480 pal = mStandardPalette ; 488 pal = mStandardPalette ;
481 } 489 }
482 item->setPalette( pal ); 490 item->setPalette( pal );
483 item->setRecur( event->recurrence()->doesRecur() ); 491 item->setRecur( event->recurrence()->doesRecur() );
484 item->setAlarm( event->isAlarmEnabled() ); 492 item->setAlarm( event->isAlarmEnabled() );
485 item->setMoreInfo( event->description().length() > 0 ); 493 item->setMoreInfo( event->description().length() > 0 );
494#ifdef DESKTOP_VERSION
486 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, 495 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails,
487 KOPrefs::instance()->email()); 496 KOPrefs::instance()->email());
488 if ( me != 0 ) { 497 if ( me != 0 ) {
489 if ( me->status() == Attendee::NeedsAction && me->RSVP()) 498 if ( me->status() == Attendee::NeedsAction && me->RSVP())
490 item->setReply(true); 499 item->setReply(true);
491 else 500 else
492 item->setReply(false); 501 item->setReply(false);
493 } else 502 } else
494 item->setReply(false); 503 item->setReply(false);
495 bool insert = true; 504#endif
496 if ( !(event->doesRecur() == Recurrence::rNone) ) { 505 mItemList->insertItem( item );
497 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) 506 tipText += "\n";
498 insert = false; 507
499 else
500 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
501 insert = false;
502
503 }
504 if ( insert ) {
505 mItemList->insertItem( item );
506 tipText += "\n";
507 } else
508 tipText = "";
509 } 508 }
510 509
511 // insert due todos 510 // insert due todos
512 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); 511 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
513 Todo *todo; 512 Todo *todo;
514 for(todo = todos.first(); todo; todo = todos.next()) { 513 for(todo = todos.first(); todo; todo = todos.next()) {
@@ -554,15 +553,26 @@ void MonthViewCell::updateCell()
554 if (tipText != "") 553 if (tipText != "")
555 QToolTip::add(this,tipText,toolTipGroup(),""); 554 QToolTip::add(this,tipText,toolTipGroup(),"");
556#endif 555#endif
557 556
558 //setMyPalette(); 557 //setMyPalette();
559 setMyPalette(); 558 setMyPalette();
559 QString text;
560 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
561 if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
562 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
563 mLabel->resize( mLabelBigSize );
564 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
565 } else {
566 mLabel->resize( mLabelSize );
567 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
568 }
569 mLabel->setText( text );
560 resizeEvent( 0 ); 570 resizeEvent( 0 );
561 // if ( isVisible()) 571 // if ( isVisible())
562 // qApp->processEvents(); 572 qApp->processEvents();
563} 573}
564 574
565void MonthViewCell::updateConfig() 575void MonthViewCell::updateConfig()
566{ 576{
567 577
568 setFont( KOPrefs::instance()->mMonthViewFont ); 578 setFont( KOPrefs::instance()->mMonthViewFont );
@@ -635,12 +645,17 @@ void MonthViewCell::select()
635{ 645{
636 ;// updateCell(); 646 ;// updateCell();
637} 647}
638 648
639void MonthViewCell::resizeEvent ( QResizeEvent * ) 649void MonthViewCell::resizeEvent ( QResizeEvent * )
640{ 650{
651 if ( !mMonthView->isUpdatePossible() )
652 return;
653 if ( !isVisible() ){
654 return;
655 }
641 int size = height() - mLabel->height(); 656 int size = height() - mLabel->height();
642 if ( size > 0 ) 657 if ( size > 0 )
643 mItemList->verticalScrollBar()->setMaximumHeight( size ); 658 mItemList->verticalScrollBar()->setMaximumHeight( size );
644 size = width() - mLabel->width(); 659 size = width() - mLabel->width();
645 if ( size > 0 ) 660 if ( size > 0 )
646 mItemList->horizontalScrollBar()->setMaximumWidth( size ); 661 mItemList->horizontalScrollBar()->setMaximumWidth( size );
@@ -710,12 +725,13 @@ void MonthViewCell::selection( QListBoxItem *item )
710 725
711KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) 726KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
712 : KOEventView( calendar, parent, name ), 727 : KOEventView( calendar, parent, name ),
713 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), 728 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
714 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) 729 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
715{ 730{
731 updatePossible = false;
716 mCells.setAutoDelete( true ); 732 mCells.setAutoDelete( true );
717 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 733 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
718 // mDayLayout = new QGridLayout( this ); 734 // mDayLayout = new QGridLayout( this );
719 // create the day of the week labels (Sun, Mon, etc) and add them to 735 // create the day of the week labels (Sun, Mon, etc) and add them to
720 // the layout. 736 // the layout.
721 mDayLabels.resize( mDaysPerWeek ); 737 mDayLabels.resize( mDaysPerWeek );
@@ -917,13 +933,16 @@ void KOMonthView::changeEventDisplay(Event *, int)
917 // quick-and-dirty-hack gets the job done for right now. 933 // quick-and-dirty-hack gets the job done for right now.
918 updateView(); 934 updateView();
919} 935}
920 936
921void KOMonthView::updateView() 937void KOMonthView::updateView()
922{ 938{
923 939 static int iii = 0;
940 ++iii;
941 if ( !updatePossible )
942 return;
924 uint i; 943 uint i;
925 for( i = 0; i < mCells.count(); ++i ) { 944 for( i = 0; i < mCells.count(); ++i ) {
926 mCells[i]->updateCell(); 945 mCells[i]->updateCell();
927 } 946 }
928 //qDebug("KOMonthView::updateView() "); 947 //qDebug("KOMonthView::updateView() ");
929 processSelectionChange(); 948 processSelectionChange();
@@ -951,13 +970,13 @@ void KOMonthView::computeLayout()
951 970
952 int wid = size().width();//e 971 int wid = size().width();//e
953 int hei = size().height()-1; 972 int hei = size().height()-1;
954 973
955 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) 974 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
956 return; 975 return;
957 976 //qDebug("KOMonthView::computeLayout()------------------------------------ ");
958 QFontMetrics fm ( mWeekLabels[0]->font() ); 977 QFontMetrics fm ( mWeekLabels[0]->font() );
959 int weeklabelwid = fm.width( "888" ); 978 int weeklabelwid = fm.width( "888" );
960 wid -= weeklabelwid; 979 wid -= weeklabelwid;
961 980
962 int colWid = wid / daysToShow; 981 int colWid = wid / daysToShow;
963 int lastCol = wid - ( colWid*6 ); 982 int lastCol = wid - ( colWid*6 );
@@ -1029,12 +1048,16 @@ void KOMonthView::computeLayout()
1029 } 1048 }
1030 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); 1049 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1031 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); 1050 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
1032 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); 1051 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
1033 mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; 1052 mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ;
1034 updateDayLabels(); 1053 updateDayLabels();
1054 bool forceUpdate = !updatePossible;
1055 updatePossible = true;
1056 if ( forceUpdate )
1057 updateView();
1035} 1058}
1036 1059
1037void KOMonthView::showContextMenu( Incidence *incidence ) 1060void KOMonthView::showContextMenu( Incidence *incidence )
1038{ 1061{
1039 mContextMenu->showIncidencePopup(incidence); 1062 mContextMenu->showIncidencePopup(incidence);
1040 /* 1063 /*
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 4c1567c..727f511 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -37,12 +37,13 @@
37#include "koeventview.h" 37#include "koeventview.h"
38 38
39#ifdef DESKTOP_VERSION 39#ifdef DESKTOP_VERSION
40class QToolTipGroup; 40class QToolTipGroup;
41#endif 41#endif
42 42
43class KNOWhatsThis;
43class KOWeekButton : public QPushButton 44class KOWeekButton : public QPushButton
44{ 45{
45 Q_OBJECT 46 Q_OBJECT
46 public: 47 public:
47 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 48 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
48 QPushButton( parent, name) 49 QPushButton( parent, name)
@@ -62,24 +63,27 @@ private slots :
62 63
63class KNoScrollListBox: public QListBox 64class KNoScrollListBox: public QListBox
64{ 65{
65 Q_OBJECT 66 Q_OBJECT
66 public: 67 public:
67 KNoScrollListBox(QWidget *parent=0, const char *name=0); 68 KNoScrollListBox(QWidget *parent=0, const char *name=0);
68 ~KNoScrollListBox() {} 69 ~KNoScrollListBox();
69 QString getWhatsThisText(QPoint p) ; 70 QString getWhatsThisText(QPoint p) ;
70 71
71 signals: 72 signals:
72 void shiftDown(); 73 void shiftDown();
73 void shiftUp(); 74 void shiftUp();
74 void rightClick(); 75 void rightClick();
75 76
76 protected slots: 77 protected slots:
77 void keyPressEvent(QKeyEvent *); 78 void keyPressEvent(QKeyEvent *);
78 void keyReleaseEvent(QKeyEvent *); 79 void keyReleaseEvent(QKeyEvent *);
79 void mousePressEvent(QMouseEvent *); 80 void mousePressEvent(QMouseEvent *);
81
82 private:
83 KNOWhatsThis * mWT;
80}; 84};
81 85
82 86
83class MonthViewItem: public QListBoxItem 87class MonthViewItem: public QListBoxItem
84{ 88{
85 public: 89 public:
@@ -209,12 +213,13 @@ class KOMonthView: public KOEventView
209 /** returns dates of the currently selected events */ 213 /** returns dates of the currently selected events */
210 virtual DateList selectedDates(); 214 virtual DateList selectedDates();
211 215
212 virtual void printPreview(CalPrinter *calPrinter, 216 virtual void printPreview(CalPrinter *calPrinter,
213 const QDate &, const QDate &); 217 const QDate &, const QDate &);
214 bool isMonthView() { return true; } 218 bool isMonthView() { return true; }
219 bool isUpdatePossible() { return updatePossible; }
215 220
216 MonthViewCell * selectedCell(); 221 MonthViewCell * selectedCell();
217 public slots: 222 public slots:
218 virtual void updateView(); 223 virtual void updateView();
219 virtual void updateConfig(); 224 virtual void updateConfig();
220 virtual void showDates(const QDate &start, const QDate &end); 225 virtual void showDates(const QDate &start, const QDate &end);
@@ -236,12 +241,13 @@ class KOMonthView: public KOEventView
236 protected: 241 protected:
237 void resizeEvent(QResizeEvent *); 242 void resizeEvent(QResizeEvent *);
238 void viewChanged(); 243 void viewChanged();
239 void updateDayLabels(); 244 void updateDayLabels();
240 245
241 private: 246 private:
247 bool updatePossible;
242 int mDaysPerWeek; 248 int mDaysPerWeek;
243 int mNumWeeks; 249 int mNumWeeks;
244 int mNumCells; 250 int mNumCells;
245 bool mWeekStartsMonday; 251 bool mWeekStartsMonday;
246 bool mShowSatSunComp; 252 bool mShowSatSunComp;
247 void computeLayout(); 253 void computeLayout();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index cf56fcf..00a5842 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -42,12 +42,13 @@
42#include "kolistview.h" 42#include "kolistview.h"
43#include "kowhatsnextview.h" 43#include "kowhatsnextview.h"
44#include "kojournalview.h" 44#include "kojournalview.h"
45#include "kotimespanview.h" 45#include "kotimespanview.h"
46#include "koprefs.h" 46#include "koprefs.h"
47#include "navigatorbar.h" 47#include "navigatorbar.h"
48#include "kdatenavigator.h"
48 49
49#include "koviewmanager.h" 50#include "koviewmanager.h"
50//extern bool externFlagMonthviewBlockPainting; 51//extern bool externFlagMonthviewBlockPainting;
51 52
52//bool globalFlagBlockPainting = false; 53//bool globalFlagBlockPainting = false;
53int globalFlagBlockAgenda = 0; 54int globalFlagBlockAgenda = 0;
@@ -273,14 +274,17 @@ void KOViewManager::showListView()
273 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 274 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
274 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 275 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
275 } 276 }
276 // bool temp = mFlagShowNextxDays; 277 // bool temp = mFlagShowNextxDays;
277 //globalFlagBlockPainting = true; 278 //globalFlagBlockPainting = true;
278 globalFlagBlockAgenda = 1; 279 globalFlagBlockAgenda = 1;
279 if ( KOPrefs::instance()->mListViewMonthTimespan ) 280 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
281 mMainView->setBlockShowDates( true );
280 mMainView->dateNavigator()->selectMonth(); 282 mMainView->dateNavigator()->selectMonth();
283 mMainView->setBlockShowDates( false );
284 }
281 showView(mListView, KOPrefs::instance()->mFullViewTodo); 285 showView(mListView, KOPrefs::instance()->mFullViewTodo);
282 //mFlagShowNextxDays = temp; 286 //mFlagShowNextxDays = temp;
283} 287}
284 288
285void KOViewManager::showAgendaView( bool fullScreen ) 289void KOViewManager::showAgendaView( bool fullScreen )
286{ 290{