summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/datenavigatorcontainer.cpp2
-rw-r--r--korganizer/datenavigatorcontainer.h1
-rw-r--r--korganizer/kdatenavigator.cpp3
-rw-r--r--korganizer/kdatenavigator.h1
-rw-r--r--korganizer/koviewmanager.cpp10
-rw-r--r--korganizer/koviewmanager.h3
7 files changed, 22 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 6ed6a1c..92fd59c 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -325,96 +325,100 @@ void CalendarView::init()
325 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 325 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
326 "CalendarView::DateNavigator", QDate::currentDate()); 326 "CalendarView::DateNavigator", QDate::currentDate());
327#endif 327#endif
328 // mDateNavigator->blockSignals( true ); 328 // mDateNavigator->blockSignals( true );
329 //leftFrameLayout->addWidget( mDateNavigator ); 329 //leftFrameLayout->addWidget( mDateNavigator );
330 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 330 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
331 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 331 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
332 mTodoList->setNavigator( mNavigator ); 332 mTodoList->setNavigator( mNavigator );
333#if 0 333#if 0
334 if ( QApplication::desktop()->width() < 480 ) { 334 if ( QApplication::desktop()->width() < 480 ) {
335 leftFrameLayout->addWidget(mFilterView); 335 leftFrameLayout->addWidget(mFilterView);
336 leftFrameLayout->addWidget(mTodoList, 2 ); 336 leftFrameLayout->addWidget(mTodoList, 2 );
337 337
338 } else { 338 } else {
339 leftFrameLayout->addWidget(mTodoList,2 ); 339 leftFrameLayout->addWidget(mTodoList,2 );
340 leftFrameLayout->addWidget(mFilterView ); 340 leftFrameLayout->addWidget(mFilterView );
341 } 341 }
342#endif 342#endif
343 mFilterView->hide(); 343 mFilterView->hide();
344 QWidget *rightBox = new QWidget( mMainFrame ); 344 QWidget *rightBox = new QWidget( mMainFrame );
345 //mainBoxLayout->addWidget ( rightBox, 10 ); 345 //mainBoxLayout->addWidget ( rightBox, 10 );
346 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 346 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
347 mRightFrame = new QWidgetStack( rightBox ); 347 mRightFrame = new QWidgetStack( rightBox );
348 rightLayout->addWidget( mRightFrame, 10 ); 348 rightLayout->addWidget( mRightFrame, 10 );
349 349
350 //mLeftFrame = (QWidget *)leftFrame; 350 //mLeftFrame = (QWidget *)leftFrame;
351 if ( KOPrefs::instance()->mVerticalScreen ) { 351 if ( KOPrefs::instance()->mVerticalScreen ) {
352 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 352 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
353 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 353 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
354 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 354 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
355 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 355 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
356 } else { 356 } else {
357 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 357 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
358 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 358 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
359 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 359 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
360 } 360 }
361 if ( !KOPrefs::instance()->mShowDateNavigator) 361 if ( !KOPrefs::instance()->mShowDateNavigator)
362 mDateNavigator->hide(); 362 mDateNavigator->hide();
363 //qDebug("Calendarview Size %d %d ", width(), height()); 363 //qDebug("Calendarview Size %d %d ", width(), height());
364#endif 364#endif
365 365
366 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 366 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
367 SLOT( showDates( const KCal::DateList & ) ) ); 367 SLOT( showDates( const KCal::DateList & ) ) );
368 368
369 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 369 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
370 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 370 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
371 371
372 372
373
374 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
375 mViewManager, SLOT( showMonth( const QDate & ) ) );
376
373 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 377 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
374 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 378 mNavigator, SLOT( selectWeek( const QDate & ) ) );
375 379
376 connect( mDateNavigator, SIGNAL( goPrevYear() ), 380 connect( mDateNavigator, SIGNAL( goPrevYear() ),
377 mNavigator, SLOT( selectPreviousYear() ) ); 381 mNavigator, SLOT( selectPreviousYear() ) );
378 connect( mDateNavigator, SIGNAL( goNextYear() ), 382 connect( mDateNavigator, SIGNAL( goNextYear() ),
379 mNavigator, SLOT( selectNextYear() ) ); 383 mNavigator, SLOT( selectNextYear() ) );
380 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 384 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
381 mNavigator, SLOT( selectPreviousMonth() ) ); 385 mNavigator, SLOT( selectPreviousMonth() ) );
382 connect( mDateNavigator, SIGNAL( goNextMonth() ), 386 connect( mDateNavigator, SIGNAL( goNextMonth() ),
383 mNavigator, SLOT( selectNextMonth() ) ); 387 mNavigator, SLOT( selectNextMonth() ) );
384 388
385 connect( mDateNavigator, SIGNAL( goPrevious() ), 389 connect( mDateNavigator, SIGNAL( goPrevious() ),
386 mNavigator, SLOT( selectPrevious() ) ); 390 mNavigator, SLOT( selectPrevious() ) );
387 connect( mDateNavigator, SIGNAL( goNext() ), 391 connect( mDateNavigator, SIGNAL( goNext() ),
388 mNavigator, SLOT( selectNext() ) ); 392 mNavigator, SLOT( selectNext() ) );
389 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 393 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
390 mNavigator, SLOT( slotMonthSelect( int ) ) ); 394 mNavigator, SLOT( slotMonthSelect( int ) ) );
391 395
392 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 396 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
393 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 397 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
394#if 0 398#if 0
395 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 399 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
396 SLOT( incidenceAdded( Incidence *) ) ); 400 SLOT( incidenceAdded( Incidence *) ) );
397#endif 401#endif
398 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 402 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
399 403
400 connect( this, SIGNAL( configChanged() ), 404 connect( this, SIGNAL( configChanged() ),
401 mDateNavigator, SLOT( updateConfig() ) ); 405 mDateNavigator, SLOT( updateConfig() ) );
402 406
403 connect( mTodoList, SIGNAL( newTodoSignal() ), 407 connect( mTodoList, SIGNAL( newTodoSignal() ),
404 SLOT( newTodo() ) ); 408 SLOT( newTodo() ) );
405 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 409 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
406 SLOT( newSubTodo( Todo * ) ) ); 410 SLOT( newSubTodo( Todo * ) ) );
407 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 411 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
408 SLOT( editTodo( Todo * ) ) ); 412 SLOT( editTodo( Todo * ) ) );
409 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 413 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
410 SLOT( showTodo( Todo *) ) ); 414 SLOT( showTodo( Todo *) ) );
411 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 415 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
412 SLOT( deleteTodo( Todo *) ) ); 416 SLOT( deleteTodo( Todo *) ) );
413 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 417 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
414 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 418 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
415 SLOT( purgeCompleted() ) ); 419 SLOT( purgeCompleted() ) );
416 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 420 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
417 SIGNAL( todoModified( Todo *, int ) ) ); 421 SIGNAL( todoModified( Todo *, int ) ) );
418 422
419 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 423 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
420 this, SLOT ( cloneIncidence( Incidence * ) ) ); 424 this, SLOT ( cloneIncidence( Incidence * ) ) );
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 11dc592..edeebdf 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -26,96 +26,98 @@
26#include <kdebug.h> 26#include <kdebug.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29//#include "koglobals.h" 29//#include "koglobals.h"
30#include "navigatorbar.h" 30#include "navigatorbar.h"
31#include "kdatenavigator.h" 31#include "kdatenavigator.h"
32 32
33#include <kcalendarsystem.h> 33#include <kcalendarsystem.h>
34 34
35#include "datenavigatorcontainer.h" 35#include "datenavigatorcontainer.h"
36#include "koprefs.h" 36#include "koprefs.h"
37 37
38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, 38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
39 const char *name ) 39 const char *name )
40 : QWidget( parent, name ), mCalendar( 0 ), 40 : QWidget( parent, name ), mCalendar( 0 ),
41 mHorizontalCount( 1 ), mVerticalCount( 1 ) 41 mHorizontalCount( 1 ), mVerticalCount( 1 )
42{ 42{
43 mResizeEnabled = false; 43 mResizeEnabled = false;
44 mExtraViews.setAutoDelete( true ); 44 mExtraViews.setAutoDelete( true );
45 45
46 mNavigatorView = new KDateNavigator( this, name ); 46 mNavigatorView = new KDateNavigator( this, name );
47 mNavigatorView->hide(); 47 mNavigatorView->hide();
48 connectNavigatorView( mNavigatorView ); 48 connectNavigatorView( mNavigatorView );
49 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 49 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
50 mLastDisplayedDN = 0; 50 mLastDisplayedDN = 0;
51 mUpdateTimer; 51 mUpdateTimer;
52 mUpdateTimer = new QTimer( this ); 52 mUpdateTimer = new QTimer( this );
53 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); 53 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
54 mFirstSelectedDate = QDate::currentDate(); 54 mFirstSelectedDate = QDate::currentDate();
55 mSelectedDateCount = 1; 55 mSelectedDateCount = 1;
56} 56}
57 57
58DateNavigatorContainer::~DateNavigatorContainer() 58DateNavigatorContainer::~DateNavigatorContainer()
59{ 59{
60} 60}
61 61
62void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) 62void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
63{ 63{
64 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), 64 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ),
65 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 65 SIGNAL( datesSelected( const KCal::DateList & ) ) );
66#if 0 66#if 0
67 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), 67 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ),
68 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); 68 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) );
69 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), 69 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ),
70 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); 70 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) );
71#endif 71#endif
72 connect( v, SIGNAL( weekClicked( const QDate & ) ), 72 connect( v, SIGNAL( weekClicked( const QDate & ) ),
73 SIGNAL( weekClicked( const QDate & ) ) ); 73 SIGNAL( weekClicked( const QDate & ) ) );
74 connect( v, SIGNAL( showMonth( const QDate & ) ),
75 SIGNAL( showMonth( const QDate & ) ) );
74 76
75 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) ); 77 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) );
76 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) ); 78 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) );
77 79
78 connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) ); 80 connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) );
79 connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) ); 81 connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) );
80 connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) ); 82 connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) );
81 connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) ); 83 connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) );
82 84
83 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 85 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
84} 86}
85void DateNavigatorContainer::slotgoNextYear() 87void DateNavigatorContainer::slotgoNextYear()
86{ 88{
87 jumpMonth( 12 ); 89 jumpMonth( 12 );
88 emit goNextYear(); 90 emit goNextYear();
89 91
90} 92}
91void DateNavigatorContainer::slotgoPrevYear() 93void DateNavigatorContainer::slotgoPrevYear()
92{ 94{
93 jumpMonth( -12 ); 95 jumpMonth( -12 );
94 emit goPrevYear(); 96 emit goPrevYear();
95 97
96} 98}
97void DateNavigatorContainer::slotgoPrevMonth() 99void DateNavigatorContainer::slotgoPrevMonth()
98{ 100{
99 jumpMonth( -1 ); 101 jumpMonth( -1 );
100 emit goPrevMonth(); 102 emit goPrevMonth();
101 103
102} 104}
103void DateNavigatorContainer::slotgoNextMonth() 105void DateNavigatorContainer::slotgoNextMonth()
104{ 106{
105 jumpMonth( 1 ); 107 jumpMonth( 1 );
106 emit goNextMonth(); 108 emit goNextMonth();
107} 109}
108void DateNavigatorContainer::jumpMonth( int month ) 110void DateNavigatorContainer::jumpMonth( int month )
109{ 111{
110 112
111 QDate baseDate = mNavigatorView->baseDate(); 113 QDate baseDate = mNavigatorView->baseDate();
112 computeMonthSelected( baseDate.month() + month, false ); 114 computeMonthSelected( baseDate.month() + month, false );
113} 115}
114void DateNavigatorContainer::slotMonthSelected( int month ) 116void DateNavigatorContainer::slotMonthSelected( int month )
115{ 117{
116 computeMonthSelected( month, true ); 118 computeMonthSelected( month, true );
117} 119}
118void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) 120void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit )
119{ 121{
120 //qDebug("slotMonthSelected %d ", month); 122 //qDebug("slotMonthSelected %d ", month);
121 QDate baseDate = mNavigatorView->baseDate(); 123 QDate baseDate = mNavigatorView->baseDate();
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index ac9745d..87cc59f 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -33,76 +33,77 @@ class KDateNavigator;
33using namespace KCal; 33using namespace KCal;
34 34
35class DateNavigatorContainer: public QWidget 35class DateNavigatorContainer: public QWidget
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 public: 38 public:
39 DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 ); 39 DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 );
40 ~DateNavigatorContainer(); 40 ~DateNavigatorContainer();
41 41
42 /** 42 /**
43 Associate date navigator with a calendar. It is used by KODayMatrix. 43 Associate date navigator with a calendar. It is used by KODayMatrix.
44 */ 44 */
45 void setCalendar( Calendar * ); 45 void setCalendar( Calendar * );
46 46
47 QSize minimumSizeHint() const; 47 QSize minimumSizeHint() const;
48 QSize sizeHint() const; 48 QSize sizeHint() const;
49 KDateNavigator * navigatorView() { return mNavigatorView;} 49 KDateNavigator * navigatorView() { return mNavigatorView;}
50 QDate lastAvailableDate() const ; 50 QDate lastAvailableDate() const ;
51 QDate firstAvailableDate() const ; 51 QDate firstAvailableDate() const ;
52 52
53 public slots: 53 public slots:
54 void selectDates( const KCal::DateList & ); 54 void selectDates( const KCal::DateList & );
55 void updateView(); 55 void updateView();
56 void updateConfig(); 56 void updateConfig();
57 void updateDayMatrix(); 57 void updateDayMatrix();
58 void updateDayMatrixDates(); 58 void updateDayMatrixDates();
59 void checkUpdateDayMatrixDates(); 59 void checkUpdateDayMatrixDates();
60 void updateToday(); 60 void updateToday();
61 void slotMonthSelected( int month ); 61 void slotMonthSelected( int month );
62 void slotgoNextMonth(); 62 void slotgoNextMonth();
63 void slotgoPrevMonth(); 63 void slotgoPrevMonth();
64 void slotgoNextYear(); 64 void slotgoNextYear();
65 void slotgoPrevYear(); 65 void slotgoPrevYear();
66 void setResizeEnabled(); 66 void setResizeEnabled();
67 67
68 signals: 68 signals:
69 void datesSelected( const KCal::DateList & ); 69 void datesSelected( const KCal::DateList & );
70 void incidenceDropped( Incidence *, const QDate & ); 70 void incidenceDropped( Incidence *, const QDate & );
71 void incidenceDroppedMove( Incidence *, const QDate & ); 71 void incidenceDroppedMove( Incidence *, const QDate & );
72 void weekClicked( const QDate &); 72 void weekClicked( const QDate &);
73 73
74 void goPrevious(); 74 void goPrevious();
75 void goNext(); 75 void goNext();
76 76
77 void goNextMonth(); 77 void goNextMonth();
78 void goPrevMonth(); 78 void goPrevMonth();
79 void goNextYear(); 79 void goNextYear();
80 void goPrevYear(); 80 void goPrevYear();
81 void showMonth( const QDate & );
81 82
82 void monthSelected( int month ); 83 void monthSelected( int month );
83 84
84 protected: 85 protected:
85 void computeMonthSelected( int month , bool forceEmit ); 86 void computeMonthSelected( int month , bool forceEmit );
86 void jumpMonth( int month ); 87 void jumpMonth( int month );
87 void resizeEvent( QResizeEvent * ); 88 void resizeEvent( QResizeEvent * );
88 89
89 void setBaseDates(); 90 void setBaseDates();
90 void connectNavigatorView( KDateNavigator *v ); 91 void connectNavigatorView( KDateNavigator *v );
91 92
92 private: 93 private:
93 bool mResizeEnabled; 94 bool mResizeEnabled;
94 QTimer* mUpdateTimer; 95 QTimer* mUpdateTimer;
95 int mLastDisplayedDN; 96 int mLastDisplayedDN;
96 QDate mFirstSelectedDate; 97 QDate mFirstSelectedDate;
97 int mSelectedDateCount; 98 int mSelectedDateCount;
98 KDateNavigator *mNavigatorView; 99 KDateNavigator *mNavigatorView;
99 100
100 KCal::Calendar *mCalendar; 101 KCal::Calendar *mCalendar;
101 102
102 QPtrList<KDateNavigator> mExtraViews; 103 QPtrList<KDateNavigator> mExtraViews;
103 104
104 int mHorizontalCount; 105 int mHorizontalCount;
105 int mVerticalCount; 106 int mVerticalCount;
106}; 107};
107 108
108#endif 109#endif
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 5eccfd6..38bddc2 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -402,66 +402,69 @@ void KDateNavigator::selectDates(const DateList& dateList)
402 402
403 updateDates(); 403 updateDates();
404 404
405 daymatrix->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); 405 daymatrix->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end()));
406 406
407 updateView(); 407 updateView();
408 } 408 }
409} 409}
410 410
411int KDateNavigator::dayNum(int row, int col) 411int KDateNavigator::dayNum(int row, int col)
412{ 412{
413 return 7 * (row - 1) + (col + 1) - m_fstDayOfWk; 413 return 7 * (row - 1) + (col + 1) - m_fstDayOfWk;
414} 414}
415 415
416int KDateNavigator::dayToIndex(int dayNum) 416int KDateNavigator::dayToIndex(int dayNum)
417{ 417{
418 int row, col; 418 int row, col;
419 419
420 row = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) / 7; 420 row = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) / 7;
421 if (KGlobal::locale()->weekStartsMonday() && (m_fstDayOfWk == 1)) 421 if (KGlobal::locale()->weekStartsMonday() && (m_fstDayOfWk == 1))
422 row++; 422 row++;
423 col = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) % 7; 423 col = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) % 7;
424 return row * 7 + col; 424 return row * 7 + col;
425} 425}
426 426
427void KDateNavigator::wheelEvent (QWheelEvent *e) 427void KDateNavigator::wheelEvent (QWheelEvent *e)
428{ 428{
429 if(e->delta()>0) emit goPrevious(); 429 if(e->delta()>0) emit goPrevious();
430 else emit goNext(); 430 else emit goNext();
431 431
432 e->accept(); 432 e->accept();
433} 433}
434 434
435bool KDateNavigator::eventFilter (QObject *o,QEvent *e) 435bool KDateNavigator::eventFilter (QObject *o,QEvent *e)
436{ 436{
437 if (e->type() == QEvent::MouseButtonPress) { 437 if (e->type() == QEvent::MouseButtonPress) {
438 int i; 438 int i;
439 for(i=0;i<6;++i) { 439 for(i=0;i<6;++i) {
440 if (o == weeknos[i]) { 440 if (o == weeknos[i]) {
441 QDate weekstart = daymatrix->getDate(i*7); 441 QDate weekstart = daymatrix->getDate(i*7);
442 emit weekClicked(weekstart); 442 emit weekClicked(weekstart);
443 break; 443 break;
444 } 444 }
445 } 445 }
446 for(i=0;i<7;++i) { 446 for(i=0;i<7;++i) {
447 if (o == headings[i]) { 447 if (o == headings[i]) {
448 KCal::DateList selDays; 448 KCal::DateList selDays;
449 QDate date = daymatrix->getDate(14); 449 QDate date = daymatrix->getDate(14);
450 emit showMonth(date );
451#if 0
450 int dio = date.daysInMonth(); 452 int dio = date.daysInMonth();
451 int j; 453 int j;
452 int ye = date.year(); 454 int ye = date.year();
453 int mo = date.month(); 455 int mo = date.month();
454 for ( j = 1; j <= dio; ++j ) { 456 for ( j = 1; j <= dio; ++j ) {
455 selDays.append( QDate( ye, mo, j ) ); 457 selDays.append( QDate( ye, mo, j ) );
456 } 458 }
457 emit datesSelected( selDays ); 459 emit datesSelected( selDays );
460#endif
458 break; 461 break;
459 } 462 }
460 } 463 }
461 return true; 464 return true;
462 } else { 465 } else {
463 return false; 466 return false;
464 } 467 }
465} 468}
466 469
467//#include "kdatenavigator.moc" 470//#include "kdatenavigator.moc"
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 93bbceb..780ebb8 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -41,96 +41,97 @@ class NavigatorBar;
41class KDateNavigator: public QFrame 41class KDateNavigator: public QFrame
42{ 42{
43 Q_OBJECT 43 Q_OBJECT
44 public: 44 public:
45 KDateNavigator( QWidget *parent = 0,const char *name = 0 ); 45 KDateNavigator( QWidget *parent = 0,const char *name = 0 );
46 ~KDateNavigator(); 46 ~KDateNavigator();
47 47
48 /** The DateNavigator automatically checks for 48 /** The DateNavigator automatically checks for
49 * the passage of midnight. If rollover type is 49 * the passage of midnight. If rollover type is
50 * set to None, no signals are emitted and no 50 * set to None, no signals are emitted and no
51 * processing is done. With rollover set to 51 * processing is done. With rollover set to
52 * FollowDay, the day highlighter changes at 52 * FollowDay, the day highlighter changes at
53 * midnight and dayPassed() is emitted. 53 * midnight and dayPassed() is emitted.
54 * With FollowMonth, it has the same effect 54 * With FollowMonth, it has the same effect
55 * as FollowDay but also adjusts the month that is 55 * as FollowDay but also adjusts the month that is
56 * visible and emits monthPassed() when the month changes. 56 * visible and emits monthPassed() when the month changes.
57 */ 57 */
58 enum RolloverType { None, FollowDay, FollowMonth } ; 58 enum RolloverType { None, FollowDay, FollowMonth } ;
59 void enableRollover( RolloverType ); 59 void enableRollover( RolloverType );
60 60
61 void setShowWeekNums( bool enabled ); 61 void setShowWeekNums( bool enabled );
62 void setCalendar( Calendar * ); 62 void setCalendar( Calendar * );
63 void setBaseDate( const QDate & , bool doRepaint = true ); 63 void setBaseDate( const QDate & , bool doRepaint = true );
64 64
65 QDate baseDate() const { return m_MthYr;} 65 QDate baseDate() const { return m_MthYr;}
66 66
67 KCal::DateList selectedDates() const { return mSelectedDates; } 67 KCal::DateList selectedDates() const { return mSelectedDates; }
68 NavigatorBar *navigatorBar() const { return mNavigatorBar; } 68 NavigatorBar *navigatorBar() const { return mNavigatorBar; }
69 void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off%12;} 69 void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off%12;}
70 QSize yourSizeHint()const { return mySizeHint; }; 70 QSize yourSizeHint()const { return mySizeHint; };
71 QSize yourFullSizeHint() const { return myFullSizeHint;}; 71 QSize yourFullSizeHint() const { return myFullSizeHint;};
72 QFont yourFontHint( QSize , bool * b); 72 QFont yourFontHint( QSize , bool * b);
73 bool fontChanged() {return mFontChanged; } 73 bool fontChanged() {return mFontChanged; }
74 void unsetFontChanged() { mFontChanged = false; } 74 void unsetFontChanged() { mFontChanged = false; }
75 KODayMatrix *dayMatrix() { return daymatrix ;} 75 KODayMatrix *dayMatrix() { return daymatrix ;}
76 QSize sizeHint() const; 76 QSize sizeHint() const;
77 QSize sizeHintTwoButtons( int butnum = 2 ) const; 77 QSize sizeHintTwoButtons( int butnum = 2 ) const;
78 void changeFont ( QFont fo ); 78 void changeFont ( QFont fo );
79 public slots: 79 public slots:
80 void selectDates( const KCal::DateList & ); 80 void selectDates( const KCal::DateList & );
81 void updateView(); 81 void updateView();
82 void updateConfig(); 82 void updateConfig();
83 void updateDayMatrix(); 83 void updateDayMatrix();
84 84
85 signals: 85 signals:
86 void datesSelected( const KCal::DateList & ); 86 void datesSelected( const KCal::DateList & );
87 void eventDropped( Event * ); 87 void eventDropped( Event * );
88 void weekClicked( const QDate &); 88 void weekClicked( const QDate &);
89 void showMonth( const QDate & );
89 90
90 void goPrevious(); 91 void goPrevious();
91 void goNext(); 92 void goNext();
92 93
93 void goNextMonth(); 94 void goNextMonth();
94 void goPrevMonth(); 95 void goPrevMonth();
95 void goNextYear(); 96 void goNextYear();
96 void goPrevYear(); 97 void goPrevYear();
97 void monthSelected( int ); 98 void monthSelected( int );
98 99
99 // Signals emitted at midnight carrying the new date. 100 // Signals emitted at midnight carrying the new date.
100 void dayPassed( QDate ); 101 void dayPassed( QDate );
101 void monthPassed( QDate ); 102 void monthPassed( QDate );
102 103
103 protected slots: 104 protected slots:
104 105
105 /** 106 /**
106 * Called regularly to see if we need to update the view 107 * Called regularly to see if we need to update the view
107 * wrt. the today box and the month box. Only important 108 * wrt. the today box and the month box. Only important
108 * if you leave KOrganizer idle for long periods of time. 109 * if you leave KOrganizer idle for long periods of time.
109 * 110 *
110 * Until we have a reliable way of setting QTimers to go 111 * Until we have a reliable way of setting QTimers to go
111 * off at a particular wall-clock time, we need this, 112 * off at a particular wall-clock time, we need this,
112 * which calls passedMidnight() at the right moments. 113 * which calls passedMidnight() at the right moments.
113 */ 114 */
114 void possiblyPastMidnight(); 115 void possiblyPastMidnight();
115 116
116 /** handles updating the view when midnight has come by due to idle time. 117 /** handles updating the view when midnight has come by due to idle time.
117 * 118 *
118 */ 119 */
119 void passedMidnight(); 120 void passedMidnight();
120 void slotMonthSelected( int m ); 121 void slotMonthSelected( int m );
121 protected: 122 protected:
122 void updateDates(); 123 void updateDates();
123 124
124 void wheelEvent (QWheelEvent *); 125 void wheelEvent (QWheelEvent *);
125 126
126 bool eventFilter (QObject *,QEvent *); 127 bool eventFilter (QObject *,QEvent *);
127 128
128 private: 129 private:
129 QSize mySizeHint; 130 QSize mySizeHint;
130 QSize myFullSizeHint; 131 QSize myFullSizeHint;
131 bool mFontChanged; 132 bool mFontChanged;
132 int mMonthSignalOffset; 133 int mMonthSignalOffset;
133 NavigatorBar *mNavigatorBar; 134 NavigatorBar *mNavigatorBar;
134 135
135 QFrame *headingSep; 136 QFrame *headingSep;
136 QFrame *weeknumSep; 137 QFrame *weeknumSep;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index c6e76c4..5a2dce3 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -83,98 +83,99 @@ KOrg::BaseView *KOViewManager::currentView()
83 return mCurrentView; 83 return mCurrentView;
84} 84}
85 85
86void KOViewManager::readSettings(KConfig *config) 86void KOViewManager::readSettings(KConfig *config)
87{ 87{
88 config->setGroup("General"); 88 config->setGroup("General");
89 QString view = config->readEntry("Current View"); 89 QString view = config->readEntry("Current View");
90 if (view == "WhatsNext") showWhatsNextView(); 90 if (view == "WhatsNext") showWhatsNextView();
91 else if (view == "Month") { 91 else if (view == "Month") {
92 if ( !KOPrefs::instance()->mMonthViewWeek ) 92 if ( !KOPrefs::instance()->mMonthViewWeek )
93 showMonthView(); 93 showMonthView();
94 else 94 else
95 showMonthViewWeek(); 95 showMonthViewWeek();
96 } 96 }
97 else if (view == "List") showListView(); 97 else if (view == "List") showListView();
98 else if (view == "Journal") showJournalView(); 98 else if (view == "Journal") showJournalView();
99 else if (view == "TimeSpan") showTimeSpanView(); 99 else if (view == "TimeSpan") showTimeSpanView();
100 else if (view == "Todo") showTodoView(); 100 else if (view == "Todo") showTodoView();
101 else { 101 else {
102 config->setGroup( "Views" ); 102 config->setGroup( "Views" );
103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
104 mCurrentAgendaView = dateCount; 104 mCurrentAgendaView = dateCount;
105 showAgendaView(); 105 showAgendaView();
106 mCurrentAgendaView = dateCount; 106 mCurrentAgendaView = dateCount;
107#ifdef DESKTOP_VERSION 107#ifdef DESKTOP_VERSION
108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); 108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) );
109#endif 109#endif
110 } 110 }
111} 111}
112 112
113void KOViewManager::showDateView( int view, QDate date) 113void KOViewManager::showDateView( int view, QDate date)
114{ 114{
115 static int lastMode = 0; 115 static int lastMode = 0;
116 static int lastCount = 0; 116 static int lastCount = 0;
117 static bool lastNDMode = false; 117 static bool lastNDMode = false;
118 static QDate lastDate; 118 static QDate lastDate;
119 //qDebug("date %d %s", view, date.toString().latin1()); 119 //qDebug("date %d %s", view, date.toString().latin1());
120 120
121 if (view != 9) 121 if (view != 9)
122 lastMode = 0; 122 lastMode = 0;
123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); 123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
124 bool savemFlagShowNextxDays = mFlagShowNextxDays; 124 bool savemFlagShowNextxDays = mFlagShowNextxDays;
125 mFlagShowNextxDays = false; 125 mFlagShowNextxDays = false;
126 if ( view == 3 ) { 126 if ( view == 3 ) {
127 //mCurrentAgendaView = 1 ; 127 //mCurrentAgendaView = 1 ;
128 lastDate = mMainView->dateNavigator()->selectedDates().first(); 128 lastDate = mMainView->dateNavigator()->selectedDates().first();
129 lastCount = mMainView->dateNavigator()->selectedDates().count(); 129 lastCount = mMainView->dateNavigator()->selectedDates().count();
130 lastNDMode = savemFlagShowNextxDays; 130 lastNDMode = savemFlagShowNextxDays;
131 mMainView->showDay( date ); 131 mMainView->dateNavigator()->selectDate( date );
132 lastMode = 1; 132 lastMode = 1;
133 mCurrentAgendaView = 1 ;
133 } else if (view == 4 ) { 134 } else if (view == 4 ) {
134 mCurrentAgendaView = 7 ; 135 mCurrentAgendaView = 7 ;
135 mMainView->dateNavigator()->selectDates( date, 7 ); 136 mMainView->dateNavigator()->selectDates( date, 7 );
136 } else if (view == 5 ) { 137 } else if (view == 5 ) {
137 mCurrentAgendaView = 14 ; 138 mCurrentAgendaView = 14 ;
138 mMainView->dateNavigator()->selectDates( date, 14); 139 mMainView->dateNavigator()->selectDates( date, 14);
139 } else if (view == 6 ) { 140 } else if (view == 6 ) {
140 //mMainView->dateNavigator()->selectDates( date, 7 ); 141 //mMainView->dateNavigator()->selectDates( date, 7 );
141 showMonthView(); 142 showMonthView();
142 } else if (view == 7 ) { 143 } else if (view == 7 ) {
143 mMainView->dateNavigator()->selectDate( date ); 144 mMainView->dateNavigator()->selectDate( date );
144 showJournalView(); 145 showJournalView();
145 } else if (view == 8 ) { 146 } else if (view == 8 ) {
146 globalFlagBlockAgenda = 1; 147 globalFlagBlockAgenda = 1;
147 if ( mCurrentAgendaView != 3 ) 148 if ( mCurrentAgendaView != 3 )
148 mCurrentAgendaView = -1; 149 mCurrentAgendaView = -1;
149 showAgendaView(KOPrefs::instance()->mFullViewMonth); 150 showAgendaView(KOPrefs::instance()->mFullViewMonth);
150 globalFlagBlockAgenda = 2; 151 globalFlagBlockAgenda = 2;
151 mMainView->dateNavigator()->selectDates( date , 152 mMainView->dateNavigator()->selectDates( date ,
152 KOPrefs::instance()->mNextXDays ); 153 KOPrefs::instance()->mNextXDays );
153 mFlagShowNextxDays = true; 154 mFlagShowNextxDays = true;
154 mCurrentAgendaView = 3 ; 155 mCurrentAgendaView = 3 ;
155 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) 156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode )
156 if ( lastMode ) { 157 if ( lastMode ) {
157 mCurrentAgendaView = lastCount ; 158 mCurrentAgendaView = lastCount ;
158 mMainView->dateNavigator()->selectDates( lastDate, lastCount); 159 mMainView->dateNavigator()->selectDates( lastDate, lastCount);
159 mFlagShowNextxDays = lastNDMode; 160 mFlagShowNextxDays = lastNDMode;
160 if ( mFlagShowNextxDays ) { 161 if ( mFlagShowNextxDays ) {
161 mCurrentAgendaView = 3 ; 162 mCurrentAgendaView = 3 ;
162 } 163 }
163 } else 164 } else
164 showWeekView(); 165 showWeekView();
165 } else if (view == 10) { 166 } else if (view == 10) {
166 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); 167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() );
167 } 168 }
168} 169}
169 170
170 171
171 172
172void KOViewManager::writeSettings(KConfig *config) 173void KOViewManager::writeSettings(KConfig *config)
173{ 174{
174 config->setGroup("General"); 175 config->setGroup("General");
175 176
176 QString view; 177 QString view;
177 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 178 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
178 else if (mCurrentView == mMonthView) view = "Month"; 179 else if (mCurrentView == mMonthView) view = "Month";
179 else if (mCurrentView == mListView) view = "List"; 180 else if (mCurrentView == mListView) view = "List";
180 else if (mCurrentView == mJournalView) view = "Journal"; 181 else if (mCurrentView == mJournalView) view = "Journal";
@@ -532,96 +533,103 @@ if (!mMonthView) {
532 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) ); 533 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) );
533 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 534 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
534 mMainView, SLOT ( showDay( QDate ) ) ); 535 mMainView, SLOT ( showDay( QDate ) ) );
535 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 536 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
536 connect( mMonthView, SIGNAL(nextMonth() ), 537 connect( mMonthView, SIGNAL(nextMonth() ),
537 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); 538 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) );
538 connect( mMonthView, SIGNAL(prevMonth() ), 539 connect( mMonthView, SIGNAL(prevMonth() ),
539 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); 540 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) );
540 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), 541 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ),
541 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); 542 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) );
542 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), 543 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ),
543 mMainView->dateNavigator(), SLOT( selectNextYear() ) ); 544 mMainView->dateNavigator(), SLOT( selectNextYear() ) );
544 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), 545 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ),
545 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); 546 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) );
546 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), 547 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ),
547 mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); 548 mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
548 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), 549 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
549 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); 550 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
550 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), 551 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
551 mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); 552 mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
552 553
553 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 554 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
554 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); 555 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) );
555 556
556 557
557 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), 558 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ),
558 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); 559 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) );
559 560
560 } 561 }
561} 562}
562void KOViewManager::showMonthViewWeek() 563void KOViewManager::showMonthViewWeek()
563{ 564{
564 createMonthView(); 565 createMonthView();
565 globalFlagBlockAgenda = 1; 566 globalFlagBlockAgenda = 1;
566 bool full = true; 567 bool full = true;
567 if ( mCurrentView == mMonthView) 568 if ( mCurrentView == mMonthView)
568 full = mMainView->leftFrame()->isVisible(); 569 full = mMainView->leftFrame()->isVisible();
569 if ( !KOPrefs::instance()->mMonthViewWeek ) { 570 if ( !KOPrefs::instance()->mMonthViewWeek ) {
570 mMonthView->switchView(); 571 mMonthView->switchView();
571 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 572 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
572 full = false; 573 full = false;
573 else 574 else
574 full = true; 575 full = true;
575 } 576 }
576 mMainView->dateNavigator()->selectWeek(); 577 mMainView->dateNavigator()->selectWeek();
577 showView(mMonthView, full ); 578 showView(mMonthView, full );
578} 579}
579 580
581void KOViewManager::showMonth( const QDate & date )
582{
583 mMainView->dateNavigator()->blockSignals( true );
584 mMainView->dateNavigator()->selectDate( date );
585 mMainView->dateNavigator()->blockSignals( false );
586 showMonthView();
587}
580void KOViewManager::showMonthView() 588void KOViewManager::showMonthView()
581 { 589 {
582 590
583 createMonthView(); 591 createMonthView();
584 globalFlagBlockAgenda = 1; 592 globalFlagBlockAgenda = 1;
585 //mFlagShowNextxDays = false; 593 //mFlagShowNextxDays = false;
586 bool full = true; 594 bool full = true;
587 if ( mCurrentView == mMonthView) 595 if ( mCurrentView == mMonthView)
588 full = mMainView->leftFrame()->isVisible(); 596 full = mMainView->leftFrame()->isVisible();
589 // if(mMonthView == mCurrentView) return; 597 // if(mMonthView == mCurrentView) return;
590 if ( KOPrefs::instance()->mMonthViewWeek ) { 598 if ( KOPrefs::instance()->mMonthViewWeek ) {
591 mMonthView->switchView(); 599 mMonthView->switchView();
592 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 600 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
593 full = false; 601 full = false;
594 else 602 else
595 full = true; 603 full = true;
596 } 604 }
597 mMainView->dateNavigator()->selectMonth(); 605 mMainView->dateNavigator()->selectMonth();
598 606
599 showView(mMonthView, full ); 607 showView(mMonthView, full );
600 608
601} 609}
602 610
603void KOViewManager::showTodoView() 611void KOViewManager::showTodoView()
604{ 612{
605 //mFlagShowNextxDays = false; 613 //mFlagShowNextxDays = false;
606 if ( !mTodoView ) { 614 if ( !mTodoView ) {
607 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 615 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
608 "KOViewManager::TodoView" ); 616 "KOViewManager::TodoView" );
609 617
610 addView( mTodoView ); 618 addView( mTodoView );
611 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 619 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
612 620
613 // SIGNALS/SLOTS FOR TODO VIEW 621 // SIGNALS/SLOTS FOR TODO VIEW
614 connect( mTodoView, SIGNAL( newTodoSignal() ), 622 connect( mTodoView, SIGNAL( newTodoSignal() ),
615 mMainView, SLOT( newTodo() ) ); 623 mMainView, SLOT( newTodo() ) );
616 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 624 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
617 mMainView, SLOT( newSubTodo( Todo *) ) ); 625 mMainView, SLOT( newSubTodo( Todo *) ) );
618 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 626 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
619 mMainView, SLOT( showTodo( Todo * ) ) ); 627 mMainView, SLOT( showTodo( Todo * ) ) );
620 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 628 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
621 mMainView, SLOT( editTodo( Todo * ) ) ); 629 mMainView, SLOT( editTodo( Todo * ) ) );
622 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 630 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
623 mMainView, SLOT( deleteTodo( Todo * ) ) ); 631 mMainView, SLOT( deleteTodo( Todo * ) ) );
624 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 632 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
625 mMainView, SLOT( purgeCompleted() ) ); 633 mMainView, SLOT( purgeCompleted() ) );
626 634
627 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 635 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 8f0bf82..6290227 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -36,85 +36,86 @@ class KOMonthView;
36class KOTimeSpanView; 36class KOTimeSpanView;
37class KOTodoView; 37class KOTodoView;
38class KOWhatsNextView; 38class KOWhatsNextView;
39class KOJournalView; 39class KOJournalView;
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43/** 43/**
44 This class manages the views of the calendar. It owns the objects and handles 44 This class manages the views of the calendar. It owns the objects and handles
45 creation and selection. 45 creation and selection.
46*/ 46*/
47class KOViewManager : public QObject 47class KOViewManager : public QObject
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 KOViewManager( CalendarView * ); 51 KOViewManager( CalendarView * );
52 virtual ~KOViewManager(); 52 virtual ~KOViewManager();
53 53
54 /** changes the view to be the currently selected view */ 54 /** changes the view to be the currently selected view */
55 void showView(KOrg::BaseView *, bool fullScreen = false ); 55 void showView(KOrg::BaseView *, bool fullScreen = false );
56 void updateWNview(); 56 void updateWNview();
57 void readSettings(KConfig *config); 57 void readSettings(KConfig *config);
58 void writeSettings(KConfig *config); 58 void writeSettings(KConfig *config);
59 bool showsNextDays(); 59 bool showsNextDays();
60 /** Read which view was shown last from config file */ 60 /** Read which view was shown last from config file */
61 void readCurrentView(KConfig *); 61 void readCurrentView(KConfig *);
62 /** Write which view is currently shown to config file */ 62 /** Write which view is currently shown to config file */
63 void writeCurrentView(KConfig *); 63 void writeCurrentView(KConfig *);
64 64
65 KOrg::BaseView *currentView(); 65 KOrg::BaseView *currentView();
66 66
67 void setDocumentId( const QString & ); 67 void setDocumentId( const QString & );
68 68
69 void updateView( const QDate &start, const QDate &end ); 69 void updateView( const QDate &start, const QDate &end );
70 70
71 void raiseCurrentView( bool fullScreen = false , bool updateView = false); 71 void raiseCurrentView( bool fullScreen = false , bool updateView = false);
72 72
73 void addView(KOrg::BaseView *); 73 void addView(KOrg::BaseView *);
74 74
75 Incidence *currentSelection(); 75 Incidence *currentSelection();
76 QDate currentSelectionDate(); 76 QDate currentSelectionDate();
77 77
78 KOAgendaView *agendaView() const { return mAgendaView; } 78 KOAgendaView *agendaView() const { return mAgendaView; }
79 79
80 signals: 80 signals:
81 void printWNV(); 81 void printWNV();
82 void signalFullScreen( bool ); 82 void signalFullScreen( bool );
83 void signalAgendaView( bool ); 83 void signalAgendaView( bool );
84 public slots: 84 public slots:
85 void showMonth( const QDate & );
85 void showDateView( int, QDate ); 86 void showDateView( int, QDate );
86 void updateView(); 87 void updateView();
87 void showWhatsNextView(); 88 void showWhatsNextView();
88 void showListView(); 89 void showListView();
89 void showAgendaView( bool fullScreen = false ); 90 void showAgendaView( bool fullScreen = false );
90 void showDayView(); 91 void showDayView();
91 void showWorkWeekView(); 92 void showWorkWeekView();
92 void showWeekView(); 93 void showWeekView();
93 void showNextXView(); 94 void showNextXView();
94 void showMonthView(); 95 void showMonthView();
95 void showMonthViewWeek(); 96 void showMonthViewWeek();
96 void showTodoView(); 97 void showTodoView();
97 void showJournalView(); 98 void showJournalView();
98 void showTimeSpanView(); 99 void showTimeSpanView();
99 100
100 private: 101 private:
101 void createMonthView(); 102 void createMonthView();
102 CalendarView *mMainView; 103 CalendarView *mMainView;
103 104
104 int mCurrentAgendaView; 105 int mCurrentAgendaView;
105 KOAgendaView *mAgendaView; 106 KOAgendaView *mAgendaView;
106 KOListView *mListView; 107 KOListView *mListView;
107 KOMonthView *mMonthView; 108 KOMonthView *mMonthView;
108 KOTodoView *mTodoView; 109 KOTodoView *mTodoView;
109 KOWhatsNextView *mWhatsNextView; 110 KOWhatsNextView *mWhatsNextView;
110 KOJournalView *mJournalView; 111 KOJournalView *mJournalView;
111 KOTimeSpanView *mTimeSpanView; 112 KOTimeSpanView *mTimeSpanView;
112 113
113 KOrg::BaseView *mCurrentView; // currently active event view 114 KOrg::BaseView *mCurrentView; // currently active event view
114 115
115 int mAgendaViewMode; 116 int mAgendaViewMode;
116 bool mFlagShowNextxDays; 117 bool mFlagShowNextxDays;
117 118
118}; 119};
119 120
120#endif 121#endif