summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-04-19 19:32:54 (UTC)
committer zautrix <zautrix>2005-04-19 19:32:54 (UTC)
commitcdcb0e0d0163695c56cf7cf9bd3f046ac63173ee (patch) (unidiff)
tree70cb7e2db9d7075a7c7e7c38adbad0c50e5d8dc4 /korganizer
parentb36bdf88fbf3cc78e4bf072b5eb3ec16bd8ec235 (diff)
downloadkdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.zip
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.gz
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp87
-rw-r--r--korganizer/kodaymatrix.h1
-rw-r--r--korganizer/komonthview.cpp3
-rw-r--r--korganizer/koprefsdialog.cpp13
-rw-r--r--korganizer/koviewmanager.cpp9
-rw-r--r--korganizer/mainwindow.cpp13
-rw-r--r--korganizer/mainwindow.h2
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
@@ -366,18 +366,22 @@ void KODayMatrix::computeEvent(Event *event, int i )
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}
382void KODayMatrix::updateViewTimed() 386void KODayMatrix::updateViewTimed()
383{ 387{
@@ -388,6 +392,7 @@ void KODayMatrix::updateViewTimed()
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();
@@ -469,22 +474,52 @@ void KODayMatrix::updateViewTimed()
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++) {
@@ -536,7 +571,9 @@ void KODayMatrix::updateViewTimed()
536} 571}
537void KODayMatrix::updateView(QDate actdate) 572void 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;
@@ -1052,9 +1089,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
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);
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index b686bd7..a3216d6 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -227,6 +227,7 @@ protected:
227 void resizeEvent(QResizeEvent *); 227 void resizeEvent(QResizeEvent *);
228 228
229private: 229private:
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;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 843526d..ae61db6 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1557,6 +1557,9 @@ void KOMonthView::updateView()
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() );
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index cb9c272..d9d7924 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -856,10 +856,7 @@ void KOPrefsDialog::setupViewsTab()
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);
@@ -952,7 +949,13 @@ dummy =
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
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 3aa9b6c..2e5a943 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -317,6 +317,7 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
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
322void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 323void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
@@ -397,6 +398,7 @@ void KOViewManager::showWhatsNextView()
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;
@@ -443,6 +445,7 @@ void KOViewManager::showListView()
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;
@@ -510,6 +513,7 @@ void KOViewManager::showAgendaView( bool fullScreen )
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}
@@ -568,6 +572,7 @@ void KOViewManager::showWeekView()
568void KOViewManager::showNextXView() 572void 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;
@@ -655,6 +660,7 @@ if (!mMonthView) {
655void KOViewManager::showMonthViewWeek() 660void 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)
@@ -683,6 +689,7 @@ 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;
@@ -754,6 +761,7 @@ void KOViewManager::showTodoView()
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 ;
@@ -772,6 +780,7 @@ void KOViewManager::showJournalView()
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 ;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 95bef66..87cef20 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -186,16 +186,19 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
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() ) );
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 45ed04d..8fd3d24 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -123,7 +123,7 @@ class MainWindow : public QMainWindow
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();