-rw-r--r-- | korganizer/calendarview.cpp | 22 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 89 | ||||
-rw-r--r-- | korganizer/komonthview.h | 8 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 6 |
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 | |||
@@ -235,2 +235,3 @@ void CalendarView::init() | |||
235 | { | 235 | { |
236 | mBlockShowDates = false; | ||
236 | beamDialog = new KOBeamPrefs(); | 237 | beamDialog = new KOBeamPrefs(); |
@@ -348,5 +349,5 @@ void CalendarView::init() | |||
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() ), |
@@ -359,6 +360,6 @@ void CalendarView::init() | |||
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 & ) ), |
@@ -499,3 +500,5 @@ void 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(); |
@@ -674,3 +677,5 @@ void 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(); |
@@ -3467,6 +3472,9 @@ void CalendarView::showDates(const DateList &selectedDates) | |||
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 | } |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 646973d..e27da9a 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -482,2 +482,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
482 | //Attendee* getYourAttendee(Event *event); | 482 | //Attendee* getYourAttendee(Event *event); |
483 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} | ||
483 | protected: | 484 | protected: |
@@ -493,2 +494,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
493 | private: | 494 | private: |
495 | bool mBlockShowDates; | ||
494 | KSyncManager* mSyncManager; | 496 | KSyncManager* mSyncManager; |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9344567..842f6eb 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -81,5 +81,8 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) | |||
81 | #endif | 81 | #endif |
82 | new KNOWhatsThis(this); | 82 | mWT = new KNOWhatsThis(this); |
83 | } | ||
84 | KNoScrollListBox::~KNoScrollListBox() | ||
85 | { | ||
86 | delete mWT; | ||
83 | } | 87 | } |
84 | |||
85 | QString KNoScrollListBox::getWhatsThisText(QPoint p) | 88 | QString KNoScrollListBox::getWhatsThisText(QPoint p) |
@@ -310,16 +313,5 @@ void MonthViewCell::setDate( const QDate &date ) | |||
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 | ||
@@ -394,3 +386,7 @@ void 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 ); |
@@ -403,2 +399,5 @@ void MonthViewCell::updateCell() | |||
403 | mItemList->clear(); | 399 | mItemList->clear(); |
400 | |||
401 | |||
402 | |||
404 | #ifdef DESKTOP_VERSION | 403 | #ifdef DESKTOP_VERSION |
@@ -417,3 +416,12 @@ void MonthViewCell::updateCell() | |||
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") || |
@@ -485,2 +493,3 @@ void MonthViewCell::updateCell() | |||
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, |
@@ -494,16 +503,6 @@ void MonthViewCell::updateCell() | |||
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 | } |
@@ -559,5 +558,16 @@ void MonthViewCell::updateCell() | |||
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 | } |
@@ -640,2 +650,7 @@ void 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(); |
@@ -715,2 +730,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
715 | { | 730 | { |
731 | updatePossible = false; | ||
716 | mCells.setAutoDelete( true ); | 732 | mCells.setAutoDelete( true ); |
@@ -922,3 +938,6 @@ void KOMonthView::updateView() | |||
922 | { | 938 | { |
923 | 939 | static int iii = 0; | |
940 | ++iii; | ||
941 | if ( !updatePossible ) | ||
942 | return; | ||
924 | uint i; | 943 | uint i; |
@@ -956,3 +975,3 @@ void KOMonthView::computeLayout() | |||
956 | return; | 975 | return; |
957 | 976 | //qDebug("KOMonthView::computeLayout()------------------------------------ "); | |
958 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 977 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
@@ -1034,2 +1053,6 @@ void KOMonthView::computeLayout() | |||
1034 | updateDayLabels(); | 1053 | updateDayLabels(); |
1054 | bool forceUpdate = !updatePossible; | ||
1055 | updatePossible = true; | ||
1056 | if ( forceUpdate ) | ||
1057 | updateView(); | ||
1035 | } | 1058 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 4c1567c..727f511 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -42,2 +42,3 @@ class QToolTipGroup; | |||
42 | 42 | ||
43 | class KNOWhatsThis; | ||
43 | class KOWeekButton : public QPushButton | 44 | class KOWeekButton : public QPushButton |
@@ -67,3 +68,3 @@ class KNoScrollListBox: public QListBox | |||
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) ; |
@@ -79,2 +80,5 @@ class KNoScrollListBox: public QListBox | |||
79 | void mousePressEvent(QMouseEvent *); | 80 | void mousePressEvent(QMouseEvent *); |
81 | |||
82 | private: | ||
83 | KNOWhatsThis * mWT; | ||
80 | }; | 84 | }; |
@@ -214,2 +218,3 @@ class KOMonthView: public KOEventView | |||
214 | bool isMonthView() { return true; } | 218 | bool isMonthView() { return true; } |
219 | bool isUpdatePossible() { return updatePossible; } | ||
215 | 220 | ||
@@ -241,2 +246,3 @@ class KOMonthView: public KOEventView | |||
241 | private: | 246 | private: |
247 | bool updatePossible; | ||
242 | int mDaysPerWeek; | 248 | int mDaysPerWeek; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index cf56fcf..00a5842 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -47,2 +47,3 @@ | |||
47 | #include "navigatorbar.h" | 47 | #include "navigatorbar.h" |
48 | #include "kdatenavigator.h" | ||
48 | 49 | ||
@@ -278,4 +279,7 @@ void KOViewManager::showListView() | |||
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); |