summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (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
@@ -234,4 +234,5 @@ CalendarView::CalendarView( Calendar *calendar,
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;
@@ -347,7 +348,7 @@ void CalendarView::init()
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() ) );
@@ -358,8 +359,8 @@ void CalendarView::init()
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 & ) ) );
@@ -498,5 +499,7 @@ CalendarView::~CalendarView()
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 );
@@ -673,5 +676,7 @@ void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
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}
@@ -3466,8 +3471,11 @@ void CalendarView::showDates(const DateList &selectedDates)
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
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 646973d..e27da9a 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -481,4 +481,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
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);
@@ -492,4 +493,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
492 493
493 private: 494 private:
495 bool mBlockShowDates;
494 KSyncManager* mSyncManager; 496 KSyncManager* mSyncManager;
495 AlarmDialog * mAlarmDialog; 497 AlarmDialog * mAlarmDialog;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 9344567..842f6eb 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -80,7 +80,10 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
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{
@@ -309,18 +312,7 @@ void 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 );
@@ -393,5 +385,9 @@ void MonthViewCell::keyPressEvent ( QKeyEvent * e )
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);
@@ -402,4 +398,7 @@ void MonthViewCell::updateCell()
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);
@@ -416,5 +415,14 @@ void MonthViewCell::updateCell()
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"))) {
@@ -484,4 +492,5 @@ void MonthViewCell::updateCell()
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());
@@ -493,18 +502,8 @@ void MonthViewCell::updateCell()
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
@@ -558,7 +557,18 @@ void MonthViewCell::updateCell()
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
@@ -639,4 +649,9 @@ void MonthViewCell::select()
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 )
@@ -714,4 +729,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
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 ;
@@ -921,5 +937,8 @@ void KOMonthView::changeEventDisplay(Event *, int)
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 ) {
@@ -955,5 +974,5 @@ void KOMonthView::computeLayout()
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" );
@@ -1033,4 +1052,8 @@ void KOMonthView::computeLayout()
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
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 4c1567c..727f511 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -41,4 +41,5 @@ class QToolTipGroup;
41#endif 41#endif
42 42
43class KNOWhatsThis;
43class KOWeekButton : public QPushButton 44class KOWeekButton : public QPushButton
44{ 45{
@@ -66,5 +67,5 @@ class KNoScrollListBox: public QListBox
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
@@ -78,4 +79,7 @@ class KNoScrollListBox: public QListBox
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
@@ -213,4 +217,5 @@ class KOMonthView: public KOEventView
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();
@@ -240,4 +245,5 @@ class KOMonthView: public KOEventView
240 245
241 private: 246 private:
247 bool updatePossible;
242 int mDaysPerWeek; 248 int mDaysPerWeek;
243 int mNumWeeks; 249 int mNumWeeks;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index cf56fcf..00a5842 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -46,4 +46,5 @@
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"
@@ -277,6 +278,9 @@ void KOViewManager::showListView()
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;