-rw-r--r-- | korganizer/calendarview.cpp | 10 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 85 | ||||
-rw-r--r-- | korganizer/komonthview.h | 8 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 6 |
5 files changed, 77 insertions, 34 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() { + mBlockShowDates = false; beamDialog = new KOBeamPrefs(); @@ -348,5 +349,5 @@ void CalendarView::init() SLOT( showDates( const KCal::DateList & ) ) ); + connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); - connect( mNavigatorBar, SIGNAL( goPrevYear() ), @@ -499,3 +500,5 @@ void CalendarView::showDay( QDate d ) { + dateNavigator()->blockSignals( true ); dateNavigator()->selectDate( d ); + dateNavigator()->blockSignals( false ); mViewManager->showWeekView(); @@ -674,3 +677,5 @@ void CalendarView::selectWeekNum ( int num ) { + dateNavigator()->blockSignals( true ); dateNavigator()->selectWeek( num ); + dateNavigator()->blockSignals( false ); mViewManager->showWeekView(); @@ -3467,2 +3472,4 @@ void CalendarView::showDates(const DateList &selectedDates) + + if ( !mBlockShowDates ) { if ( mViewManager->currentView() ) { @@ -3472,2 +3479,3 @@ void CalendarView::showDates(const DateList &selectedDates) } + } 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 //Attendee* getYourAttendee(Event *event); + void setBlockShowDates( bool b ) { mBlockShowDates = b ;} protected: @@ -493,2 +494,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser private: + bool mBlockShowDates; 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) #endif - new KNOWhatsThis(this); + mWT = new KNOWhatsThis(this); +} +KNoScrollListBox::~KNoScrollListBox() +{ + delete mWT; } - QString KNoScrollListBox::getWhatsThisText(QPoint p) @@ -310,16 +313,5 @@ void MonthViewCell::setDate( const QDate &date ) // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; - mDate = date; - QString text; - bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; - if ( KOGlobals::self()->calendarSystem()->day( date ) == 1 || (date.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { - text = KOGlobals::self()->calendarSystem()->monthName( date, true ) + " "; - mLabel->resize( mLabelBigSize ); - text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); - } else { - mLabel->resize( mLabelSize ); - text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); - } - mLabel->setText( text ); + @@ -394,3 +386,7 @@ void MonthViewCell::updateCell() { - + if ( !mMonthView->isUpdatePossible() ) + return; + if ( !isVisible() ){ + return; + } setPrimary( mDate.month()%2 ); @@ -403,2 +399,5 @@ void MonthViewCell::updateCell() mItemList->clear(); + + + #ifdef DESKTOP_VERSION @@ -417,3 +416,12 @@ void MonthViewCell::updateCell() Event *event; - for( event = events.first(); event; event = events.next() ) { + for( event = events.first(); event; event = events.next() ) { // for event + + if ( !(event->doesRecur() == Recurrence::rNone) ) { + if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) + continue; + else + if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) + continue; + } + if ( event->categories().contains("Holiday") || @@ -485,2 +493,3 @@ void MonthViewCell::updateCell() item->setMoreInfo( event->description().length() > 0 ); +#ifdef DESKTOP_VERSION Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, @@ -494,16 +503,6 @@ void MonthViewCell::updateCell() item->setReply(false); - bool insert = true; - if ( !(event->doesRecur() == Recurrence::rNone) ) { - if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) - insert = false; - else - if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) - insert = false; - - } - if ( insert ) { +#endif mItemList->insertItem( item ); tipText += "\n"; - } else - tipText = ""; + } @@ -559,5 +558,16 @@ void MonthViewCell::updateCell() setMyPalette(); + QString text; + bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; + if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { + text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; + mLabel->resize( mLabelBigSize ); + text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); + } else { + mLabel->resize( mLabelSize ); + text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); + } + mLabel->setText( text ); resizeEvent( 0 ); // if ( isVisible()) - // qApp->processEvents(); + qApp->processEvents(); } @@ -640,2 +650,7 @@ void MonthViewCell::resizeEvent ( QResizeEvent * ) { + if ( !mMonthView->isUpdatePossible() ) + return; + if ( !isVisible() ){ + return; + } int size = height() - mLabel->height(); @@ -715,2 +730,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) { + updatePossible = false; mCells.setAutoDelete( true ); @@ -922,3 +938,6 @@ void KOMonthView::updateView() { - + static int iii = 0; + ++iii; + if ( !updatePossible ) + return; uint i; @@ -956,3 +975,3 @@ void KOMonthView::computeLayout() return; - + //qDebug("KOMonthView::computeLayout()------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); @@ -1034,2 +1053,6 @@ void KOMonthView::computeLayout() updateDayLabels(); + bool forceUpdate = !updatePossible; + updatePossible = true; + if ( forceUpdate ) + updateView(); } 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; +class KNOWhatsThis; class KOWeekButton : public QPushButton @@ -67,3 +68,3 @@ class KNoScrollListBox: public QListBox KNoScrollListBox(QWidget *parent=0, const char *name=0); - ~KNoScrollListBox() {} + ~KNoScrollListBox(); QString getWhatsThisText(QPoint p) ; @@ -79,2 +80,5 @@ class KNoScrollListBox: public QListBox void mousePressEvent(QMouseEvent *); + + private: + KNOWhatsThis * mWT; }; @@ -214,2 +218,3 @@ class KOMonthView: public KOEventView bool isMonthView() { return true; } + bool isUpdatePossible() { return updatePossible; } @@ -241,2 +246,3 @@ class KOMonthView: public KOEventView private: + bool updatePossible; 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 @@ #include "navigatorbar.h" +#include "kdatenavigator.h" @@ -278,4 +279,7 @@ void KOViewManager::showListView() globalFlagBlockAgenda = 1; - if ( KOPrefs::instance()->mListViewMonthTimespan ) + if ( KOPrefs::instance()->mListViewMonthTimespan ) { + mMainView->setBlockShowDates( true ); mMainView->dateNavigator()->selectMonth(); + mMainView->setBlockShowDates( false ); + } showView(mListView, KOPrefs::instance()->mFullViewTodo); |