summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-13 13:57:22 (UTC)
committer zautrix <zautrix>2005-06-13 13:57:22 (UTC)
commit56de219c5ce910a470a01a0e5003d1a113837ef4 (patch) (unidiff)
tree3393cb306cec8dcdc05d6ed0fae3ae7d374f2794 /korganizer
parent4f3ff02932b39bf16b9692c3cb69c101a28b4616 (diff)
downloadkdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.zip
kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.gz
kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp8
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/koagendaitem.cpp6
-rw-r--r--korganizer/kofilterview.cpp4
-rw-r--r--korganizer/kofilterview.h1
-rw-r--r--korganizer/komonthview.cpp4
-rw-r--r--korganizer/kotodoview.cpp52
-rw-r--r--korganizer/kotodoviewitem.cpp2
-rw-r--r--korganizer/kowhatsnextview.cpp4
9 files changed, 49 insertions, 33 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 07ec459..6e60c56 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -454,24 +454,27 @@ void CalendarView::init()
454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
455 "CalendarView::DateNavigator", QDate::currentDate()); 455 "CalendarView::DateNavigator", QDate::currentDate());
456#endif 456#endif
457 // mDateNavigator->blockSignals( true ); 457 // mDateNavigator->blockSignals( true );
458 //leftFrameLayout->addWidget( mDateNavigator ); 458 //leftFrameLayout->addWidget( mDateNavigator );
459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
462 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 462 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
463 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 463 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
464 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); 464 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) );
465 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 465 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
466 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
467 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
468 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
466 mTodoList->setNavigator( mNavigator ); 469 mTodoList->setNavigator( mNavigator );
467#if 0 470#if 0
468 if ( QApplication::desktop()->width() < 480 ) { 471 if ( QApplication::desktop()->width() < 480 ) {
469 leftFrameLayout->addWidget(mFilterView); 472 leftFrameLayout->addWidget(mFilterView);
470 leftFrameLayout->addWidget(mTodoList, 2 ); 473 leftFrameLayout->addWidget(mTodoList, 2 );
471 474
472 } else { 475 } else {
473 leftFrameLayout->addWidget(mTodoList,2 ); 476 leftFrameLayout->addWidget(mTodoList,2 );
474 leftFrameLayout->addWidget(mFilterView ); 477 leftFrameLayout->addWidget(mFilterView );
475 } 478 }
476#endif 479#endif
477 mFilterView->hide(); 480 mFilterView->hide();
@@ -1860,24 +1863,29 @@ bool CalendarView::restoreCalendarSettings()
1860{ 1863{
1861 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1864 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1862 KopiCalendarFile * cal = calendars.first(); 1865 KopiCalendarFile * cal = calendars.first();
1863 while ( cal ) { 1866 while ( cal ) {
1864 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 1867 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
1865 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 1868 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
1866 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 1869 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
1867 if ( cal->isStandard ) 1870 if ( cal->isStandard )
1868 mCalendar->setDefaultCalendar( cal->mCalNumber ); 1871 mCalendar->setDefaultCalendar( cal->mCalNumber );
1869 cal = calendars.next(); 1872 cal = calendars.next();
1870 } 1873 }
1871} 1874}
1875void CalendarView::addCalendarId( int id )
1876{
1877 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
1878 addCalendar( cal );
1879}
1872bool CalendarView::addCalendar( KopiCalendarFile * cal ) 1880bool CalendarView::addCalendar( KopiCalendarFile * cal )
1873{ 1881{
1874 1882
1875 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) 1883 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber ))
1876 return true; 1884 return true;
1877 qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() ); 1885 qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() );
1878 KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName)); 1886 KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName));
1879 return false; 1887 return false;
1880} 1888}
1881bool CalendarView::openCalendar(QString filename, bool merge) 1889bool CalendarView::openCalendar(QString filename, bool merge)
1882{ 1890{
1883 1891
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 0144ba4..ec5b7ab 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -218,24 +218,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
218 const QStringList& uidList); 218 const QStringList& uidList);
219 219
220 /** 220 /**
221 Load calendar from file \a filename. If \a merge is true, load 221 Load calendar from file \a filename. If \a merge is true, load
222 calendar into existing one, if it is false, clear calendar, before 222 calendar into existing one, if it is false, clear calendar, before
223 loading. Return true, if calendar could be successfully loaded. 223 loading. Return true, if calendar could be successfully loaded.
224 */ 224 */
225 bool openCalendar(QString filename, bool merge=false); 225 bool openCalendar(QString filename, bool merge=false);
226 bool loadCalendars(); 226 bool loadCalendars();
227 bool saveCalendars(); 227 bool saveCalendars();
228 bool restoreCalendarSettings(); 228 bool restoreCalendarSettings();
229 bool addCalendar( KopiCalendarFile * ); 229 bool addCalendar( KopiCalendarFile * );
230 void addCalendarId( int id );
230 bool syncCalendar(QString filename,int mode = 0 ); 231 bool syncCalendar(QString filename,int mode = 0 );
231 232
232 /** 233 /**
233 Save calendar data to file. Return true if calendar could be 234 Save calendar data to file. Return true if calendar could be
234 successfully saved. 235 successfully saved.
235 */ 236 */
236 bool saveCalendar(QString filename); 237 bool saveCalendar(QString filename);
237 238
238 /** 239 /**
239 Close calendar. Clear calendar data and reset views to display an empty 240 Close calendar. Clear calendar data and reset views to display an empty
240 calendar. 241 calendar.
241 */ 242 */
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 5a3c4d2..c7bc6eb 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -112,30 +112,30 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
112 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) 112 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date())
113 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; 113 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
114 else 114 else
115 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; 115 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
116 } 116 }
117 else { 117 else {
118 QStringList categories = mIncidence->categories(); 118 QStringList categories = mIncidence->categories();
119 QString cat = categories.first(); 119 QString cat = categories.first();
120 if (cat.isEmpty()) { 120 if (cat.isEmpty()) {
121 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) 121 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) )
122 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; 122 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
123 else 123 else
124 mBackgroundColor =KOPrefs::instance()->mEventColor; 124 mBackgroundColor =KOPrefs::instance()->defaultColor( incidence->calID() );
125 } else { 125 } else {
126 mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); 126 mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
127 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { 127 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
128 if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) 128 if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
129 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; 129 mBackgroundColor = KOPrefs::instance()->mTodoDoneColor;
130 } 130 }
131 } 131 }
132 132
133 } 133 }
134 mColorGroup = QColorGroup( mBackgroundColor.light(), 134 mColorGroup = QColorGroup( mBackgroundColor.light(),
135 mBackgroundColor.dark(),mBackgroundColor.light(), 135 mBackgroundColor.dark(),mBackgroundColor.light(),
136 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; 136 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ;
137 setBackgroundColor( mBackgroundColor ); 137 setBackgroundColor( mBackgroundColor );
138 138
139 mConflictItems.clear(); 139 mConflictItems.clear();
140 setCellXY(0,0,1); 140 setCellXY(0,0,1);
141 setCellXWidth(0); 141 setCellXWidth(0);
@@ -192,25 +192,25 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
192 else 192 else
193 y = mCellYTop * ( height() / cellHeight() ) +3; 193 y = mCellYTop * ( height() / cellHeight() ) +3;
194 if (mIncidence->cancelled()) { 194 if (mIncidence->cancelled()) {
195 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; 195 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
196 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; 196 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
197 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); 197 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
198 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); 198 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
199 if ( horLayout ) 199 if ( horLayout )
200 ++xOff; 200 ++xOff;
201 else 201 else
202 ++yOff; 202 ++yOff;
203 } 203 }
204 if (mIncidence->isAlarmEnabled()) { 204 if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) {
205 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); 205 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
206 if ( horLayout ) 206 if ( horLayout )
207 ++xOff; 207 ++xOff;
208 else 208 else
209 ++yOff; 209 ++yOff;
210 } 210 }
211 if (mIncidence->recurrence()->doesRecur()) { 211 if (mIncidence->recurrence()->doesRecur()) {
212 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); 212 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue );
213 if ( horLayout ) 213 if ( horLayout )
214 ++xOff; 214 ++xOff;
215 else 215 else
216 ++yOff; 216 ++yOff;
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 29a4393..2b16347 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -149,24 +149,25 @@ KOCalEditView::KOCalEditView(QWidget* parent,
149 mw = 0; 149 mw = 0;
150 ml = new QVBoxLayout ( this ); 150 ml = new QVBoxLayout ( this );
151} 151}
152 152
153KOCalEditView::~KOCalEditView() 153KOCalEditView::~KOCalEditView()
154{ 154{
155 // no need to delete child widgets, Qt does it all for us 155 // no need to delete child widgets, Qt does it all for us
156} 156}
157void KOCalEditView::selectCal(int id ,bool b) 157void KOCalEditView::selectCal(int id ,bool b)
158{ 158{
159 KOPrefs::instance()->getCalendar( id )->isEnabled = b; 159 KOPrefs::instance()->getCalendar( id )->isEnabled = b;
160 emit calendarEnabled ( id, b ); 160 emit calendarEnabled ( id, b );
161 emit needsUpdate();
161 162
162} 163}
163void KOCalEditView::selectStdCal( int id, bool b ) 164void KOCalEditView::selectStdCal( int id, bool b )
164{ 165{
165 166
166 if ( !b ) { 167 if ( !b ) {
167 KOCalCheckButton* it = (KOCalCheckButton*) sender(); 168 KOCalCheckButton* it = (KOCalCheckButton*) sender();
168 if ( it ) { 169 if ( it ) {
169 it->blockSignals( true ); 170 it->blockSignals( true );
170 it->setChecked( true ); 171 it->setChecked( true );
171 it->blockSignals( false ); 172 it->blockSignals( false );
172 return; 173 return;
@@ -190,34 +191,37 @@ void KOCalEditView::selectStdCal( int id, bool b )
190 while ( kkf ) { 191 while ( kkf ) {
191 kkf->isStandard = false; 192 kkf->isStandard = false;
192 kkf = KOPrefs::instance()->mCalendars.next(); 193 kkf = KOPrefs::instance()->mCalendars.next();
193 } 194 }
194 KOPrefs::instance()->getCalendar( id )->isStandard = true; 195 KOPrefs::instance()->getCalendar( id )->isStandard = true;
195 emit setCalendarDefault ( id ); 196 emit setCalendarDefault ( id );
196} 197}
197 198
198void KOCalEditView::selectCalAlarm(int id ,bool b ) 199void KOCalEditView::selectCalAlarm(int id ,bool b )
199{ 200{
200 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; 201 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b;
201 emit alarmEnabled ( id , b ); 202 emit alarmEnabled ( id , b );
203 emit needsUpdate();
202} 204}
203void KOCalEditView::selectReadOnly(int id ,bool b ) 205void KOCalEditView::selectReadOnly(int id ,bool b )
204{ 206{
205 KOPrefs::instance()->getCalendar( id )->isReadOnly = b; 207 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
206 emit calendarReadonly ( id , b ); 208 emit calendarReadonly ( id , b );
209 emit needsUpdate();
207 210
208} 211}
209void KOCalEditView::setColor( const QColor& c, int id ) 212void KOCalEditView::setColor( const QColor& c, int id )
210{ 213{
211 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 214 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
215 emit needsUpdate();
212} 216}
213void KOCalEditView::deleteCal( int id ) 217void KOCalEditView::deleteCal( int id )
214{ 218{
215 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 219 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
216 QString name = kkf->mName; 220 QString name = kkf->mName;
217 QString file = kkf->mFileName; 221 QString file = kkf->mFileName;
218 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b><tr> Do you want to remove this calendar from KO/Pi? (The file is not removed, of course!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; 222 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b><tr> Do you want to remove this calendar from KO/Pi? (The file is not removed, of course!)").arg(name).arg(file) ) != KMessageBox::Continue ) return;
219 emit removeCalendar ( id ); 223 emit removeCalendar ( id );
220 KOPrefs::instance()->mCalendars.remove ( kkf ); 224 KOPrefs::instance()->mCalendars.remove ( kkf );
221 readConfig(); 225 readConfig();
222} 226}
223void KOCalEditView::infoCal( int id ) 227void KOCalEditView::infoCal( int id )
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index aaf0eb6..4a0cd8a 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -129,24 +129,25 @@ class KOCalEditView : public QWidget
129 void selectCalAlarm(int,bool ); 129 void selectCalAlarm(int,bool );
130 void selectReadOnly(int,bool ); 130 void selectReadOnly(int,bool );
131 void setColor(const QColor &,int) ; 131 void setColor(const QColor &,int) ;
132 void deleteCal(int) ; 132 void deleteCal(int) ;
133 void infoCal(int) ; 133 void infoCal(int) ;
134 signals: 134 signals:
135 void alarmEnabled ( int cal, bool enable ); 135 void alarmEnabled ( int cal, bool enable );
136 void calendarEnabled ( int cal, bool enable ); 136 void calendarEnabled ( int cal, bool enable );
137 void calendarReadonly ( int cal, bool readonly ); 137 void calendarReadonly ( int cal, bool readonly );
138 void setCalendarDefault ( int cal ); 138 void setCalendarDefault ( int cal );
139 void removeCalendar ( int cal ); 139 void removeCalendar ( int cal );
140 void calendarAdded( int ); 140 void calendarAdded( int );
141 void needsUpdate();
141 142
142 private: 143 private:
143 QVBoxLayout* ml; 144 QVBoxLayout* ml;
144 QWidget *mw; 145 QWidget *mw;
145 void toggleList ( QPtrList<KOCalCheckButton> ); 146 void toggleList ( QPtrList<KOCalCheckButton> );
146 QPtrList<KOCalCheckButton> mStdandardB; 147 QPtrList<KOCalCheckButton> mStdandardB;
147 QPtrList<KOCalCheckButton> mEnabledB; 148 QPtrList<KOCalCheckButton> mEnabledB;
148 QPtrList<KOCalCheckButton> mAlarmB; 149 QPtrList<KOCalCheckButton> mAlarmB;
149 QPtrList<KOCalCheckButton> mROB; 150 QPtrList<KOCalCheckButton> mROB;
150 QGridLayout* mainLayout; 151 QGridLayout* mainLayout;
151}; 152};
152 153
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index c868270..96f2502 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -739,25 +739,25 @@ int MonthViewCell::insertEvent(Event *event)
739 if (cat.isEmpty()) { 739 if (cat.isEmpty()) {
740 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 740 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
741 } else { 741 } else {
742 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 742 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
743 } 743 }
744 } 744 }
745 745
746 } else { 746 } else {
747 pal = mStandardPalette ; 747 pal = mStandardPalette ;
748 } 748 }
749 item->setPalette( pal ); 749 item->setPalette( pal );
750 item->setRecur( event->recurrence()->doesRecur() ); 750 item->setRecur( event->recurrence()->doesRecur() );
751 item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); 751 item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() );
752 item->setMoreInfo( event->description().length() > 0 ); 752 item->setMoreInfo( event->description().length() > 0 );
753#ifdef DESKTOP_VERSION 753#ifdef DESKTOP_VERSION
754 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, 754 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails,
755 KOPrefs::instance()->email()); 755 KOPrefs::instance()->email());
756 if ( me != 0 ) { 756 if ( me != 0 ) {
757 if ( me->status() == Attendee::NeedsAction && me->RSVP()) 757 if ( me->status() == Attendee::NeedsAction && me->RSVP())
758 item->setReply(true && multiday < 2); 758 item->setReply(true && multiday < 2);
759 else 759 else
760 item->setReply(false); 760 item->setReply(false);
761 } else 761 } else
762 item->setReply(false); 762 item->setReply(false);
763#endif 763#endif
@@ -820,25 +820,25 @@ void MonthViewCell::insertTodo(Todo *todo)
820 if (cat.isEmpty()) { 820 if (cat.isEmpty()) {
821 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 821 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
822 } else { 822 } else {
823 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 823 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
824 } 824 }
825 } 825 }
826 826
827 } else { 827 } else {
828 pal = mStandardPalette ; 828 pal = mStandardPalette ;
829 } 829 }
830 item->setPalette( pal ); 830 item->setPalette( pal );
831 item->setRecur( todo->recurrence()->doesRecur() ); 831 item->setRecur( todo->recurrence()->doesRecur() );
832 item->setAlarm( todo->isAlarmEnabled() ); 832 item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() );
833 item->setMoreInfo( todo->description().length() > 0 ); 833 item->setMoreInfo( todo->description().length() > 0 );
834 insertItem( item , count()); 834 insertItem( item , count());
835#ifdef DESKTOP_VERSION 835#ifdef DESKTOP_VERSION
836 mToolTip.append( text ); 836 mToolTip.append( text );
837#endif 837#endif
838} 838}
839void MonthViewCell::repaintfinishUpdateCell() 839void MonthViewCell::repaintfinishUpdateCell()
840{ 840{
841 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 841 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
842 while ( mitem ) { 842 while ( mitem ) {
843 mitem->setBlockRepaint( false ); 843 mitem->setBlockRepaint( false );
844 updateItem ( mitem ); 844 updateItem ( mitem );
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 2602487..35c2a9f 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -692,28 +692,28 @@ void KOTodoView::updateView()
692*/ 692*/
693 693
694 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a 694 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a
695 // specific order of events. That means that we have to generate parent items 695 // specific order of events. That means that we have to generate parent items
696 // recursively for proper hierarchical display of Todos. 696 // recursively for proper hierarchical display of Todos.
697 mTodoMap.clear(); 697 mTodoMap.clear();
698 Todo *todo; 698 Todo *todo;
699 todo = todoList.first();// todo; todo = todoList.next()) { 699 todo = todoList.first();// todo; todo = todoList.next()) {
700 while ( todo ) { 700 while ( todo ) {
701 bool next = true; 701 bool next = true;
702 // qDebug("todo %s ", todo->summary().latin1()); 702 // qDebug("todo %s ", todo->summary().latin1());
703 Incidence *incidence = todo->relatedTo(); 703 Incidence *incidence = todo->relatedTo();
704 while ( incidence ) { 704 while ( incidence ) {
705 if ( incidence->typeID() == todoID ) { 705 if ( incidence->typeID() == todoID ) {
706 //qDebug("related %s ",incidence->summary().latin1() ); 706 //qDebug("related %s ",incidence->summary().latin1() );
707 if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { 707 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) {
708 //qDebug("related not found "); 708 //qDebug("related not found ");
709 todoList.remove( ); 709 todoList.remove( );
710 todo = todoList.current(); 710 todo = todoList.current();
711 next = false; 711 next = false;
712 incidence = 0; 712 incidence = 0;
713 713
714 } else { 714 } else {
715 //qDebug("related found "); 715 //qDebug("related found ");
716 incidence = incidence->relatedTo(); 716 incidence = incidence->relatedTo();
717 } 717 }
718 } else 718 } else
719 incidence = 0; 719 incidence = 0;
@@ -827,52 +827,54 @@ void KOTodoView::restoreItemState( QListViewItem *item )
827{ 827{
828 pendingSubtodo = 0; 828 pendingSubtodo = 0;
829 while( item ) { 829 while( item ) {
830 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 830 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
831 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 831 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
832 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 832 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
833 item = item->nextSibling(); 833 item = item->nextSibling();
834 } 834 }
835} 835}
836 836
837 837
838QMap<Todo *,KOTodoViewItem *>::ConstIterator 838QMap<Todo *,KOTodoViewItem *>::ConstIterator
839 KOTodoView::insertTodoItem(Todo *todo) 839KOTodoView::insertTodoItem(Todo *todo)
840{ 840{
841 841
842// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; 842 // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
843 // TODO: Check, if dynmaic cast is necessary 843 // TODO: Check, if dynmaic cast is necessary
844 844
845 pendingSubtodo = 0; 845 pendingSubtodo = 0;
846 Incidence *incidence = todo->relatedTo(); 846 Incidence *incidence = todo->relatedTo();
847 if (incidence && incidence->typeID() == todoID ) { 847 while ( incidence && !incidence->calEnabled() )
848 Todo *relatedTodo = static_cast<Todo *>(incidence); 848 incidence = incidence->relatedTo();
849 849 if (incidence && incidence->typeID() == todoID ) {
850// kdDebug() << " has Related" << endl; 850 Todo *relatedTodo = static_cast<Todo *>(incidence);
851 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 851
852 itemIterator = mTodoMap.find(relatedTodo); 852 // kdDebug() << " has Related" << endl;
853 if (itemIterator == mTodoMap.end()) { 853 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
854// kdDebug() << " related not yet in list" << endl; 854 itemIterator = mTodoMap.find(relatedTodo);
855 itemIterator = insertTodoItem (relatedTodo); 855 if (itemIterator == mTodoMap.end()) {
856 // kdDebug() << " related not yet in list" << endl;
857 itemIterator = insertTodoItem (relatedTodo);
858 }
859 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem
860 // and one into the map. Sure finding is more easy but why? -zecke
861 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
862 return mTodoMap.insert(todo,todoItem);
863 } else {
864 // kdDebug() << " no Related" << endl;
865 // see above -zecke
866 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
867 return mTodoMap.insert(todo,todoItem);
856 } 868 }
857 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem
858 // and one into the map. Sure finding is more easy but why? -zecke
859 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
860 return mTodoMap.insert(todo,todoItem);
861 } else {
862// kdDebug() << " no Related" << endl;
863 // see above -zecke
864 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
865 return mTodoMap.insert(todo,todoItem);
866 }
867} 869}
868 870
869 871
870void KOTodoView::updateConfig() 872void KOTodoView::updateConfig()
871{ 873{
872 updateView(); 874 updateView();
873 mTodoListView->repaintContents(); 875 mTodoListView->repaintContents();
874} 876}
875 877
876QPtrList<Incidence> KOTodoView::selectedIncidences() 878QPtrList<Incidence> KOTodoView::selectedIncidences()
877{ 879{
878 QPtrList<Incidence> selected; 880 QPtrList<Incidence> selected;
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 8cb6b83..f987b63 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -186,25 +186,25 @@ void KOTodoViewItem::setMyPixmap()
186 QPainter p; 186 QPainter p;
187 187
188 int pixSize = 0; 188 int pixSize = 0;
189 QPixmap pPix = QPixmap( size, size ); 189 QPixmap pPix = QPixmap( size, size );
190 if ( mTodo->description().length() > 0 ) { 190 if ( mTodo->description().length() > 0 ) {
191 pixi.resize(size, pixSize+size); 191 pixi.resize(size, pixSize+size);
192 pPix.fill( Qt::darkGreen ); 192 pPix.fill( Qt::darkGreen );
193 p.begin( &pixi ); 193 p.begin( &pixi );
194 p. drawPixmap ( 0, pixSize, pPix); 194 p. drawPixmap ( 0, pixSize, pPix);
195 p.end(); 195 p.end();
196 pixSize += size; 196 pixSize += size;
197 } 197 }
198 if ( mTodo->isAlarmEnabled() ) { 198 if ( mTodo->isAlarmEnabled() && mTodo->alarmEnabled()) {
199 pixi.resize(size, pixSize+size); 199 pixi.resize(size, pixSize+size);
200 pPix.fill( Qt::red ); 200 pPix.fill( Qt::red );
201 p.begin( &pixi ); 201 p.begin( &pixi );
202 p. drawPixmap ( 0, pixSize, pPix); 202 p. drawPixmap ( 0, pixSize, pPix);
203 p.end(); 203 p.end();
204 pixSize += size; 204 pixSize += size;
205 } 205 }
206 if ( mTodo->doesRecur() ) { 206 if ( mTodo->doesRecur() ) {
207 pixi.resize(size, pixSize+size); 207 pixi.resize(size, pixSize+size);
208 pPix.fill( Qt::blue ); 208 pPix.fill( Qt::blue );
209 p.begin( &pixi ); 209 p.begin( &pixi );
210 p. drawPixmap ( 0, pixSize, pPix); 210 p. drawPixmap ( 0, pixSize, pPix);
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index e8574a0..221debc 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -586,25 +586,25 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
586 tempText +=((Todo*)ev)->dtDueTimeStr(); 586 tempText +=((Todo*)ev)->dtDueTimeStr();
587 mTodos.append( ev ); 587 mTodos.append( ev );
588 } 588 }
589 } 589 }
590 } 590 }
591 tempText += "</b></td><td>"; 591 tempText += "</b></td><td>";
592 bool needClose = false; 592 bool needClose = false;
593 if ( ev->cancelled() ) { 593 if ( ev->cancelled() ) {
594 tempText += "<font color=\"#F00000\">[c"; 594 tempText += "<font color=\"#F00000\">[c";
595 needClose =true; 595 needClose =true;
596 596
597 } 597 }
598 if ( ev->isAlarmEnabled() ) { 598 if ( ev->isAlarmEnabled() && ev->alarmEnabled()) {
599 if ( !needClose) 599 if ( !needClose)
600 tempText +="["; 600 tempText +="[";
601 tempText += "a"; 601 tempText += "a";
602 needClose =true; 602 needClose =true;
603 603
604 } 604 }
605 if ( ev->description().length() > 0 ) { 605 if ( ev->description().length() > 0 ) {
606 if ( !needClose) 606 if ( !needClose)
607 tempText +="["; 607 tempText +="[";
608 tempText += "i"; 608 tempText += "i";
609 needClose =true; 609 needClose =true;
610 } 610 }
@@ -660,25 +660,25 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
660 else 660 else
661 mText += "<li>"; 661 mText += "<li>";
662 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; 662 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
663 663
664 664
665 mText += ind; 665 mText += ind;
666 bool needClose = false; 666 bool needClose = false;
667 if ( ev->cancelled() ) { 667 if ( ev->cancelled() ) {
668 mText += "<font color=\"#F00000\">[c"; 668 mText += "<font color=\"#F00000\">[c";
669 needClose =true; 669 needClose =true;
670 670
671 } 671 }
672 if ( ev->isAlarmEnabled() ) { 672 if ( ev->isAlarmEnabled() && ev->alarmEnabled() ) {
673 if ( !needClose) 673 if ( !needClose)
674 mText +="["; 674 mText +="[";
675 mText += "a"; 675 mText += "a";
676 needClose =true; 676 needClose =true;
677 677
678 } 678 }
679 679
680 if ( ev->description().length() > 0 ) { 680 if ( ev->description().length() > 0 ) {
681 if ( !needClose) 681 if ( !needClose)
682 mText +="["; 682 mText +="[";
683 mText += "i"; 683 mText += "i";
684 needClose =true; 684 needClose =true;