-rw-r--r-- | korganizer/calendarview.cpp | 31 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 47 | ||||
-rw-r--r-- | korganizer/komonthview.h | 4 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 41 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 1 |
6 files changed, 49 insertions, 79 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 77de94f..0fbaa9a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -276,27 +276,24 @@ void CalendarView::init() | |||
276 | if ( mResourceManager ) { | 276 | if ( mResourceManager ) { |
277 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 277 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
278 | mResourceView->updateView(); | 278 | mResourceView->updateView(); |
279 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 279 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
280 | SLOT( updateView() ) ); | 280 | SLOT( updateView() ) ); |
281 | } else { | 281 | } else { |
282 | mResourceView = 0; | 282 | mResourceView = 0; |
283 | } | 283 | } |
284 | #endif | 284 | #endif |
285 | QWidget *rightBox = new QWidget( mPanner ); | 285 | QWidget *rightBox = new QWidget( mPanner ); |
286 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 286 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
287 | 287 | ||
288 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | ||
289 | rightLayout->addWidget( mNavigatorBar ); | ||
290 | |||
291 | mRightFrame = new QWidgetStack( rightBox ); | 288 | mRightFrame = new QWidgetStack( rightBox ); |
292 | rightLayout->addWidget( mRightFrame, 1 ); | 289 | rightLayout->addWidget( mRightFrame, 1 ); |
293 | 290 | ||
294 | mLeftFrame = mLeftSplitter; | 291 | mLeftFrame = mLeftSplitter; |
295 | #else | 292 | #else |
296 | QWidget *mainBox = new QWidget( this ); | 293 | QWidget *mainBox = new QWidget( this ); |
297 | QWidget *leftFrame = new QWidget( mainBox ); | 294 | QWidget *leftFrame = new QWidget( mainBox ); |
298 | 295 | ||
299 | QBoxLayout * mainBoxLayout; | 296 | QBoxLayout * mainBoxLayout; |
300 | QBoxLayout * leftFrameLayout; | 297 | QBoxLayout * leftFrameLayout; |
301 | if ( KOPrefs::instance()->mVerticalScreen ) { | 298 | if ( KOPrefs::instance()->mVerticalScreen ) { |
302 | mainBoxLayout = new QVBoxLayout(mainBox); | 299 | mainBoxLayout = new QVBoxLayout(mainBox); |
@@ -318,81 +315,65 @@ void CalendarView::init() | |||
318 | if ( QApplication::desktop()->width() < 480 ) { | 315 | if ( QApplication::desktop()->width() < 480 ) { |
319 | leftFrameLayout->addWidget(mFilterView); | 316 | leftFrameLayout->addWidget(mFilterView); |
320 | leftFrameLayout->addWidget(mTodoList, 2 ); | 317 | leftFrameLayout->addWidget(mTodoList, 2 ); |
321 | 318 | ||
322 | } else { | 319 | } else { |
323 | leftFrameLayout->addWidget(mTodoList,2 ); | 320 | leftFrameLayout->addWidget(mTodoList,2 ); |
324 | leftFrameLayout->addWidget(mFilterView ); | 321 | leftFrameLayout->addWidget(mFilterView ); |
325 | } | 322 | } |
326 | mFilterView->hide(); | 323 | mFilterView->hide(); |
327 | QWidget *rightBox = new QWidget( mainBox ); | 324 | QWidget *rightBox = new QWidget( mainBox ); |
328 | mainBoxLayout->addWidget ( rightBox, 10 ); | 325 | mainBoxLayout->addWidget ( rightBox, 10 ); |
329 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 326 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
330 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | ||
331 | mRightFrame = new QWidgetStack( rightBox ); | 327 | mRightFrame = new QWidgetStack( rightBox ); |
332 | rightLayout->addWidget( mNavigatorBar ); | ||
333 | rightLayout->addWidget( mRightFrame, 10 ); | 328 | rightLayout->addWidget( mRightFrame, 10 ); |
334 | 329 | ||
335 | mLeftFrame = leftFrame; | 330 | mLeftFrame = leftFrame; |
336 | if ( KOPrefs::instance()->mVerticalScreen ) { | 331 | if ( KOPrefs::instance()->mVerticalScreen ) { |
337 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 332 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
338 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 333 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
339 | } else { | 334 | } else { |
340 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 335 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
341 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 336 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
342 | } | 337 | } |
343 | if ( !KOPrefs::instance()->mShowDateNavigator) | 338 | if ( !KOPrefs::instance()->mShowDateNavigator) |
344 | mDateNavigator->hide(); | 339 | mDateNavigator->hide(); |
345 | //qDebug("Calendarview Size %d %d ", width(), height()); | 340 | //qDebug("Calendarview Size %d %d ", width(), height()); |
346 | #endif | 341 | #endif |
347 | 342 | ||
348 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 343 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
349 | SLOT( showDates( const KCal::DateList & ) ) ); | 344 | SLOT( showDates( const KCal::DateList & ) ) ); |
350 | 345 | ||
351 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 346 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
352 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 347 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
353 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), | ||
354 | mNavigator, SLOT( selectPreviousYear() ) ); | ||
355 | connect( mNavigatorBar, SIGNAL( goNextYear() ), | ||
356 | mNavigator, SLOT( selectNextYear() ) ); | ||
357 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), | ||
358 | mNavigator, SLOT( selectPreviousMonth() ) ); | ||
359 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), | ||
360 | mNavigator, SLOT( selectNextMonth() ) ); | ||
361 | connect( mNavigatorBar, SIGNAL( selectWeek( int ) ), | ||
362 | mNavigator, SLOT( selectWeek( int ) ) ); | ||
363 | 348 | ||
364 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | ||
365 | mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); | ||
366 | 349 | ||
367 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 350 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
368 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 351 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
369 | 352 | ||
370 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 353 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
371 | mNavigator, SLOT( selectPreviousYear() ) ); | 354 | mNavigator, SLOT( selectPreviousYear() ) ); |
372 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 355 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
373 | mNavigator, SLOT( selectNextYear() ) ); | 356 | mNavigator, SLOT( selectNextYear() ) ); |
374 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 357 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
375 | mNavigator, SLOT( selectPreviousMonth() ) ); | 358 | mNavigator, SLOT( selectPreviousMonth() ) ); |
376 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 359 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
377 | mNavigator, SLOT( selectNextMonth() ) ); | 360 | mNavigator, SLOT( selectNextMonth() ) ); |
378 | 361 | ||
379 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 362 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
380 | mNavigator, SLOT( selectPrevious() ) ); | 363 | mNavigator, SLOT( selectPrevious() ) ); |
381 | connect( mDateNavigator, SIGNAL( goNext() ), | 364 | connect( mDateNavigator, SIGNAL( goNext() ), |
382 | mNavigator, SLOT( selectNext() ) ); | 365 | mNavigator, SLOT( selectNext() ) ); |
383 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 366 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
384 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 367 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
385 | connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), | ||
386 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | ||
387 | 368 | ||
388 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 369 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
389 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 370 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
390 | 371 | ||
391 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), | 372 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), |
392 | SLOT( eventAdded( Event *) ) ); | 373 | SLOT( eventAdded( Event *) ) ); |
393 | 374 | ||
394 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 375 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
395 | 376 | ||
396 | connect( this, SIGNAL( configChanged() ), | 377 | connect( this, SIGNAL( configChanged() ), |
397 | mDateNavigator, SLOT( updateConfig() ) ); | 378 | mDateNavigator, SLOT( updateConfig() ) ); |
398 | 379 | ||
@@ -3859,36 +3840,24 @@ void CalendarView::purgeCompleted() | |||
3859 | removeCompletedSubTodos( aTodo ); | 3840 | removeCompletedSubTodos( aTodo ); |
3860 | } | 3841 | } |
3861 | 3842 | ||
3862 | updateView(); | 3843 | updateView(); |
3863 | } | 3844 | } |
3864 | } | 3845 | } |
3865 | 3846 | ||
3866 | void CalendarView::slotCalendarChanged() | 3847 | void CalendarView::slotCalendarChanged() |
3867 | { | 3848 | { |
3868 | ; | 3849 | ; |
3869 | } | 3850 | } |
3870 | 3851 | ||
3871 | NavigatorBar *CalendarView::navigatorBar() | ||
3872 | { | ||
3873 | return mNavigatorBar; | ||
3874 | } | ||
3875 | void CalendarView::showNavigatorBar( bool b) | ||
3876 | { | ||
3877 | if ( b ) mNavigatorBar->show(); | ||
3878 | else mNavigatorBar->hide(); | ||
3879 | } | ||
3880 | |||
3881 | |||
3882 | |||
3883 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 3852 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
3884 | { | 3853 | { |
3885 | //qDebug(" alendarView::keyPressEvent "); | 3854 | //qDebug(" alendarView::keyPressEvent "); |
3886 | e->ignore(); | 3855 | e->ignore(); |
3887 | } | 3856 | } |
3888 | 3857 | ||
3889 | 3858 | ||
3890 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 3859 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
3891 | { | 3860 | { |
3892 | // mSyncManager = manager; | 3861 | // mSyncManager = manager; |
3893 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 3862 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
3894 | qDebug("KO: SyncKDE request detected!"); | 3863 | qDebug("KO: SyncKDE request detected!"); |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8d7ff36..731298d 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -48,25 +48,24 @@ class QWidgetStack; | |||
48 | class QSplitter; | 48 | class QSplitter; |
49 | 49 | ||
50 | class CalPrinter; | 50 | class CalPrinter; |
51 | class KOFilterView; | 51 | class KOFilterView; |
52 | class KOViewManager; | 52 | class KOViewManager; |
53 | class KODialogManager; | 53 | class KODialogManager; |
54 | class KOTodoView; | 54 | class KOTodoView; |
55 | class KDateNavigator; | 55 | class KDateNavigator; |
56 | class DateNavigator; | 56 | class DateNavigator; |
57 | class KOIncidenceEditor; | 57 | class KOIncidenceEditor; |
58 | class KDatePicker; | 58 | class KDatePicker; |
59 | class ResourceView; | 59 | class ResourceView; |
60 | class NavigatorBar; | ||
61 | class KOEventEditor; | 60 | class KOEventEditor; |
62 | class KOTodoEditor ; | 61 | class KOTodoEditor ; |
63 | class KOEventViewerDialog; | 62 | class KOEventViewerDialog; |
64 | class KOBeamPrefs; | 63 | class KOBeamPrefs; |
65 | class KSyncProfile; | 64 | class KSyncProfile; |
66 | class AlarmDialog; | 65 | class AlarmDialog; |
67 | class KCal::Attendee; | 66 | class KCal::Attendee; |
68 | 67 | ||
69 | namespace KCal { class FileStorage; } | 68 | namespace KCal { class FileStorage; } |
70 | 69 | ||
71 | using namespace KCal; | 70 | using namespace KCal; |
72 | 71 | ||
@@ -97,25 +96,24 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
97 | virtual ~CalendarView(); | 96 | virtual ~CalendarView(); |
98 | 97 | ||
99 | Calendar *calendar() { return mCalendar; } | 98 | Calendar *calendar() { return mCalendar; } |
100 | 99 | ||
101 | KOViewManager *viewManager(); | 100 | KOViewManager *viewManager(); |
102 | KODialogManager *dialogManager(); | 101 | KODialogManager *dialogManager(); |
103 | 102 | ||
104 | QDate startDate(); | 103 | QDate startDate(); |
105 | QDate endDate(); | 104 | QDate endDate(); |
106 | 105 | ||
107 | QWidgetStack *viewStack(); | 106 | QWidgetStack *viewStack(); |
108 | QWidget *leftFrame(); | 107 | QWidget *leftFrame(); |
109 | NavigatorBar *navigatorBar(); | ||
110 | 108 | ||
111 | DateNavigator *dateNavigator(); | 109 | DateNavigator *dateNavigator(); |
112 | KDateNavigator *dateNavigatorWidget(); | 110 | KDateNavigator *dateNavigatorWidget(); |
113 | 111 | ||
114 | void addView(KOrg::BaseView *); | 112 | void addView(KOrg::BaseView *); |
115 | void showView(KOrg::BaseView *); | 113 | void showView(KOrg::BaseView *); |
116 | KOEventViewerDialog* getEventViewerDialog(); | 114 | KOEventViewerDialog* getEventViewerDialog(); |
117 | Incidence *currentSelection(); | 115 | Incidence *currentSelection(); |
118 | 116 | ||
119 | signals: | 117 | signals: |
120 | void save (); | 118 | void save (); |
121 | void saveStopTimer (); | 119 | void saveStopTimer (); |
@@ -167,25 +165,24 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
167 | 165 | ||
168 | /** Emitted, when the number of outgoing messages has changed. */ | 166 | /** Emitted, when the number of outgoing messages has changed. */ |
169 | void numOutgoingChanged(int); | 167 | void numOutgoingChanged(int); |
170 | 168 | ||
171 | /** Send status message, which can e.g. be displayed in the status bar. */ | 169 | /** Send status message, which can e.g. be displayed in the status bar. */ |
172 | void statusMessage(const QString &); | 170 | void statusMessage(const QString &); |
173 | 171 | ||
174 | void calendarViewExpanded( bool ); | 172 | void calendarViewExpanded( bool ); |
175 | void updateSearchDialog(); | 173 | void updateSearchDialog(); |
176 | 174 | ||
177 | 175 | ||
178 | public slots: | 176 | public slots: |
179 | void showNavigatorBar(bool); | ||
180 | void showOpenError(); | 177 | void showOpenError(); |
181 | void watchSavedFile(); | 178 | void watchSavedFile(); |
182 | void recheckTimerAlarm(); | 179 | void recheckTimerAlarm(); |
183 | void checkNextTimerAlarm(); | 180 | void checkNextTimerAlarm(); |
184 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 181 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
185 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 182 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
186 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 183 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
187 | 184 | ||
188 | /** options dialog made a changed to the configuration. we catch this | 185 | /** options dialog made a changed to the configuration. we catch this |
189 | * and notify all widgets which need to update their configuration. */ | 186 | * and notify all widgets which need to update their configuration. */ |
190 | void updateConfig(); | 187 | void updateConfig(); |
191 | 188 | ||
@@ -524,25 +521,24 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
524 | 521 | ||
525 | void calendarModified( bool, Calendar * ); | 522 | void calendarModified( bool, Calendar * ); |
526 | 523 | ||
527 | CalPrinter *mCalPrinter; | 524 | CalPrinter *mCalPrinter; |
528 | 525 | ||
529 | QSplitter *mPanner; | 526 | QSplitter *mPanner; |
530 | QSplitter *mLeftSplitter; | 527 | QSplitter *mLeftSplitter; |
531 | QWidget *mLeftFrame; | 528 | QWidget *mLeftFrame; |
532 | QWidgetStack *mRightFrame; | 529 | QWidgetStack *mRightFrame; |
533 | 530 | ||
534 | KDatePicker* mDatePicker; | 531 | KDatePicker* mDatePicker; |
535 | QVBox* mDateFrame; | 532 | QVBox* mDateFrame; |
536 | NavigatorBar *mNavigatorBar; | ||
537 | 533 | ||
538 | KDateNavigator *mDateNavigator; // widget showing small month view. | 534 | KDateNavigator *mDateNavigator; // widget showing small month view. |
539 | 535 | ||
540 | KOFilterView *mFilterView; | 536 | KOFilterView *mFilterView; |
541 | 537 | ||
542 | ResourceView *mResourceView; | 538 | ResourceView *mResourceView; |
543 | 539 | ||
544 | // calendar object for this viewing instance | 540 | // calendar object for this viewing instance |
545 | Calendar *mCalendar; | 541 | Calendar *mCalendar; |
546 | 542 | ||
547 | CalendarResourceManager *mResourceManager; | 543 | CalendarResourceManager *mResourceManager; |
548 | 544 | ||
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 234375b..7ba0b2f 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -784,41 +784,44 @@ void MonthViewCell::selection( QListBoxItem *item ) | |||
784 | // ******************************************************************************* | 784 | // ******************************************************************************* |
785 | // ******************************************************************************* | 785 | // ******************************************************************************* |
786 | // ******************************************************************************* | 786 | // ******************************************************************************* |
787 | 787 | ||
788 | 788 | ||
789 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | 789 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) |
790 | : KOEventView( calendar, parent, name ), | 790 | : KOEventView( calendar, parent, name ), |
791 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), | 791 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), |
792 | mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) | 792 | mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) |
793 | { | 793 | { |
794 | skipResize = false; | 794 | skipResize = false; |
795 | clPending = true; | 795 | clPending = true; |
796 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); | ||
796 | mWidStack = new QWidgetStack( this ); | 797 | mWidStack = new QWidgetStack( this ); |
797 | QHBoxLayout* hb = new QHBoxLayout( this ); | 798 | QVBoxLayout* hb = new QVBoxLayout( this ); |
798 | mMonthView = new QWidget( mWidStack ); | 799 | mMonthView = new QWidget( mWidStack ); |
799 | mWeekView = new QWidget( mWidStack ); | 800 | mWeekView = new QWidget( mWidStack ); |
800 | #if QT_VERSION >= 0x030000 | 801 | #if QT_VERSION >= 0x030000 |
801 | mWidStack->addWidget(mMonthView ); | 802 | mWidStack->addWidget(mMonthView ); |
802 | mWidStack->addWidget(mWeekView ); | 803 | mWidStack->addWidget(mWeekView ); |
803 | #else | 804 | #else |
804 | mWidStack->addWidget( mMonthView, 1 ); | 805 | mWidStack->addWidget( mMonthView, 1 ); |
805 | mWidStack->addWidget( mWeekView , 1 ); | 806 | mWidStack->addWidget( mWeekView , 1 ); |
806 | #endif | 807 | #endif |
808 | hb->addWidget( mNavigatorBar ); | ||
807 | hb->addWidget( mWidStack ); | 809 | hb->addWidget( mWidStack ); |
808 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); | 810 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); |
809 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; | 811 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; |
810 | if ( mShowWeekView ) | 812 | if ( mShowWeekView ) |
811 | mWeekStartsMonday = true; | 813 | mWeekStartsMonday = true; |
812 | updatePossible = false; | 814 | updatePossible = false; |
815 | //updatePossible = true; | ||
813 | mCells.setAutoDelete( true ); | 816 | mCells.setAutoDelete( true ); |
814 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 817 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
815 | mDayLabels.resize( mDaysPerWeek ); | 818 | mDayLabels.resize( mDaysPerWeek ); |
816 | mDayLabelsW.resize( mDaysPerWeek ); | 819 | mDayLabelsW.resize( mDaysPerWeek ); |
817 | QFont bfont = font(); | 820 | QFont bfont = font(); |
818 | if ( QApplication::desktop()->width() < 650 ) { | 821 | if ( QApplication::desktop()->width() < 650 ) { |
819 | bfont.setPointSize( bfont.pointSize() - 2 ); | 822 | bfont.setPointSize( bfont.pointSize() - 2 ); |
820 | } | 823 | } |
821 | bfont.setBold( true ); | 824 | bfont.setBold( true ); |
822 | int i; | 825 | int i; |
823 | 826 | ||
824 | for( i = 0; i < mDaysPerWeek; i++ ) { | 827 | for( i = 0; i < mDaysPerWeek; i++ ) { |
@@ -908,24 +911,28 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
908 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); | 911 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); |
909 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; | 912 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; |
910 | } | 913 | } |
911 | 914 | ||
912 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); | 915 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); |
913 | 916 | ||
914 | if ( mShowWeekView ) | 917 | if ( mShowWeekView ) |
915 | mWidStack->raiseWidget( mWeekView ); | 918 | mWidStack->raiseWidget( mWeekView ); |
916 | else | 919 | else |
917 | mWidStack->raiseWidget( mMonthView ); | 920 | mWidStack->raiseWidget( mMonthView ); |
918 | 921 | ||
919 | emit incidenceSelected( 0 ); | 922 | emit incidenceSelected( 0 ); |
923 | #ifndef DESKTOP_VERSION | ||
924 | resize( QApplication::desktop()->size() ); | ||
925 | computeLayout(); | ||
926 | #endif | ||
920 | } | 927 | } |
921 | 928 | ||
922 | KOMonthView::~KOMonthView() | 929 | KOMonthView::~KOMonthView() |
923 | { | 930 | { |
924 | delete mContextMenu; | 931 | delete mContextMenu; |
925 | } | 932 | } |
926 | 933 | ||
927 | void KOMonthView::selectInternalWeekNum ( int n ) | 934 | void KOMonthView::selectInternalWeekNum ( int n ) |
928 | { | 935 | { |
929 | switchView(); | 936 | switchView(); |
930 | emit selectWeekNum ( n ); | 937 | emit selectWeekNum ( n ); |
931 | } | 938 | } |
@@ -934,25 +941,24 @@ int KOMonthView::currentWeek() | |||
934 | { | 941 | { |
935 | if ( mShowWeekView ) | 942 | if ( mShowWeekView ) |
936 | return mWeekLabelsW[0]->getWeekNum(); | 943 | return mWeekLabelsW[0]->getWeekNum(); |
937 | return mWeekLabels[0]->getWeekNum(); | 944 | return mWeekLabels[0]->getWeekNum(); |
938 | } | 945 | } |
939 | void KOMonthView::switchView() | 946 | void KOMonthView::switchView() |
940 | { | 947 | { |
941 | 948 | ||
942 | if ( selectedCell( ) ) | 949 | if ( selectedCell( ) ) |
943 | selectedCell()->deselect(); | 950 | selectedCell()->deselect(); |
944 | mShowWeekView = !mShowWeekView; | 951 | mShowWeekView = !mShowWeekView; |
945 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; | 952 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; |
946 | //emit showNavigator( !mShowWeekView ); | ||
947 | if ( clPending ) { | 953 | if ( clPending ) { |
948 | computeLayout(); | 954 | computeLayout(); |
949 | updateConfig(); | 955 | updateConfig(); |
950 | } | 956 | } |
951 | if ( mShowWeekView ) | 957 | if ( mShowWeekView ) |
952 | mWidStack->raiseWidget( mWeekView ); | 958 | mWidStack->raiseWidget( mWeekView ); |
953 | else | 959 | else |
954 | mWidStack->raiseWidget( mMonthView ); | 960 | mWidStack->raiseWidget( mMonthView ); |
955 | clPending = false; | 961 | clPending = false; |
956 | } | 962 | } |
957 | 963 | ||
958 | int KOMonthView::maxDatesHint() | 964 | int KOMonthView::maxDatesHint() |
@@ -1251,71 +1257,65 @@ void KOMonthView::updateView() | |||
1251 | 1257 | ||
1252 | //qDebug("KOMonthView::updateView() "); | 1258 | //qDebug("KOMonthView::updateView() "); |
1253 | processSelectionChange(); | 1259 | processSelectionChange(); |
1254 | // qDebug("---------------------------------------------------------------------+ "); | 1260 | // qDebug("---------------------------------------------------------------------+ "); |
1255 | (*cells)[0]->setFocus(); | 1261 | (*cells)[0]->setFocus(); |
1256 | #endif | 1262 | #endif |
1257 | 1263 | ||
1258 | //qDebug("update time %d ", ti.elapsed()); | 1264 | //qDebug("update time %d ", ti.elapsed()); |
1259 | } | 1265 | } |
1260 | 1266 | ||
1261 | void KOMonthView::resizeEvent(QResizeEvent * e) | 1267 | void KOMonthView::resizeEvent(QResizeEvent * e) |
1262 | { | 1268 | { |
1263 | qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); | 1269 | //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); |
1264 | if ( skipResize ) { | ||
1265 | skipResize = false; | ||
1266 | qDebug("skipResize "); | ||
1267 | return; | ||
1268 | } | ||
1269 | computeLayout(); | 1270 | computeLayout(); |
1270 | clPending = true; | 1271 | clPending = true; |
1271 | if ( mShowWeekView ) | 1272 | if ( mShowWeekView ) |
1272 | mCellsW[0]->setFocus(); | 1273 | mCellsW[0]->setFocus(); |
1273 | else | 1274 | else |
1274 | mCells[0]->setFocus(); | 1275 | mCells[0]->setFocus(); |
1275 | } | 1276 | } |
1276 | void KOMonthView::computeLayoutWeek() | 1277 | void KOMonthView::computeLayoutWeek() |
1277 | { | 1278 | { |
1278 | static int lastWid = 0; | 1279 | static int lastWid = 0; |
1279 | static int lastHei = 0; | 1280 | static int lastHei = 0; |
1280 | int daysToShow; | 1281 | int daysToShow; |
1281 | bool combinedSatSun = false; | 1282 | bool combinedSatSun = false; |
1282 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1283 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1283 | daysToShow = 6; | 1284 | daysToShow = 6; |
1284 | combinedSatSun = true; | 1285 | combinedSatSun = true; |
1285 | } | 1286 | } |
1286 | int tWid = topLevelWidget()->size().width(); | 1287 | int tWid = topLevelWidget()->size().width(); |
1287 | int tHei = topLevelWidget()->size().height(); | 1288 | int tHei = topLevelWidget()->size().height(); |
1288 | 1289 | ||
1289 | int wid = size().width();//e | 1290 | int wid = width();//e |
1290 | int hei = size().height()-1; | 1291 | int hei = height()-1-mNavigatorBar->height(); |
1291 | 1292 | ||
1292 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) | 1293 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) |
1293 | return; | 1294 | return; |
1294 | 1295 | ||
1295 | |||
1296 | if ( lastWid == width() && lastHei ==height() ) | 1296 | if ( lastWid == width() && lastHei ==height() ) |
1297 | return; | 1297 | return; |
1298 | lastWid =width(); | 1298 | lastWid =width(); |
1299 | lastHei = height(); | 1299 | lastHei = height(); |
1300 | 1300 | ||
1301 | 1301 | ||
1302 | if ( wid < hei ) | 1302 | if ( wid < hei ) |
1303 | daysToShow = 2; | 1303 | daysToShow = 2; |
1304 | else | 1304 | else |
1305 | daysToShow = 3; | 1305 | daysToShow = 3; |
1306 | mShowSatSunComp = true; | 1306 | mShowSatSunComp = true; |
1307 | combinedSatSun = true; | 1307 | combinedSatSun = true; |
1308 | 1308 | ||
1309 | qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); | 1309 | //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); |
1310 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1310 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1311 | int weeklabelwid = fm.width( "888" ); | 1311 | int weeklabelwid = fm.width( "888" ); |
1312 | wid -= weeklabelwid; | 1312 | wid -= weeklabelwid; |
1313 | 1313 | ||
1314 | int colWid = wid / daysToShow; | 1314 | int colWid = wid / daysToShow; |
1315 | int lastCol = wid - ( colWid*6 ); | 1315 | int lastCol = wid - ( colWid*6 ); |
1316 | int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); | 1316 | int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); |
1317 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); | 1317 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); |
1318 | int colModulo = wid % daysToShow; | 1318 | int colModulo = wid % daysToShow; |
1319 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; | 1319 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; |
1320 | //qDebug("rowmod %d ", rowModulo); | 1320 | //qDebug("rowmod %d ", rowModulo); |
1321 | int i; | 1321 | int i; |
@@ -1378,60 +1378,63 @@ void KOMonthView::computeLayoutWeek() | |||
1378 | x = 0; | 1378 | x = 0; |
1379 | y += h+dayLabelHei ; | 1379 | y += h+dayLabelHei ; |
1380 | } | 1380 | } |
1381 | } | 1381 | } |
1382 | y= dayLabelHei; | 1382 | y= dayLabelHei; |
1383 | h = cellHei ; | 1383 | h = cellHei ; |
1384 | mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); | 1384 | mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); |
1385 | mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei); | 1385 | mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei); |
1386 | // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); | 1386 | // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); |
1387 | //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); | 1387 | //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); |
1388 | mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ; | 1388 | mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ; |
1389 | updateDayLabels(); | 1389 | updateDayLabels(); |
1390 | bool forceUpdate = !updatePossible; | 1390 | //bool forceUpdate = !updatePossible; |
1391 | updatePossible = true; | 1391 | updatePossible = true; |
1392 | //mWeekLabels[mNumWeeks]->setText( i18n("M")); | 1392 | //mWeekLabels[mNumWeeks]->setText( i18n("M")); |
1393 | if ( forceUpdate ) | 1393 | //if ( forceUpdate ) |
1394 | updateView(); | 1394 | // updateView(); |
1395 | } | 1395 | } |
1396 | void KOMonthView::computeLayout() | 1396 | void KOMonthView::computeLayout() |
1397 | { | 1397 | { |
1398 | 1398 | ||
1399 | 1399 | ||
1400 | static int lastWid = 0; | 1400 | static int lastWid = 0; |
1401 | static int lastHei = 0; | 1401 | static int lastHei = 0; |
1402 | 1402 | ||
1403 | if ( mShowWeekView ){ | 1403 | if ( mShowWeekView ){ |
1404 | computeLayoutWeek(); | 1404 | computeLayoutWeek(); |
1405 | return; | 1405 | return; |
1406 | } | 1406 | } |
1407 | int daysToShow = 7; | 1407 | int daysToShow = 7; |
1408 | bool combinedSatSun = false; | 1408 | bool combinedSatSun = false; |
1409 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1409 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1410 | daysToShow = 6; | 1410 | daysToShow = 6; |
1411 | combinedSatSun = true; | 1411 | combinedSatSun = true; |
1412 | } | 1412 | } |
1413 | int tWid = topLevelWidget()->size().width(); | 1413 | int tWid = topLevelWidget()->size().width(); |
1414 | int tHei = topLevelWidget()->size().height(); | 1414 | int tHei = topLevelWidget()->size().height(); |
1415 | 1415 | ||
1416 | int wid = size().width();//e | 1416 | int wid = width();//e |
1417 | int hei = size().height()-1; | 1417 | int hei = height()-1-mNavigatorBar->height(); |
1418 | 1418 | ||
1419 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) | 1419 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) { |
1420 | return; | 1420 | return; |
1421 | if ( lastWid == width() && lastHei ==height() ) | 1421 | } |
1422 | if ( lastWid == width() && lastHei == height() ){ | ||
1422 | return; | 1423 | return; |
1424 | } | ||
1425 | |||
1423 | lastWid =width(); | 1426 | lastWid =width(); |
1424 | lastHei = height(); | 1427 | lastHei = height(); |
1425 | qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); | 1428 | //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); |
1426 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1429 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1427 | int weeklabelwid = fm.width( "888" ); | 1430 | int weeklabelwid = fm.width( "888" ); |
1428 | wid -= weeklabelwid; | 1431 | wid -= weeklabelwid; |
1429 | 1432 | ||
1430 | int colWid = wid / daysToShow; | 1433 | int colWid = wid / daysToShow; |
1431 | int lastCol = wid - ( colWid*6 ); | 1434 | int lastCol = wid - ( colWid*6 ); |
1432 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); | 1435 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); |
1433 | int cellHei = (hei - dayLabelHei) /6; | 1436 | int cellHei = (hei - dayLabelHei) /6; |
1434 | int colModulo = wid % daysToShow; | 1437 | int colModulo = wid % daysToShow; |
1435 | int rowModulo = (hei- dayLabelHei) % 6; | 1438 | int rowModulo = (hei- dayLabelHei) % 6; |
1436 | //qDebug("rowmod %d ", rowModulo); | 1439 | //qDebug("rowmod %d ", rowModulo); |
1437 | int i; | 1440 | int i; |
@@ -1491,29 +1494,27 @@ void KOMonthView::computeLayout() | |||
1491 | h = cellHei ; | 1494 | h = cellHei ; |
1492 | for ( i = 0; i < 6; i++) { | 1495 | for ( i = 0; i < 6; i++) { |
1493 | if ( i == (6-rowModulo)) | 1496 | if ( i == (6-rowModulo)) |
1494 | ++h; | 1497 | ++h; |
1495 | mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); | 1498 | mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); |
1496 | y += h; | 1499 | y += h; |
1497 | } | 1500 | } |
1498 | mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); | 1501 | mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); |
1499 | // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); | 1502 | // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); |
1500 | //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); | 1503 | //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); |
1501 | mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; | 1504 | mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; |
1502 | updateDayLabels(); | 1505 | updateDayLabels(); |
1503 | bool forceUpdate = !updatePossible; | 1506 | //bool forceUpdate = !updatePossible; |
1504 | updatePossible = true; | 1507 | updatePossible = true; |
1505 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); | 1508 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); |
1506 | if ( forceUpdate ) | ||
1507 | updateView(); | ||
1508 | } | 1509 | } |
1509 | 1510 | ||
1510 | void KOMonthView::showContextMenu( Incidence *incidence ) | 1511 | void KOMonthView::showContextMenu( Incidence *incidence ) |
1511 | { | 1512 | { |
1512 | mContextMenu->showIncidencePopup(incidence); | 1513 | mContextMenu->showIncidencePopup(incidence); |
1513 | /* | 1514 | /* |
1514 | if( incidence && incidence->type() == "Event" ) { | 1515 | if( incidence && incidence->type() == "Event" ) { |
1515 | Event *event = static_cast<Event *>(incidence); | 1516 | Event *event = static_cast<Event *>(incidence); |
1516 | mContextMenu->showEventPopup(event); | 1517 | mContextMenu->showEventPopup(event); |
1517 | } else { | 1518 | } else { |
1518 | kdDebug() << "MonthView::showContextMenu(): cast failed." << endl; | 1519 | kdDebug() << "MonthView::showContextMenu(): cast failed." << endl; |
1519 | } | 1520 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a29a1a8..bf861ef 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -27,24 +27,25 @@ | |||
27 | #include <qpoint.h> | 27 | #include <qpoint.h> |
28 | #include <qwidgetstack.h> | 28 | #include <qwidgetstack.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qintdict.h> | 30 | #include <qintdict.h> |
31 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
32 | #include <qvaluelist.h> | 32 | #include <qvaluelist.h> |
33 | #include <qptrvector.h> | 33 | #include <qptrvector.h> |
34 | 34 | ||
35 | #include <libkcal/calendar.h> | 35 | #include <libkcal/calendar.h> |
36 | #include <libkcal/event.h> | 36 | #include <libkcal/event.h> |
37 | 37 | ||
38 | #include "koeventview.h" | 38 | #include "koeventview.h" |
39 | #include "navigatorbar.h" | ||
39 | 40 | ||
40 | #ifdef DESKTOP_VERSION | 41 | #ifdef DESKTOP_VERSION |
41 | class QToolTipGroup; | 42 | class QToolTipGroup; |
42 | #endif | 43 | #endif |
43 | 44 | ||
44 | class KNOWhatsThis; | 45 | class KNOWhatsThis; |
45 | class KOWeekButton : public QPushButton | 46 | class KOWeekButton : public QPushButton |
46 | { | 47 | { |
47 | Q_OBJECT | 48 | Q_OBJECT |
48 | public: | 49 | public: |
49 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : | 50 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : |
50 | QPushButton( parent, name) | 51 | QPushButton( parent, name) |
@@ -219,54 +220,55 @@ class KOMonthView: public KOEventView | |||
219 | virtual QPtrList<Incidence> selectedIncidences(); | 220 | virtual QPtrList<Incidence> selectedIncidences(); |
220 | 221 | ||
221 | /** returns dates of the currently selected events */ | 222 | /** returns dates of the currently selected events */ |
222 | virtual DateList selectedDates(); | 223 | virtual DateList selectedDates(); |
223 | 224 | ||
224 | virtual void printPreview(CalPrinter *calPrinter, | 225 | virtual void printPreview(CalPrinter *calPrinter, |
225 | const QDate &, const QDate &); | 226 | const QDate &, const QDate &); |
226 | bool isMonthView() { return true; } | 227 | bool isMonthView() { return true; } |
227 | bool isUpdatePossible() { return updatePossible; } | 228 | bool isUpdatePossible() { return updatePossible; } |
228 | 229 | ||
229 | MonthViewCell * selectedCell(); | 230 | MonthViewCell * selectedCell(); |
230 | bool skipResize; | 231 | bool skipResize; |
232 | NavigatorBar* navigatorBar() { return mNavigatorBar ;} | ||
231 | public slots: | 233 | public slots: |
232 | virtual void updateView(); | 234 | virtual void updateView(); |
233 | virtual void updateConfig(); | 235 | virtual void updateConfig(); |
234 | virtual void showDates(const QDate &start, const QDate &end); | 236 | virtual void showDates(const QDate &start, const QDate &end); |
235 | virtual void showEvents(QPtrList<Event> eventList); | 237 | virtual void showEvents(QPtrList<Event> eventList); |
236 | 238 | ||
237 | void changeEventDisplay(Event *, int); | 239 | void changeEventDisplay(Event *, int); |
238 | 240 | ||
239 | void clearSelection(); | 241 | void clearSelection(); |
240 | 242 | ||
241 | void showContextMenu( Incidence * ); | 243 | void showContextMenu( Incidence * ); |
242 | 244 | ||
243 | void setSelectedCell( MonthViewCell * ); | 245 | void setSelectedCell( MonthViewCell * ); |
244 | 246 | ||
245 | protected slots: | 247 | protected slots: |
246 | void selectInternalWeekNum ( int ); | 248 | void selectInternalWeekNum ( int ); |
247 | void switchView(); | 249 | void switchView(); |
248 | void processSelectionChange(); | 250 | void processSelectionChange(); |
249 | signals: | 251 | signals: |
250 | void nextMonth(); | 252 | void nextMonth(); |
251 | void prevMonth(); | 253 | void prevMonth(); |
252 | void showNavigator( bool ); | ||
253 | void selectWeekNum ( int ); | 254 | void selectWeekNum ( int ); |
254 | void showDaySignal( QDate ); | 255 | void showDaySignal( QDate ); |
255 | protected: | 256 | protected: |
256 | void resizeEvent(QResizeEvent *); | 257 | void resizeEvent(QResizeEvent *); |
257 | void viewChanged(); | 258 | void viewChanged(); |
258 | void updateDayLabels(); | 259 | void updateDayLabels(); |
259 | 260 | ||
260 | private: | 261 | private: |
262 | NavigatorBar* mNavigatorBar; | ||
261 | int currentWeek(); | 263 | int currentWeek(); |
262 | bool clPending; | 264 | bool clPending; |
263 | QWidgetStack * mWidStack; | 265 | QWidgetStack * mWidStack; |
264 | QWidget* mMonthView; | 266 | QWidget* mMonthView; |
265 | QWidget* mWeekView; | 267 | QWidget* mWeekView; |
266 | bool mShowWeekView; | 268 | bool mShowWeekView; |
267 | bool updatePossible; | 269 | bool updatePossible; |
268 | int mDaysPerWeek; | 270 | int mDaysPerWeek; |
269 | int mNumWeeks; | 271 | int mNumWeeks; |
270 | int mNumCells; | 272 | int mNumCells; |
271 | bool mWeekStartsMonday; | 273 | bool mWeekStartsMonday; |
272 | bool mShowSatSunComp; | 274 | bool mShowSatSunComp; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index ba15f7f..b551e2a 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -192,63 +192,48 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | |||
192 | if ( view == 0 ) { | 192 | if ( view == 0 ) { |
193 | view = mCurrentView; | 193 | view = mCurrentView; |
194 | if ( view == 0 ) | 194 | if ( view == 0 ) |
195 | return; | 195 | return; |
196 | } | 196 | } |
197 | bool full = fullScreen; | 197 | bool full = fullScreen; |
198 | if(view == mCurrentView && view != mWhatsNextView ) { | 198 | if(view == mCurrentView && view != mWhatsNextView ) { |
199 | if ( mCurrentAgendaView < 0 ) | 199 | if ( mCurrentAgendaView < 0 ) |
200 | return; | 200 | return; |
201 | full = mMainView->leftFrame()->isVisible(); | 201 | full = mMainView->leftFrame()->isVisible(); |
202 | } else { | 202 | } else { |
203 | if ( view == mMonthView && mMonthView) | 203 | if ( view == mMonthView && mMonthView) |
204 | mMonthView->skipResize = true ; | 204 | ;//mMonthView->skipResize = true ; |
205 | mCurrentView = view; | 205 | mCurrentView = view; |
206 | // bool full = fullScreen; | 206 | // bool full = fullScreen; |
207 | bool isFull = !mMainView->leftFrame()->isVisible(); | 207 | bool isFull = !mMainView->leftFrame()->isVisible(); |
208 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 208 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
209 | full = true; | 209 | full = true; |
210 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 210 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
211 | full = false; | 211 | full = false; |
212 | } | 212 | } |
213 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 213 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
214 | //raiseCurrentView( full ); | 214 | //raiseCurrentView( full ); |
215 | mMainView->processIncidenceSelection( 0 ); | 215 | mMainView->processIncidenceSelection( 0 ); |
216 | //mMainView->updateView(); | 216 | //mMainView->updateView(); |
217 | raiseCurrentView( full, true ); | 217 | raiseCurrentView( full, true ); |
218 | mMainView->adaptNavigationUnits(); | 218 | mMainView->adaptNavigationUnits(); |
219 | } | 219 | } |
220 | 220 | ||
221 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 221 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
222 | { | 222 | { |
223 | mCurrentAgendaView = 0; | 223 | mCurrentAgendaView = 0; |
224 | int wid = mMainView->width() ; | ||
225 | int hei = mMainView->height(); | ||
226 | if ( mCurrentView == mMonthView ) { | ||
227 | if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { | ||
228 | mMainView->navigatorBar()->show(); | ||
229 | hei -= mMainView->navigatorBar()->sizeHint().height(); | ||
230 | } | ||
231 | //mMainView->navigatorBar()->hide(); | ||
232 | } else { | ||
233 | mMainView->navigatorBar()->hide(); | ||
234 | } | ||
235 | if ( fullScreen ) { | 224 | if ( fullScreen ) { |
236 | mMainView->leftFrame()->hide(); | 225 | mMainView->leftFrame()->hide(); |
237 | } else { | 226 | } else { |
238 | mMainView->leftFrame()->show(); | 227 | mMainView->leftFrame()->show(); |
239 | if ( KOPrefs::instance()->mVerticalScreen ) | ||
240 | hei -= mMainView->leftFrame()->height(); | ||
241 | else | ||
242 | wid -= mMainView->leftFrame()->width(); | ||
243 | } | 228 | } |
244 | emit signalFullScreen( !fullScreen ); | 229 | emit signalFullScreen( !fullScreen ); |
245 | if ( callUpdateView ) | 230 | if ( callUpdateView ) |
246 | mMainView->updateView(); | 231 | mMainView->updateView(); |
247 | 232 | ||
248 | if ( globalFlagBlockAgenda == 5 ) { | 233 | if ( globalFlagBlockAgenda == 5 ) { |
249 | globalFlagBlockAgenda = 4; | 234 | globalFlagBlockAgenda = 4; |
250 | globalFlagBlockAgendaItemPaint = 1; | 235 | globalFlagBlockAgendaItemPaint = 1; |
251 | } | 236 | } |
252 | mMainView->viewStack()->raiseWidget(mCurrentView); | 237 | mMainView->viewStack()->raiseWidget(mCurrentView); |
253 | if ( globalFlagBlockAgenda == 4 ) { | 238 | if ( globalFlagBlockAgenda == 4 ) { |
254 | if ( mCurrentView == mAgendaView ) { | 239 | if ( mCurrentView == mAgendaView ) { |
@@ -518,29 +503,45 @@ void KOViewManager::showMonthView() | |||
518 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 503 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
519 | 504 | ||
520 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 505 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
521 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 506 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
522 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 507 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
523 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 508 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
524 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 509 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
525 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); | 510 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); |
526 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 511 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
527 | mMainView, SLOT ( showDay( QDate ) ) ); | 512 | mMainView, SLOT ( showDay( QDate ) ) ); |
528 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 513 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
529 | connect( mMonthView, SIGNAL(nextMonth() ), | 514 | connect( mMonthView, SIGNAL(nextMonth() ), |
530 | mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); | 515 | mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); |
531 | connect( mMonthView, SIGNAL(prevMonth() ), | 516 | connect( mMonthView, SIGNAL(prevMonth() ), |
532 | mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); | 517 | mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); |
533 | connect( mMonthView, SIGNAL( showNavigator(bool) ), | 518 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), |
534 | mMainView, SLOT ( showNavigatorBar(bool) ) ); | 519 | mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); |
520 | connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), | ||
521 | mMainView->dateNavigator(), SLOT( selectNextYear() ) ); | ||
522 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), | ||
523 | mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); | ||
524 | connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), | ||
525 | mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); | ||
526 | connect( mMonthView->navigatorBar(), SIGNAL( selectWeek( int ) ), | ||
527 | mMainView->dateNavigator(), SLOT( selectWeek( int ) ) ); | ||
528 | |||
529 | connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | ||
530 | mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); | ||
531 | |||
532 | |||
533 | connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), | ||
534 | mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); | ||
535 | |||
535 | } | 536 | } |
536 | 537 | ||
537 | globalFlagBlockAgenda = 1; | 538 | globalFlagBlockAgenda = 1; |
538 | //mFlagShowNextxDays = false; | 539 | //mFlagShowNextxDays = false; |
539 | // if(mMonthView == mCurrentView) return; | 540 | // if(mMonthView == mCurrentView) return; |
540 | if ( KOPrefs::instance()->mMonthViewWeek ) | 541 | if ( KOPrefs::instance()->mMonthViewWeek ) |
541 | mMainView->dateNavigator()->selectWeek(); | 542 | mMainView->dateNavigator()->selectWeek(); |
542 | else | 543 | else |
543 | mMainView->dateNavigator()->selectMonth(); | 544 | mMainView->dateNavigator()->selectMonth(); |
544 | 545 | ||
545 | showView(mMonthView, true ); | 546 | showView(mMonthView, true ); |
546 | 547 | ||
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 657f98d..f05e6f6 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -145,24 +145,25 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
145 | ctrlLayout->addWidget( mNextYear, 3 ); | 145 | ctrlLayout->addWidget( mNextYear, 3 ); |
146 | 146 | ||
147 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); | 147 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); |
148 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); | 148 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); |
149 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); | 149 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); |
150 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); | 150 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); |
151 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); | 151 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); |
152 | mPrevYear->setFocusPolicy(NoFocus); | 152 | mPrevYear->setFocusPolicy(NoFocus); |
153 | mPrevMonth->setFocusPolicy(NoFocus); | 153 | mPrevMonth->setFocusPolicy(NoFocus); |
154 | mNextMonth->setFocusPolicy(NoFocus); | 154 | mNextMonth->setFocusPolicy(NoFocus); |
155 | mNextYear->setFocusPolicy(NoFocus); | 155 | mNextYear->setFocusPolicy(NoFocus); |
156 | mSelectMonth->setFocusPolicy(NoFocus); | 156 | mSelectMonth->setFocusPolicy(NoFocus); |
157 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); | ||
157 | 158 | ||
158 | } | 159 | } |
159 | 160 | ||
160 | NavigatorBar::~NavigatorBar() | 161 | NavigatorBar::~NavigatorBar() |
161 | { | 162 | { |
162 | } | 163 | } |
163 | 164 | ||
164 | void NavigatorBar::selectMonth() | 165 | void NavigatorBar::selectMonth() |
165 | { | 166 | { |
166 | 167 | ||
167 | int month; | 168 | int month; |
168 | KPopupFrame* popup = new KPopupFrame(this); | 169 | KPopupFrame* popup = new KPopupFrame(this); |