-rw-r--r-- | korganizer/kodaymatrix.cpp | 87 | ||||
-rw-r--r-- | korganizer/kodaymatrix.h | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 3 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 13 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 9 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 13 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 2 |
7 files changed, 92 insertions, 36 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 17a1d13..df606d0 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -363,34 +363,39 @@ void KODayMatrix::computeEvent(Event *event, int i ) | |||
363 | if ( !holiStr.isEmpty() ) | 363 | if ( !holiStr.isEmpty() ) |
364 | holiStr += "\n"; | 364 | holiStr += "\n"; |
365 | holiStr += event->summary(); | 365 | holiStr += event->summary(); |
366 | if ( !event->location().isEmpty() ) | 366 | if ( !event->location().isEmpty() ) |
367 | holiStr += " (" + event->location() + ")"; | 367 | holiStr += " (" + event->location() + ")"; |
368 | mHolidays[i] =holiStr ; | 368 | mHolidays[i] =holiStr ; |
369 | eDays.setBit(i); | ||
369 | } | 370 | } |
370 | if ( event->isBirthday()) { | 371 | if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) { |
371 | pDays.setBit(i); | 372 | if ( event->isBirthday()) { |
372 | if ( !holiStr.isEmpty() ) | 373 | pDays.setBit(i); |
373 | holiStr += "\n"; | 374 | if ( !holiStr.isEmpty() ) |
374 | holiStr += i18n("Birthday") + ": "+event->summary(); | 375 | holiStr += "\n"; |
375 | if ( !event->location().isEmpty() ) | 376 | holiStr += i18n("Birthday") + ": "+event->summary(); |
376 | holiStr += " (" + event->location() + ")"; | 377 | if ( !event->location().isEmpty() ) |
377 | bDays.setBit(i); | 378 | holiStr += " (" + event->location() + ")"; |
378 | mHolidays[i] =holiStr ; | 379 | bDays.setBit(i); |
380 | mHolidays[i] =holiStr ; | ||
381 | } | ||
379 | } | 382 | } |
380 | eDays.setBit(i); | 383 | if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) |
384 | eDays.setBit(i); | ||
381 | } | 385 | } |
382 | void KODayMatrix::updateViewTimed() | 386 | void KODayMatrix::updateViewTimed() |
383 | { | 387 | { |
384 | mUpdateTimer->stop(); | 388 | mUpdateTimer->stop(); |
385 | if ( !mCalendar ) { | 389 | if ( !mCalendar ) { |
386 | qDebug("NOT CAL "); | 390 | qDebug("NOT CAL "); |
387 | return; | 391 | return; |
388 | } | 392 | } |
389 | #if 1 | 393 | #if 1 |
390 | 394 | ||
395 | |||
391 | int i; | 396 | int i; |
392 | int timeSpan = NUMDAYS-1; | 397 | int timeSpan = NUMDAYS-1; |
393 | QPtrList<Event> events = mCalendar->events(); | 398 | QPtrList<Event> events = mCalendar->events(); |
394 | Event *event; | 399 | Event *event; |
395 | QDateTime dt; | 400 | QDateTime dt; |
396 | bool ok; | 401 | bool ok; |
@@ -466,28 +471,58 @@ void KODayMatrix::updateViewTimed() | |||
466 | int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday | 471 | int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday |
467 | for(i = 0; i < NUMDAYS; i++) { | 472 | for(i = 0; i < NUMDAYS; i++) { |
468 | if ( ( (i+startDay) % 7 == 0 ) ) { | 473 | if ( ( (i+startDay) % 7 == 0 ) ) { |
469 | pDays.setBit(i); | 474 | pDays.setBit(i); |
470 | } | 475 | } |
471 | } | 476 | } |
472 | 477 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | |
473 | #if 0 | 478 | bDays.fill( false); |
474 | // insert due todos | 479 | // insert due todos |
475 | QPtrList<Todo> todos = calendar()->todos( ); | 480 | QPtrList<Todo> todos = mCalendar->todos( ); |
476 | Todo *todo; | 481 | Todo *todo; |
477 | for(todo = todos.first(); todo; todo = todos.next()) { | 482 | for(todo = todos.first(); todo; todo = todos.next()) { |
478 | //insertTodo( todo ); | 483 | //insertTodo( todo ); |
479 | if ( todo->hasDueDate() ) { | 484 | if ( todo->hasDueDate() ) { |
480 | int day = mStartDate.daysTo( todo->dtDue().date() ); | 485 | int day = mStartDate.daysTo( todo->dtDue().date() ); |
486 | if ( day >= 0 && day < timeSpan + 1) { | ||
487 | int i = day; | ||
488 | QString holiStr = mHolidays[i]; | ||
489 | pDays.setBit(i); | ||
490 | if ( !holiStr.isEmpty() ) | ||
491 | holiStr += "\n"; | ||
492 | holiStr += i18n("Todo") + ": "+todo->summary(); | ||
493 | if ( !todo->location().isEmpty() ) | ||
494 | holiStr += " (" + todo->location() + ")"; | ||
495 | bDays.setBit(i); | ||
496 | mHolidays[i] =holiStr ; | ||
497 | eDays.setBit(i); | ||
498 | } | ||
499 | } | ||
500 | } | ||
501 | } | ||
502 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | ||
503 | bDays.fill( false); | ||
504 | // insert due todos | ||
505 | QPtrList<Journal> todos = mCalendar->journals( ); | ||
506 | Journal *todo; | ||
507 | for(todo = todos.first(); todo; todo = todos.next()) { | ||
508 | int day = mStartDate.daysTo( todo->dtStart().date() ); | ||
481 | if ( day >= 0 && day < timeSpan + 1) { | 509 | if ( day >= 0 && day < timeSpan + 1) { |
482 | (*cells)[day]->insertTodo( todo ); | 510 | int i = day; |
511 | QString holiStr = mHolidays[i]; | ||
512 | pDays.setBit(i); | ||
513 | if ( !holiStr.isEmpty() ) | ||
514 | holiStr += "\n"; | ||
515 | holiStr += i18n("Journal"); | ||
516 | bDays.setBit(i); | ||
517 | mHolidays[i] =holiStr ; | ||
518 | eDays.setBit(i); | ||
519 | |||
483 | } | 520 | } |
484 | } | 521 | } |
485 | } | 522 | } |
486 | #endif | ||
487 | |||
488 | #else | 523 | #else |
489 | //qDebug("KODayMatrix::updateViewTimed "); | 524 | //qDebug("KODayMatrix::updateViewTimed "); |
490 | for(int i = 0; i < NUMDAYS; i++) { | 525 | for(int i = 0; i < NUMDAYS; i++) { |
491 | // if events are set for the day then remember to draw it bold | 526 | // if events are set for the day then remember to draw it bold |
492 | QPtrList<Event> eventlist = mCalendar->events(days[i]); | 527 | QPtrList<Event> eventlist = mCalendar->events(days[i]); |
493 | Event *event; | 528 | Event *event; |
@@ -533,13 +568,15 @@ void KODayMatrix::updateViewTimed() | |||
533 | mRedrawNeeded = true; | 568 | mRedrawNeeded = true; |
534 | if ( ! mPendingUpdateBeforeRepaint ) | 569 | if ( ! mPendingUpdateBeforeRepaint ) |
535 | repaint(false); | 570 | repaint(false); |
536 | } | 571 | } |
537 | void KODayMatrix::updateView(QDate actdate) | 572 | void KODayMatrix::updateView(QDate actdate) |
538 | { | 573 | { |
539 | 574 | if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView ) | |
575 | mRedrawNeeded = true; | ||
576 | mLastView = KOPrefs::instance()->mCurrentDisplayedView; | ||
540 | if ( ! actdate.isValid() ) { | 577 | if ( ! actdate.isValid() ) { |
541 | //qDebug("date not valid "); | 578 | //qDebug("date not valid "); |
542 | return; | 579 | return; |
543 | } | 580 | } |
544 | mDayChanged = false; | 581 | mDayChanged = false; |
545 | //flag to indicate if the starting day of the matrix has changed by this call | 582 | //flag to indicate if the starting day of the matrix has changed by this call |
@@ -1049,15 +1086,15 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
1049 | } | 1086 | } |
1050 | 1087 | ||
1051 | // if it is a holiday then use the default holiday color | 1088 | // if it is a holiday then use the default holiday color |
1052 | if ( pDays.testBit(i)) { | 1089 | if ( pDays.testBit(i)) { |
1053 | if ( bDays.testBit(i) ) { | 1090 | if ( bDays.testBit(i) ) { |
1054 | if ( hDays.testBit(i) ) | 1091 | if ( hDays.testBit(i) ) |
1055 | p.setPen(QColor(Qt::green)); | 1092 | p.setPen(QColor(0,200,0)); |
1056 | else | 1093 | else |
1057 | p.setPen(QColor(Qt::green).dark()); | 1094 | p.setPen(QColor(Qt::blue)); |
1058 | } else { | 1095 | } else { |
1059 | if (actcol == mDefaultTextColor ) { | 1096 | if (actcol == mDefaultTextColor ) { |
1060 | p.setPen(KOPrefs::instance()->mHolidayColor); | 1097 | p.setPen(KOPrefs::instance()->mHolidayColor); |
1061 | } else { | 1098 | } else { |
1062 | p.setPen(mHolidayColorShaded); | 1099 | p.setPen(mHolidayColorShaded); |
1063 | } | 1100 | } |
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index b686bd7..a3216d6 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h | |||
@@ -224,12 +224,13 @@ protected: | |||
224 | 224 | ||
225 | void dropEvent(QDropEvent *); | 225 | void dropEvent(QDropEvent *); |
226 | 226 | ||
227 | void resizeEvent(QResizeEvent *); | 227 | void resizeEvent(QResizeEvent *); |
228 | 228 | ||
229 | private: | 229 | private: |
230 | int mLastView; | ||
230 | void computeEvent(Event *even, int dayindex ); | 231 | void computeEvent(Event *even, int dayindex ); |
231 | int oldW, oldH; | 232 | int oldW, oldH; |
232 | bool mRedrawNeeded; | 233 | bool mRedrawNeeded; |
233 | KODaymatrixWhatsThis* mKODaymatrixWhatsThis; | 234 | KODaymatrixWhatsThis* mKODaymatrixWhatsThis; |
234 | bool mouseDown; | 235 | bool mouseDown; |
235 | QBitArray bDays; | 236 | QBitArray bDays; |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 843526d..ae61db6 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -1554,12 +1554,15 @@ void KOMonthView::updateView() | |||
1554 | if ( ! ok ) | 1554 | if ( ! ok ) |
1555 | break; | 1555 | break; |
1556 | if ( incidenceStart.date() > endDate ) | 1556 | if ( incidenceStart.date() > endDate ) |
1557 | break; | 1557 | break; |
1558 | } | 1558 | } |
1559 | } else { // no recur | 1559 | } else { // no recur |
1560 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) | ||
1561 | if ( event->uid().left(15) == QString("last-syncEvent-") ) | ||
1562 | continue; | ||
1560 | int st = event->dtStart().date().daysTo( endDate ); | 1563 | int st = event->dtStart().date().daysTo( endDate ); |
1561 | if ( st >= 0 ) { // start before timeend | 1564 | if ( st >= 0 ) { // start before timeend |
1562 | int end = mStartDate.daysTo( event->dtEnd().date() ); | 1565 | int end = mStartDate.daysTo( event->dtEnd().date() ); |
1563 | if ( end >= 0 ) { // end after timestart --- got one! | 1566 | if ( end >= 0 ) { // end after timestart --- got one! |
1564 | //normalize | 1567 | //normalize |
1565 | st = timeSpan - st; | 1568 | st = timeSpan - st; |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index cb9c272..d9d7924 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -853,16 +853,13 @@ void KOPrefsDialog::setupViewsTab() | |||
853 | 853 | ||
854 | passwdk = | 854 | passwdk = |
855 | addWidBool(i18n("Show location"), | 855 | addWidBool(i18n("Show location"), |
856 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 856 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
857 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 857 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
858 | 858 | ||
859 | passwdk = | 859 | |
860 | addWidBool(i18n("Show Sync Events in WN+Agenda"), | ||
861 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | ||
862 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | ||
863 | passwdk = | 860 | passwdk = |
864 | addWidBool(i18n("Use short date in WN+Event view"), | 861 | addWidBool(i18n("Use short date in WN+Event view"), |
865 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 862 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
866 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 863 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
867 | 864 | ||
868 | 865 | ||
@@ -949,13 +946,19 @@ dummy = | |||
949 | 946 | ||
950 | topFrame = addPage(i18n("View Options"),0,0); | 947 | topFrame = addPage(i18n("View Options"),0,0); |
951 | 948 | ||
952 | topLayout = new QGridLayout(topFrame,4,1); | 949 | topLayout = new QGridLayout(topFrame,4,1); |
953 | topLayout->setSpacing(mSpacingHint); | 950 | topLayout->setSpacing(mSpacingHint); |
954 | topLayout->setMargin(mMarginHint); | 951 | topLayout->setMargin(mMarginHint); |
955 | ii = 0; | 952 | ii = 0; |
953 | |||
954 | dummy = | ||
955 | addWidBool(i18n("Show Sync Events"), | ||
956 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | ||
957 | topLayout->addWidget(dummy->checkBox(), ii++,0); | ||
958 | |||
956 | lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); | 959 | lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); |
957 | topLayout->addWidget(lab ,ii++,0); | 960 | topLayout->addWidget(lab ,ii++,0); |
958 | 961 | ||
959 | dummy = addWidBool(i18n("Details"), | 962 | dummy = addWidBool(i18n("Details"), |
960 | &(KOPrefs::instance()->mEVshowDetails),topFrame); | 963 | &(KOPrefs::instance()->mEVshowDetails),topFrame); |
961 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 964 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 3aa9b6c..2e5a943 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -314,12 +314,13 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | |||
314 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 314 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
315 | //raiseCurrentView( full ); | 315 | //raiseCurrentView( full ); |
316 | mMainView->processIncidenceSelection( 0 ); | 316 | mMainView->processIncidenceSelection( 0 ); |
317 | //mMainView->updateView(); | 317 | //mMainView->updateView(); |
318 | raiseCurrentView( full, callupdate ); | 318 | raiseCurrentView( full, callupdate ); |
319 | mMainView->adaptNavigationUnits(); | 319 | mMainView->adaptNavigationUnits(); |
320 | mMainView->updateUnmanagedViews(); | ||
320 | } | 321 | } |
321 | 322 | ||
322 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 323 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
323 | { | 324 | { |
324 | mCurrentAgendaView = 0; | 325 | mCurrentAgendaView = 0; |
325 | if ( fullScreen ) { | 326 | if ( fullScreen ) { |
@@ -394,12 +395,13 @@ void KOViewManager::showWhatsNextView() | |||
394 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 395 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
395 | addView(mWhatsNextView); | 396 | addView(mWhatsNextView); |
396 | connect(this, SIGNAL( printWNV() ), | 397 | connect(this, SIGNAL( printWNV() ), |
397 | mWhatsNextView, SLOT( printMe() ) ); | 398 | mWhatsNextView, SLOT( printMe() ) ); |
398 | } | 399 | } |
399 | globalFlagBlockAgenda = 1; | 400 | globalFlagBlockAgenda = 1; |
401 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | ||
400 | showView(mWhatsNextView, true ); | 402 | showView(mWhatsNextView, true ); |
401 | //mWhatsNextView->updateView(); | 403 | //mWhatsNextView->updateView(); |
402 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | 404 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; |
403 | } | 405 | } |
404 | 406 | ||
405 | void KOViewManager::slotprintWNV() | 407 | void KOViewManager::slotprintWNV() |
@@ -440,12 +442,13 @@ void KOViewManager::showListView() | |||
440 | globalFlagBlockAgenda = 1; | 442 | globalFlagBlockAgenda = 1; |
441 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 443 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
442 | mMainView->setBlockShowDates( true ); | 444 | mMainView->setBlockShowDates( true ); |
443 | mMainView->dateNavigator()->selectMonth(); | 445 | mMainView->dateNavigator()->selectMonth(); |
444 | mMainView->setBlockShowDates( false ); | 446 | mMainView->setBlockShowDates( false ); |
445 | } | 447 | } |
448 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | ||
446 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 449 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
447 | //mFlagShowNextxDays = temp; | 450 | //mFlagShowNextxDays = temp; |
448 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | 451 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; |
449 | } | 452 | } |
450 | 453 | ||
451 | void KOViewManager::showAgendaView( bool fullScreen ) | 454 | void KOViewManager::showAgendaView( bool fullScreen ) |
@@ -507,12 +510,13 @@ void KOViewManager::showAgendaView( bool fullScreen ) | |||
507 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), | 510 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), |
508 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); | 511 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); |
509 | mAgendaView->readSettings(); | 512 | mAgendaView->readSettings(); |
510 | mAgendaView->updateConfig(); | 513 | mAgendaView->updateConfig(); |
511 | } | 514 | } |
512 | 515 | ||
516 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; | ||
513 | showView( mAgendaView, full); | 517 | showView( mAgendaView, full); |
514 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; | 518 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; |
515 | } | 519 | } |
516 | 520 | ||
517 | void KOViewManager::showDayView() | 521 | void KOViewManager::showDayView() |
518 | { | 522 | { |
@@ -565,12 +569,13 @@ void KOViewManager::showWeekView() | |||
565 | mCurrentAgendaView = 7 ; | 569 | mCurrentAgendaView = 7 ; |
566 | } | 570 | } |
567 | 571 | ||
568 | void KOViewManager::showNextXView() | 572 | void KOViewManager::showNextXView() |
569 | { | 573 | { |
570 | 574 | ||
575 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; | ||
571 | globalFlagBlockAgenda = 1; | 576 | globalFlagBlockAgenda = 1; |
572 | if ( mCurrentAgendaView != 3 ) | 577 | if ( mCurrentAgendaView != 3 ) |
573 | mCurrentAgendaView = -1; | 578 | mCurrentAgendaView = -1; |
574 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 579 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
575 | globalFlagBlockAgenda = 2; | 580 | globalFlagBlockAgenda = 2; |
576 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 581 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
@@ -652,12 +657,13 @@ if (!mMonthView) { | |||
652 | 657 | ||
653 | } | 658 | } |
654 | } | 659 | } |
655 | void KOViewManager::showMonthViewWeek() | 660 | void KOViewManager::showMonthViewWeek() |
656 | { | 661 | { |
657 | createMonthView(); | 662 | createMonthView(); |
663 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ; | ||
658 | globalFlagBlockAgenda = 1; | 664 | globalFlagBlockAgenda = 1; |
659 | bool full = true; | 665 | bool full = true; |
660 | if ( mCurrentView == mMonthView) | 666 | if ( mCurrentView == mMonthView) |
661 | full = mMainView->leftFrame()->isVisible(); | 667 | full = mMainView->leftFrame()->isVisible(); |
662 | if ( !KOPrefs::instance()->mMonthViewWeek ) { | 668 | if ( !KOPrefs::instance()->mMonthViewWeek ) { |
663 | mMonthView->switchView(); | 669 | mMonthView->switchView(); |
@@ -680,12 +686,13 @@ void KOViewManager::showMonth( const QDate & date ) | |||
680 | showMonthView(); | 686 | showMonthView(); |
681 | } | 687 | } |
682 | void KOViewManager::showMonthView() | 688 | void KOViewManager::showMonthView() |
683 | { | 689 | { |
684 | 690 | ||
685 | createMonthView(); | 691 | createMonthView(); |
692 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ; | ||
686 | globalFlagBlockAgenda = 1; | 693 | globalFlagBlockAgenda = 1; |
687 | //mFlagShowNextxDays = false; | 694 | //mFlagShowNextxDays = false; |
688 | bool full = true; | 695 | bool full = true; |
689 | if ( mCurrentView == mMonthView) | 696 | if ( mCurrentView == mMonthView) |
690 | full = mMainView->leftFrame()->isVisible(); | 697 | full = mMainView->leftFrame()->isVisible(); |
691 | // if(mMonthView == mCurrentView) return; | 698 | // if(mMonthView == mCurrentView) return; |
@@ -751,12 +758,13 @@ void KOViewManager::showTodoView() | |||
751 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 758 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
752 | KConfig *config = KOGlobals::config(); | 759 | KConfig *config = KOGlobals::config(); |
753 | mTodoView->restoreLayout(config,"Todo View"); | 760 | mTodoView->restoreLayout(config,"Todo View"); |
754 | mTodoView->setNavigator( mMainView->dateNavigator() ); | 761 | mTodoView->setNavigator( mMainView->dateNavigator() ); |
755 | } | 762 | } |
756 | 763 | ||
764 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; | ||
757 | globalFlagBlockAgenda = 1; | 765 | globalFlagBlockAgenda = 1; |
758 | showView( mTodoView, true ); | 766 | showView( mTodoView, true ); |
759 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; | 767 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; |
760 | 768 | ||
761 | } | 769 | } |
762 | 770 | ||
@@ -769,12 +777,13 @@ void KOViewManager::showJournalView() | |||
769 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, | 777 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, |
770 | SLOT( updateConfig() ) ); | 778 | SLOT( updateConfig() ) ); |
771 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); | 779 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); |
772 | addView(mJournalView); | 780 | addView(mJournalView); |
773 | } | 781 | } |
774 | 782 | ||
783 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; | ||
775 | showView(mJournalView); | 784 | showView(mJournalView); |
776 | mMainView->dateNavigator()->selectDates( 1 ); | 785 | mMainView->dateNavigator()->selectDates( 1 ); |
777 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; | 786 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; |
778 | } | 787 | } |
779 | 788 | ||
780 | void KOViewManager::showTimeSpanView() | 789 | void KOViewManager::showTimeSpanView() |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 95bef66..87cef20 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -183,22 +183,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
183 | if ( p->mToolBarUpF ) | 183 | if ( p->mToolBarUpF ) |
184 | tbd = Right; | 184 | tbd = Right; |
185 | else | 185 | else |
186 | tbd = Left; | 186 | tbd = Left; |
187 | } | 187 | } |
188 | filterToolBar = new QPEToolBar ( this ); | 188 | filterToolBar = new QPEToolBar ( this ); |
189 | filterMenubar = new QPEMenuBar( filterToolBar ); | 189 | filterMenubar = new QMenuBar( filterToolBar ); |
190 | QFontMetrics fm ( filterMenubar->font() ); | 190 | QFontMetrics fm ( filterMenubar->font() ); |
191 | 191 | ||
192 | filterPopupMenu = new QPopupMenu( this ); | 192 | filterPopupMenu = new QPopupMenu( this ); |
193 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 193 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
194 | QString addTest = "Ax"; | 194 | QString addTest = "A"; |
195 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | ||
195 | #ifdef DESKTOP_VERSION | 196 | #ifdef DESKTOP_VERSION |
196 | addTest = "AAAx"; | 197 | addTest = "AAABBBCCCx"; |
197 | #endif | 198 | #else |
198 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) ); | 199 | addTest = "AAx"; |
200 | #endif | ||
201 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); | ||
199 | addToolBar (filterToolBar , tbd ); | 202 | addToolBar (filterToolBar , tbd ); |
200 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 203 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
201 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 204 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
202 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | 205 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) |
203 | filterToolBar->hide(); | 206 | filterToolBar->hide(); |
204 | } else { | 207 | } else { |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 45ed04d..8fd3d24 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -120,13 +120,13 @@ class MainWindow : public QMainWindow | |||
120 | bool mFlagKeyPressed; | 120 | bool mFlagKeyPressed; |
121 | bool mBlockAtStartup; | 121 | bool mBlockAtStartup; |
122 | QPEToolBar *iconToolBar; | 122 | QPEToolBar *iconToolBar; |
123 | QPEToolBar *viewToolBar; | 123 | QPEToolBar *viewToolBar; |
124 | QPEToolBar *navigatorToolBar; | 124 | QPEToolBar *navigatorToolBar; |
125 | QPEToolBar *filterToolBar; | 125 | QPEToolBar *filterToolBar; |
126 | QPEMenuBar *filterMenubar; | 126 | QMenuBar *filterMenubar; |
127 | QPopupMenu * filterPopupMenu; | 127 | QPopupMenu * filterPopupMenu; |
128 | void initActions(); | 128 | void initActions(); |
129 | void setDefaultPreferences(); | 129 | void setDefaultPreferences(); |
130 | void resizeEvent( QResizeEvent* e); | 130 | void resizeEvent( QResizeEvent* e); |
131 | void keyPressEvent ( QKeyEvent * ) ; | 131 | void keyPressEvent ( QKeyEvent * ) ; |
132 | void keyReleaseEvent ( QKeyEvent * ) ; | 132 | void keyReleaseEvent ( QKeyEvent * ) ; |